Skip to content

Commit 3bb26ad

Browse files
lesnik512claude
andauthored
chore: lift fastapi<0.137 cap; require instrumentator>=8.0.1 (#133)
The cap (1.1.1) existed only because prometheus-fastapi-instrumentator <=8.0.0 crashed on FastAPI 0.137's _IncludedRouter. Fixed upstream in instrumentator 8.0.1 (issue #370). Remove fastapi<0.137 and raise the fastapi-metrics floor to >=8.0.1 so the fix is guaranteed wherever metrics are installed. Verified against FastAPI 0.138.0 + instrumentator 8.0.2: full suite green at 100%. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1b0860e commit 3bb26ad

2 files changed

Lines changed: 25 additions & 6 deletions

File tree

planning/releases/1.2.1.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# lite-bootstrap 1.2.1 — lift the FastAPI 0.137 cap
2+
3+
**1.2.1 is a patch release. No public-API or behavior changes.** It removes the temporary `fastapi<0.137` ceiling introduced in 1.1.1, now that the upstream `prometheus-fastapi-instrumentator` fix has shipped.
4+
5+
## Dependency constraints
6+
7+
- **`fastapi<0.137` cap removed** from the `fastapi` extra (the single declaration every `fastapi-*` extra composes from). FastAPI 0.137 and 0.138 now resolve.
8+
- **`prometheus-fastapi-instrumentator` floor raised** on the `fastapi-metrics` extra: `>=6.1``>=8.0.1`. The crash that motivated the cap required FastAPI ≥0.137 *and* instrumentator ≤8.0.0, so lifting the FastAPI ceiling is paired with a floor that guarantees the fixed instrumentator wherever metrics are installed.
9+
10+
The original cap was added in 1.1.1 because `prometheus-fastapi-instrumentator` read `route.path` unconditionally and crashed on FastAPI 0.137's internal `_IncludedRouter` route type. That is fixed upstream in instrumentator [v8.0.1](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v8.0.1) (issue [#370](https://github.com/trallnag/prometheus-fastapi-instrumentator/issues/370), closed 2026-06-22). lite-bootstrap's own offline-docs guard (the `isinstance(route, Route)` filter shipped in 1.1.1) remains in place.
11+
12+
Verified end-to-end against FastAPI 0.138.0 + prometheus-fastapi-instrumentator 8.0.2: full suite green at 100% coverage, including the offline-docs and metrics paths that previously crashed.
13+
14+
## Backwards compatibility
15+
16+
Fully backward compatible with 1.2.0. No public API or behavior changed; this is purely a loosening of resolution constraints. Installs that were held at FastAPI ≤0.136 by the cap will now resolve forward to current FastAPI.
17+
18+
## References
19+
20+
- Upstream fix: [prometheus-fastapi-instrumentator v8.0.1](https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v8.0.1), issue [#370](https://github.com/trallnag/prometheus-fastapi-instrumentator/issues/370)
21+
- Original cap: 1.1.1 (PR [#122](https://github.com/modern-python/lite-bootstrap/pull/122))

pyproject.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ free-all = [
5151
"lite-bootstrap[sentry,otl,logging,pyroscope]",
5252
]
5353
fastapi = [
54-
# FastAPI 0.137 introduced the internal `_IncludedRouter` route type, which
55-
# prometheus-fastapi-instrumentator (<=8.0.0) does not handle (it reads `route.path`
56-
# unconditionally and raises AttributeError). Cap until a fixed instrumentator ships.
57-
# Upstream issue: https://github.com/trallnag/prometheus-fastapi-instrumentator/issues/370
58-
"fastapi<0.137",
54+
"fastapi",
5955
]
6056
fastapi-sentry = [
6157
"lite-bootstrap[fastapi,sentry]",
@@ -69,7 +65,9 @@ fastapi-logging = [
6965
]
7066
fastapi-metrics = [
7167
"lite-bootstrap[fastapi]",
72-
"prometheus-fastapi-instrumentator>=6.1",
68+
# >=8.0.1 carries the _IncludedRouter fix required for FastAPI >=0.137
69+
# (trallnag/prometheus-fastapi-instrumentator#370).
70+
"prometheus-fastapi-instrumentator>=8.0.1",
7371
]
7472
fastapi-all = [
7573
"lite-bootstrap[fastapi-sentry,fastapi-otl,fastapi-logging,fastapi-metrics,pyroscope]",

0 commit comments

Comments
 (0)