Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]¶
Added¶
FastApiSettings.telemetry(config keyfastapi.telemetry) is passed to FastAPI's built-in OpenTelemetry (FastAPI >= 0.142; ignored by older versions).
Fixed¶
- FastAPI 0.142 enables OpenTelemetry by default and, with
OTEL_EXPORTER_OTLP_ENDPOINTset, appends its own OTLP exporter to the global providers at startup: an app whose providers were already configured (for example by pico-otel) exported every span twice.telemetrynow defaults to{"auto_configure": False}, so FastAPI records its spans against your providers but never adds exporters of its own. Opt back in withfastapi.telemetry.auto_configure: true. - The app factory passes settings to
FastAPI()without deep-copying them, sotelemetrycan carry OpenTelemetry providers (it failed withcannot pickle '_thread.lock' object).
v0.4.2 — Dependency floors match the test suite (2026-09-29)¶
Fixed¶
- Dependency floors raised to what the test suite proves:
fastapi >= 0.110.1(was 0.100, whose TestClient no longer works with current httpx). A new CI job runs the suite with every declared floor pinned, so a floor that installs but does not work can no longer ship.
v0.4.1 — Session extra no longer caps Starlette (2026-09-19)¶
Fixed¶
- The
sessionextra installsitsdangerous, the only thing Starlette's ownSessionMiddlewareneeds. It used to pullstarlette-session, an unrelated package that requiresstarlette<1and silently held installs on Starlette 0.x. Verified against Starlette 1.6.0 and FastAPI 0.141.1.
v0.4.0 — Public pico-ioc seams (2026-08-04)¶
Changed¶
- Controller discovery enumerates the registry through the public
container.keys()seam instead of reaching into the container's private locator metadata. - Request-scope cleanup calls the public
container.cleanup_scope()instead ofcontainer._caches.cleanup_scope(), so thehasattr(container, "_caches")guard disappears. - Minimum pico-ioc raised to 2.5.0, the version that makes both seams public.
v0.3.1 — Docs & CI (2026-07-10)¶
Changed¶
- Documentation raised to the fleet standard (docs QA at zero, AI-first
llms.txt, flagship use case linked, emojis stripped). - SonarCloud analysis runs from CI on main pushes; dependency floors aligned with the fleet canon.
v0.3.0 — Breaking: Configurer Rename (2026-02-20)¶
Changed¶
- Breaking: Renamed
FastApiConfigurer.configure(app)toconfigure_app(app)to avoid protocol collision withDatabaseConfigurer.configure(engine)in structural typing.
v0.2.2 — Internal Quality (2026-02-06)¶
Changed¶
- Error Handling: Replaced
InvalidConfigurerErrorexception with alogger.warning()— invalid configurers are now logged and discarded instead of raising. - Logging: Added
loggingtofactory.pyfor configurer validation and WebSocket parameter detection.
Removed¶
InvalidConfigurerError: Removed exception class, its export from__init__.py, and all related tests.
Fixed¶
- Code Quality: Changed bare
except:toexcept Exception:in test conftest.
v0.2.1 — Fixes & Quality (2026-02-05)¶
Fixed¶
- Fixed CI badge in README pointing to pico-ioc instead of pico-fastapi.
- Fixed all references from
pico-stacktopico-bootin CHANGELOG and release notes. - Fixed 5 broken unit tests against current pico-ioc attribute names (
_pico_meta,_pico_infra). - Fixed middleware test mock not propagating exceptions correctly.
- Fixed factory test expecting silent return instead of
NoControllersFoundError. - Removed redundant
pip install pico-ioc fastapifrom README (already dependencies).
Changed¶
- Bumped
pico-iocdependency from>= 2.1.3to>= 2.2.0. - Dropped Python 3.10 from CI matrix, tox and Makefile (requires-python is
>=3.11). - Reverted
version_schemetopost-release(guess-next-devcaused.dev0versions to leak to PyPI).
v0.2.0 — Ecosystem Integration (2025-11-25)¶
New¶
- Added native
pico-bootauto-discovery using thepico_boot.modulesentry point. pico-fastapiis now automatically detected and loaded when initializing applications withpico-boot.
No Behavioral Changes¶
- No updates to middleware behavior.
- No DI or request lifecycle changes.
- No breaking changes.
This release focuses exclusively on ecosystem alignment and improving the developer experience when bootstrapping applications with pico-boot.
[0.1.2] - 2025-11-18¶
Fixed¶
- Middleware Ordering: Fixed a critical issue where
PicoScopeMiddlewarewas always added last (outermost), preventing inner middlewares (like Authentication) from accessing the IoC container. - Architecture: Implemented a "Sandwich" strategy for
FastApiConfigurer. Configurers with negative priority (priority < 0) now wrap the scope middleware (e.g., Session, CORS), while configurers with positive priority (priority >= 0) run inside the scope (e.g., Auth, Business Logic).
[0.1.1] - 2025-11-18¶
Fixed¶
- Critical: Fixed a memory leak in
PicoScopeMiddleware. Request and WebSocket scopes were not being explicitly cleaned up after connection closure, leading to unbounded memory usage (aligned withpico-iocv2.1.3 breaking changes). - Fixed WebSocket argument injection mechanism. Previously, the controller method argument had to be named
websocket. It is now detected dynamically by type annotation (websocket: WebSocket), allowing any argument name (e.g.,ws: WebSocket).
Changed¶
- Architecture: Removed the global
CONTROLLERSset used for route registration. Controllers are now discovered by inspecting thepico-ioccontainer's metadata directly. This fixes state pollution issues during testing and ensures a single source of truth. - Updated dependency requirement to
pico-ioc>=2.1.3.
[0.1.0] - 2025-11-02¶
Added¶
- Initial public release of
pico-fastapi. @controllerdecorator for class-based, dependency-injected API routers.- Route decorators (
@get,@post,@put,@delete,@patch,@websocket) for controller methods. PicoScopeMiddlewarefor automaticrequest,session, andwebsocketscope management, linking FastAPI's lifecycle topico-ioc.FastApiAppFactoryto provide aFastAPIinstance as an injectable singleton.FastApiSettingsdataclass for type-safe application configuration via@configured.FastApiConfigurerprotocol for creating custom, prioritized setup hooks.- Automatic FastAPI
lifespanintegration to manage container startup and shutdown (cleanup_all_async,shutdown). - Custom exceptions (
InvalidConfigurerError,NoControllersFoundError).