refactor: move utils/structures.py into support/#186
Merged
Conversation
utils/structures.py was used (Configuration.data(), Loader.load()), so per the foundation/support consolidation it belongs in support/ alongside the rest of the framework's internal helpers. The utils/ directory had no __init__.py and nothing else referenced it, so it's gone entirely now that its one file has moved. Updated the two import sites accordingly.
tmgbedu
commented
Jul 17, 2026
tmgbedu
left a comment
Contributor
Author
There was a problem hiding this comment.
[Code Reviewer verdict: APPROVE — posting as a comment; gh blocks formal --approve since the reviewing account is also the PR author.]
Verified independently (not just trusting the PR description):
1) History-preserving move + no dangling references
git diffshowssupport/structures.pyas a 100% similarity RENAME fromutils/structures.py— history preserved correctly.- File content is byte-for-byte unchanged (diff confirms 0 additions/0 deletions on the moved file itself).
- Grepped the entire monorepo for
utils.structures/utils/structures/utils import structures/ anyfastapi_startkit.utils/from ..utils/from .utilspattern — zero hits anywhere. utils/is untracked by git after the move (git ls-files src/fastapi_startkit/utils/returns nothing) — a fresh clone won't have the directory at all. (A local worktree showed an empty leftoverutils/folder on disk, but that's just a filesystem artifact of an in-place checkout, not something committed — non-issue.)
2) Consistency with support/ conventions (PR #162)
- Checked
support/__init__.py: it re-exportsCollection,collect,Str,Stringable,Uri,Uriable,Provider— but does not re-export anything fromdataclass.py(theDataclassclass is imported by its full module path elsewhere).structures.pyfollows the same pattern (no re-export added). Precedent claim checks out.
3) Both import sites correctly updated + nothing else broken
configuration/Configuration.py:from ..support.structures import data— confirmeddata()is actually called (self._config = data(),return data(config_at_path)).loader/Loader.py:from ..support.structures import load— confirmedload()is actually called in 3 places.- Relative import depth is unaffected:
utils/andsupport/are both direct children offastapi_startkit/, sostructures.py's own internalfrom ..exceptions.exceptions import LoaderNotFoundstill resolves correctly post-move.
4) CI / test status
- Reran locally on the PR branch:
uv run pytest --ignore=tests/masoniteorm/postgres -q→ 1867 passed, 7 skipped, 4 subtests — matches the PR description exactly. uv run ruff check .→ all checks passed.uv run ruff format --check .→ clean (490 files already formatted).gh pr checks 186: Ruff and Pyright (non-blocking) both pass (on both workflow runs). ThePytestGitHub Actions job was still pending/queued at review time (not failed) — my local rerun already confirms the suite passes, so this isn't a correctness concern, just CI queue latency worth confirming turns green before merge.
No issues found. Clean, well-scoped refactor. Approving.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Audit of
fastapi_startkit/src/fastapi_startkit/utils/structures.py(task #1133).data()is imported byconfiguration/Configuration.py, andload()is imported byloader/Loader.py.support/structures.py(support/ already exists from the earlier foundation/support consolidation, PR Relocate providers/helpers into foundation and support #162) viagit mv, and updated both import sites (..utils.structures->..support.structures). No__init__.pyre-export was added, matching the existing precedent forsupport/dataclass.py(imported by its full module path, not re-exported fromsupport/__init__.py).utils/had no__init__.pyand nothing else referenced it, so the directory is gone now that its only file moved.Test plan
fastapi_startkit/,example/*,application/,tests) forutils.structures/utils/structures/utils import structures— no remaining references.uv run pytest --ignore=tests/masoniteorm/postgres— 1867 passed, 7 skipped, 4 subtestsuv run ruff check ./uv run ruff format --check .— clean