Skip to content

Re-export pyramid_di DI primitives from tet.services (0.5.0)#5

Merged
ztane merged 1 commit into
masterfrom
feat/reexport-pyramid-di-from-services
May 28, 2026
Merged

Re-export pyramid_di DI primitives from tet.services (0.5.0)#5
ztane merged 1 commit into
masterfrom
feat/reexport-pyramid-di-from-services

Conversation

@ztane
Copy link
Copy Markdown
Member

@ztane ztane commented May 28, 2026

Summary

  • tet.services now re-exports service, RequestScopedBaseService, ApplicationScopedBaseService, BaseService and autowired from pyramid_di, giving Tet applications a single, stable import location instead of reaching into pyramid_di directly.
  • The module declares __all__ and carries # noqa: F401 on the import line so linters (pyflakes, ruff F401) won't flag the imports as unused.
  • The docstring examples in tet/services/__init__.py are updated to import from tet.services.
  • CHANGES.md gets a 0.5.0 entry; setup.py is bumped 0.4.3-dev0.5.0.

The runtime behaviour of includeme (which still just calls config.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 import from tet.services import autowired, which broke when tet.services was originally collapsed to a feature shim. Centralising the DI symbols back on tet.services is the single-stable-import-path story we want; users shouldn't need to know that DI is provided by pyramid_di under the hood.

Test plan

  • Local smoke test: from tet.services import service, autowired, RequestScopedBaseService, ApplicationScopedBaseService, BaseService, includeme all resolve; tet.services.autowired is pyramid_di.autowired.
  • pyflakes tet/services/__init__.py clean.
  • ruff check --select F,E,W tet/services/__init__.py clean.
  • CI green on this branch.

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.
@ztane ztane requested a review from hieuh25 May 28, 2026 10:33
@ztane ztane merged commit 4744b17 into master May 28, 2026
8 checks passed
@ztane ztane deleted the feat/reexport-pyramid-di-from-services branch May 28, 2026 10:33
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.

1 participant