Relocate providers/helpers into foundation and support#162
Conversation
Move the framework's provider base and app provider out of the top-level providers/ package and the shared helpers into support/: - providers/app_provider.py -> foundation/app_provider.py - providers/Provider.py -> support/providers/provider.py - providers/__init__.py -> support/providers/__init__.py - helpers/dataclass.py -> support/dataclass.py - remove helpers/app.py - support/__init__.py now re-exports Provider Update every import across the framework and tests to the new locations, including relative-import call sites in configuration, storage and broadcasting providers.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Code Review — REQUEST CHANGES ❌The framework-package refactor itself (src + tests) is clean, but the PR ships a breaking change with a red CI because downstream consumers were not updated and no backward-compat shim was added. Blockers
Verified good
Action: pick shim (a) or downstream-update (b), get CI green, then re-request review. Do not merge until Pytest passes. |
Point the console providers in example/console-app and example/database-app at the new fastapi_startkit.support.Provider location so the example test suites stop failing with ModuleNotFoundError. Since the old fastapi_startkit.providers path is removed with no compat shim, bump the framework minor version (0.47.0 -> 0.48.0) and document the breaking import changes in a new CHANGELOG.
Code Review — APPROVE ✅ (re-review @ d2b29f0)All previously-flagged blockers are resolved. Re-verified against the PR branch:
Also confirmed earlier and still holds: LGTM. Approving. (Not merging — leave the merge to the maintainer.) |
Summary
Relocates the framework's provider base and shared helpers out of the top-level
providers/andhelpers/packages intofoundation/andsupport/, and fixes every import across the framework and tests.Moves
providers/app_provider.pyfoundation/app_provider.pyproviders/Provider.pysupport/providers/provider.pyproviders/__init__.pysupport/providers/__init__.pyhelpers/dataclass.pysupport/dataclass.pyhelpers/app.pysupport/__init__.pynow re-exportsProvider.Import fixes
application.py:providers.app_provider→foundation.app_providerconfiguration/Configuration.py:helpers.dataclass→support.dataclasssupport/providers/provider.py:helpers.dataclass→support.dataclass(also dropped unuseddataclasses/Anyimports and corrected the now-invalid relative..applicationtype-check import to an absolute one)masoniteorm/providers/DatabaseProvider.py:providers.Provider→supportfrom fastapi_startkit.providers import Provider→from fastapi_startkit.support import Provideracross mcp, vite, inertia, ai, fastapi, skills and logging providers plus the corresponding testsfrom ...providers import Provider/from ..providers import Providerinconfiguration/providers/ConfigurationProvider.py,storage/providers/provider.pyandbroadcasting/provider.pyThe
broadcasting.helpers.appmodule is a separate module and is intentionally left untouched.Verification
import fastapi_startkitsmoke import: OKpytest --ignore=tests/masoniteorm/postgres: 1777 passed, 7 skippedruff check .: all checks passedruff format --check .: cleanfastapi_startkit.providers,providers.Provider,providers.app_provider,helpers.dataclass, orhelpers.appreferences (onlybroadcasting.helpers.appremains, as intended)The top-level
fastapi_startkit.providerspackage is removed with no backward-compatibility shim (confirmed maintainer decision). Consumers must update imports:from fastapi_startkit.providers import Providerfrom fastapi_startkit.support import Providerfrom fastapi_startkit.providers.app_provider import ...from fastapi_startkit.foundation.app_provider import ...from fastapi_startkit.helpers.dataclass import ...from fastapi_startkit.support.dataclass import ...fastapi_startkit.helpers.appis removed.Framework version bumped 0.47.0 → 0.48.0 (0.x package → breaking change bumps the minor). Documented in
fastapi_startkit/CHANGELOG.md.Downstream fix (follow-up to the sweep)
The original sweep missed the
example/workspace members, which broke their test suites withModuleNotFoundError: No module named 'fastapi_startkit.providers'. Updated the two remaining consumers:example/console-app/providers/console.pyexample/database-app/providers/console_provider.pyFull-repo grep (application/, example/, src, tests) is clean — no remaining
fastapi_startkit.providers/providers.Provider/providers.app_provider/helpers.dataclass/helpers.appreferences (onlybroadcasting.helpers.appremains, as intended).example/database-apptests/features/students+tests/features/teachersnow pass (5 passed).