Skip to content

Fix mixed import patterns of __init__.py#113

Merged
ChanukaUOJ merged 17 commits into
LDFLK:mainfrom
rusiru-erandaka:fix-mixed-import-patterns
Jun 28, 2026
Merged

Fix mixed import patterns of __init__.py#113
ChanukaUOJ merged 17 commits into
LDFLK:mainfrom
rusiru-erandaka:fix-mixed-import-patterns

Conversation

@rusiru-erandaka

Copy link
Copy Markdown
Contributor

Changes

  • Added init.py to all packages to expose public symbols
  • Refactored all deep internal imports to use package-level interface
  • All 217 tests passing

Notes

Two pre-existing RuntimeWarnings exist in test_document_service.py
and test_person_service.py related to unawaited async mocks.
These are unrelated to this PR's scope.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors imports across the codebase to use package-level imports via newly introduced __init__.py files, simplifying import statements in routers, services, and tests. The feedback suggests sorting imports and __all__ lists alphabetically in src/services/__init__.py and src/models/__init__.py to improve readability and maintainability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/services/__init__.py
Comment thread src/services/__init__.py Outdated
Comment thread src/models/__init__.py Outdated
Comment thread src/models/__init__.py
@zaeema-n

Copy link
Copy Markdown
Member

Hi @rusiru-erandaka, thank you for the pr! Please resolve the bot comments.

This pr closes #101

rusiru-erandaka and others added 3 commits June 24, 2026 14:13
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@rusiru-erandaka

Copy link
Copy Markdown
Contributor Author

Hi, @zaeema-n I resolved the bots comments.

@zaeema-n

Copy link
Copy Markdown
Member

Thanks @rusiru-erandaka, we will review this as soon as possible

@ChanukaUOJ

ChanukaUOJ commented Jun 26, 2026

Copy link
Copy Markdown
Member

@rusiru-erandaka

src/enums/__init__.py was the only file using absolute imports instead of relative imports. can we use relative imports there as well

from .kindEnum import KindMajorEnum, KindMinorEnum
from .relationEnum import RelationNameEnum, RelationDirectionEnum
from .idEnum import EntityIdEnum

@ChanukaUOJ ChanukaUOJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial Commit!

@rusiru-erandaka

Copy link
Copy Markdown
Contributor Author

@ChanukaUOJ
I added Relative imports instead of Absolute imports in enum can you check it.

@ChanukaUOJ ChanukaUOJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the contribution @rusiru-erandaka!

@ChanukaUOJ ChanukaUOJ merged commit 292e59b into LDFLK:main Jun 28, 2026
3 checks passed
@ChanukaUOJ ChanukaUOJ linked an issue Jun 28, 2026 that may be closed by this pull request
@rusiru-erandaka

Copy link
Copy Markdown
Contributor Author

LGTM! Thanks for the contribution @rusiru-erandaka!

you're welcome 🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent use of __init__.py causing mixed import patterns

3 participants