Skip to content

chore: deprecate wrap_in_fastapi via PEP 702 @deprecated#69

Merged
aballman merged 2 commits into
mainfrom
aballman/deprecate-wrap-in-fastapi
May 20, 2026
Merged

chore: deprecate wrap_in_fastapi via PEP 702 @deprecated#69
aballman merged 2 commits into
mainfrom
aballman/deprecate-wrap-in-fastapi

Conversation

@aballman
Copy link
Copy Markdown
Contributor

@aballman aballman commented May 20, 2026

Summary

  • Mark wrap_in_fastapi (and the etl-uvicorn CLI it backs) as deprecated using typing_extensions.deprecated (PEP 702).
  • Add a deprecation banner to README.md pointing users at building a FastAPI app directly.
  • Add a CHANGELOG.md entry and bump version 0.0.420.0.43.

Why

The wrapper obfuscates the mental model of what a plugin actually is. By auto-generating routes from a Python function's signature, plugin authors never have to engage with the HTTP contract the platform actually depends on — which routes exist, what they return, when each one is called. Authors end up reasoning about "my run() function" instead of "my plugin's API surface," and that gap shows up the moment the contract evolves and the helper doesn't keep up.

Encoding the deprecation in code rather than tribal knowledge means:

  • IDEs and type-checkers (pyright/mypy) show strikethrough at every call site and import, nudging plugin authors at edit time.
  • ruff recognizes the decorator via DeprecationWarning.
  • Test suites that don't suppress DeprecationWarning (pytest default) emit one warning per call.

Noise expectations

  • Production: effectively zero — Python's default warnings filter suppresses DeprecationWarning from non-__main__ modules.
  • CI / pytest: one warning per wrap_in_fastapi call. Verified locally: 68 tests pass, 7 distinct call sites emit the warning.
  • Editor / type-checker: persistent strikethrough — this is the channel that does the actual nudging.

Test plan

  • make check-ruff passes
  • PYTHONPATH=. pytest test/ — 68 passed
  • Verified DeprecationWarning fires from wrap_in_fastapi call sites in tests

Mark wrap_in_fastapi (and the etl-uvicorn CLI it backs) as deprecated.
New plugins should hand-roll a FastAPI app with explicit /invoke,
/schema, /precheck, /id, and /ready handlers; chunker is the reference
pattern. Adds the typing_extensions.deprecated decorator (IDE/type-checker
strikethrough + runtime DeprecationWarning), a README banner, and a
CHANGELOG entry. Bumps version to 0.0.43.
@aballman aballman merged commit 094fc3d into main May 20, 2026
14 checks passed
@aballman aballman deleted the aballman/deprecate-wrap-in-fastapi branch May 20, 2026 21:51
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.

2 participants