Re-export pyramid_di DI primitives from tet.services (0.5.0)#5
Merged
Conversation
tet.services now re-exports `service`, `RequestScopedBaseService`, `ApplicationScopedBaseService`, `BaseService` and `autowired` from pyramid_di so application code has a single stable import location. Linters won't flag the unused imports: the module declares __all__, and the import line carries a belt-and-suspenders `# noqa: F401`. The docstring examples are updated to import from tet.services.
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
tet.servicesnow re-exportsservice,RequestScopedBaseService,ApplicationScopedBaseService,BaseServiceandautowiredfrompyramid_di, giving Tet applications a single, stable import location instead of reaching intopyramid_didirectly.__all__and carries# noqa: F401on the import line so linters (pyflakes, ruffF401) won't flag the imports as unused.tet/services/__init__.pyare updated to import fromtet.services.CHANGES.mdgets a 0.5.0 entry;setup.pyis bumped0.4.3-dev→0.5.0.The runtime behaviour of
includeme(which still just callsconfig.include("pyramid_di")) is unchanged — this is a pure additive change to the public API surface.Why
Application code (e.g. the projects generated from
interjektio-app-cookiecutter) used to importfrom tet.services import autowired, which broke whentet.serviceswas originally collapsed to a feature shim. Centralising the DI symbols back ontet.servicesis the single-stable-import-path story we want; users shouldn't need to know that DI is provided bypyramid_diunder the hood.Test plan
from tet.services import service, autowired, RequestScopedBaseService, ApplicationScopedBaseService, BaseService, includemeall resolve;tet.services.autowired is pyramid_di.autowired.pyflakes tet/services/__init__.pyclean.ruff check --select F,E,W tet/services/__init__.pyclean.