Skip to content

Commit e13c5cb

Browse files
authored
fix(deps): declare the floors the extras require, and pin them before installing wheel-only (#259)
* fix(deps): declare the floors each extra's own dependencies require * ci: pin the declared floors before installing them wheel-only
1 parent 1b5321b commit e13c5cb

2 files changed

Lines changed: 23 additions & 7 deletions

File tree

‎.github/workflows/_checks.yml‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ jobs:
144144
# orjson because it belongs to no *-all extra and its floor is a wheel-availability
145145
# one, which only an interpreter matrix can check.
146146
include:
147-
- {target: free, extras: "free-all,orjson"}
148-
- {target: fastapi, extras: "fastapi-all"}
149-
- {target: litestar, extras: "litestar-all"}
150-
- {target: faststream, extras: "faststream-all"}
151-
- {target: fastmcp, extras: "fastmcp-all"}
147+
- {target: free, extras: "--extra free-all --extra orjson"}
148+
- {target: fastapi, extras: "--extra fastapi-all"}
149+
- {target: litestar, extras: "--extra litestar-all"}
150+
- {target: faststream, extras: "--extra faststream-all"}
151+
- {target: fastmcp, extras: "--extra fastmcp-all"}
152152
steps:
153153
- uses: actions/checkout@v6
154154
- uses: astral-sh/setup-uv@v8.2.0
@@ -157,7 +157,9 @@ jobs:
157157
cache-dependency-glob: "**/pyproject.toml"
158158
- run: uv python install ${{ matrix.python-version }}
159159
- run: uv venv --python ${{ matrix.python-version }}
160-
- name: Install at the declared floors
161-
run: uv pip install --resolution lowest-direct ".[${{ matrix.extras }}]"
160+
# Pinned with builds allowed, so a floor with no wheel fails the wheel-only install below.
161+
- run: uv pip compile pyproject.toml ${{ matrix.extras }} --no-deps --resolution lowest-direct -o floors.txt
162+
- run: uv pip install -r pyproject.toml ${{ matrix.extras }} --constraints floors.txt --no-build
163+
- run: uv pip install --no-deps .
162164
- name: Bootstrap at the floors
163165
run: .venv/bin/python scripts/floor_smoke.py ${{ matrix.target }}

‎pyproject.toml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ otl = [
7171
"opentelemetry-sdk>=1.28",
7272
"opentelemetry-exporter-otlp-proto-grpc>=1.28",
7373
"opentelemetry-instrumentation>=0.49b0",
74+
# The exporter pulls grpcio, whose first cp314 wheels (1.75.1) require typing-extensions>=4.12.
75+
"typing-extensions>=4.12; python_version >= '3.14'",
7476
]
7577
otl-http = [
7678
"opentelemetry-api>=1.28",
@@ -91,6 +93,8 @@ fastapi = [
9193
# >=0.112.2 for fastapi.routing._merge_lifespan_context, which FastAPIBootstrapper._wrap_lifespan
9294
# uses to chain teardown onto the user's lifespan. Private, so it can move without a deprecation.
9395
"fastapi>=0.112.2",
96+
# fastapi 0.112.2 requires typing-extensions>=4.8.
97+
"typing-extensions>=4.8",
9498
]
9599
fastapi-sentry = [
96100
"lite-bootstrap[fastapi,sentry]",
@@ -107,6 +111,12 @@ fastapi-metrics = [
107111
# >=8.0.1 carries the _IncludedRouter fix required for FastAPI >=0.137
108112
# (trallnag/prometheus-fastapi-instrumentator#370).
109113
"prometheus-fastapi-instrumentator>=8.0.1",
114+
# The instrumentator requires starlette>=1.0, which fastapi first allows at 0.133.
115+
"fastapi>=0.133",
116+
# The lowest typing-extensions a wheel-only resolve accepts with fastapi 0.133: its pydantic
117+
# stack needs 4.12, and 4.14.1 on the interpreters whose pydantic-core wheels start later.
118+
"typing-extensions>=4.12; python_version < '3.13'",
119+
"typing-extensions>=4.14.1; python_version >= '3.13'",
110120
]
111121
fastapi-all = [
112122
"lite-bootstrap[fastapi-sentry,fastapi-otl,fastapi-logging,fastapi-metrics,pyroscope]",
@@ -158,6 +168,8 @@ faststream = [
158168
# combination pins typing-extensions at 4.8 and drags pydantic back to a build that has no
159169
# cp313 wheel either.
160170
"typing-extensions>=4.12.2",
171+
# pydantic 2.12, the 3.14 floor above, requires >=4.14.1.
172+
"typing-extensions>=4.14.1; python_version >= '3.14'",
161173
]
162174
faststream-sentry = [
163175
"lite-bootstrap[faststream,sentry]",
@@ -181,6 +193,8 @@ fastmcp = [
181193
# (FastMcpBootstrapper registers its teardown through them --
182194
# docs/adr/0001-fastmcp-teardown-via-provider-lifespan.md).
183195
"fastmcp>=3.0",
196+
# fastmcp 3.0 pulls py-key-value-aio, which requires typing-extensions>=4.15.
197+
"typing-extensions>=4.15",
184198
]
185199
fastmcp-metrics = [
186200
"lite-bootstrap[fastmcp]",

0 commit comments

Comments
 (0)