Repository navigation
build(deps): Declare requires-python in pyproject.toml - #125179
Merged
Merged
Conversation
Without an explicit requires-python, uv derives it from whichever interpreter runs it. Locally that is 3.13 and everything works, but Dependabot runs uv under Python 3.14 and resolves for >=3.14, which fails on wheel-only packages with no cp314 wheels (backports-zstd is a backport of 3.14's compression.zstd and upstream caps it at <3.14). Every uv.lock security update from Dependabot currently fails this way. Declare the range the lockfile already records so resolution no longer depends on the interpreter. uv checks dependency requires-python against the project's lower bound only, so >=3.13 matches current behavior and produces no lockfile change. Co-Authored-By: Claude <[email protected]>
untitaker
approved these changes
Sep 22, 2026
oioki
marked this pull request as ready for review
September 22, 2026 10:04
oioki
added a commit
that referenced
this pull request
Sep 22, 2026
Bump `anyio` 3.7.1 → 4.14.2 in `uv.lock`, closing Dependabot alerts #721 and #720. - **GHSA-82r6-8w77-94w6 / CVE-2026-63374 (critical)** — `TLSStream.wrap()` and `connect_tcp()` encode internationalized host names with IDNA 2003. An attacker who can redirect a connection to a non-ASCII domain can obtain a legitimate certificate for the IDNA 2003 encoding of that name and have it validate on the client. - **GHSA-5p39-cfhj-2xmp / CVE-2026-64847 (medium)** — process-pool workers can block indefinitely on undrained stderr. This bump was blocked until now: `openai==1.3.5` pinned `anyio<4`, so the resolver could not move it. That dependency turned out to be unused and was removed in #125177, which this PR builds on. `sniffio` is no longer an anyio dependency but stays in the lock via another dependent. ## On the major version bump (3.x → 4.x) anyio 4.0.0 has six backwards-incompatible changes; 4.1 through 4.14.2 add none. Only one is reachable from this repo: - **Task-group exceptions are now wrapped in `ExceptionGroup`** and related cancellation-semantics changes. No consumer here catches `ExceptionGroup` or relies on unwrapped task-group exceptions. - **The pytest plugin now runs tests and fixtures in the same task.** This is the only change that touches our own code — `tests/apigw/test_circuitbreaker.py` uses `@pytest.mark.anyio`. All 13 tests in `tests/apigw/` pass. - `anyio.Path.relative_to()`/`is_relative_to()`, old-style coroutine tasks, and the asyncio `policy` option: no usage anywhere. Consumers of anyio in the resolved environment, and why each is safe: | Package | Pulled in by | How it uses anyio | |---|---|---| | `watchfiles` | `granian` | Only declared dependent. granian calls the **sync** `watchfiles.watch()` (Rust + threads); the anyio-based `awatch`/`arun_process` paths are never executed. Reload is dev-only (`SENTRY_GRANIAN_RELOAD`). | | `httpcore` | `sentry-sdk[http2]` | Optional `AnyIOBackend`, async pool only. sentry is WSGI, and `sdk_http2_experiment.enabled` defaults to `False`. | | `granian` | direct | `try: import anyio / except: anyio = None`; no API use. | | `huggingface_hub` | `tokenizers` | An `open_process` monkeypatch in the MCP CLI, never reached. | Verified: every anyio attribute these packages reference resolves under 4.14.2; all four import cleanly; `httpcore`'s `AnyIOBackend` completes a real TLS request over anyio 4 (status 200); `watchfiles.watch()` detects changes; `tests/apigw/` passes. Worth noting the bump also *resolves* a latent mismatch: `httpcore 1.0.9` declares `anyio>=4.0,<5.0` for its `asyncio` extra, so at 3.7.1 we were below the floor httpcore supports. Done by hand because Dependabot's auto-fix could not regenerate `uv.lock` for this repo — it ran `uv` under Python 3.14 and failed on `backports-zstd` having no cp314 wheels. #125179 fixed that root cause by declaring `requires-python`. Fixes GHSA-82r6-8w77-94w6 Co-authored-by: Claude <[email protected]>
oioki
added a commit
that referenced
this pull request
Oct 1, 2026
Alternative to #126158. Instead of capping `requires-python`, keep it at `>=3.13` (#125179) and limit `[tool.uv] environments` to `python_version < '3.14'`. Only the lock's fork markers change. All Dependabot security updates for `uv.lock` currently fail (urllib3, Django, PyJWT, oauthlib): ``` uv lock --upgrade-package urllib3==2.8.0 error: No solution found when resolving dependencies for split (python_full_version >= '3.15' ...) cause: asyncpg==0.31.0 has no `sys_platform == 'darwin' or sys_platform == 'linux'`-compatible wheels ``` Since uv 0.12.14 ([astral-sh/uv#21672](astral-sh/uv#21672)) wheel coverage is checked per resolver fork, and our internal PyPI has no cp314/cp315 wheels for several deps (asyncpg, uvloop, rpds-py, tiktoken, vroomrs, xmlsec). `bump-version.yml` is unaffected only because it pins uv 0.12.10. Compared to #126158, this keeps the project's declared Python support unchanged and only narrows what we lock for. Lifting it once the mirror builds 3.14 (and later 3.15) wheels is a one-line change. With this change, Dependabot's exact command succeeds for every open pip alert's target version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
requires-python = ">=3.13"to[project]inpyproject.toml. No lockfile change —uv.lockalready records exactly this range.Every Dependabot security update for
uv.lockcurrently fails with:The root cause is the first line: with no
requires-python, uv derives the supported range from whichever interpreter runs it. Locally that's 3.13 and everything resolves. Dependabot's runner has Python 3.14.5 (it doesn't pick up our.python-version), so it resolves for>=3.14and correctly fails —backports-zstdis a backport of 3.14's stdlibcompression.zstd, upstream caps it at<3.14, and it has no cp314 wheels for any version. Our internal mirror is already right about this (python_versions = <3.14inpackages.ini); there is nothing to fix on that side.Declaring the range makes
uv lockdeterministic regardless of interpreter. uv only checks a dependency'srequires-pythonagainst the project's lower bound, so>=3.13is compatible withbackports-zstd's<3.14exactly as the current lock implies. Verified by reproducing the failure on clean master withuv lock --python 3.14(CI-pinned uv 0.12.10), then confirming it resolves on both 3.14 and 3.13 with this change and thatuv lockproduces an empty diff.This also means the lockfile's recorded
requires-pythonstops being an accident of who last ranuv lock.I chose
>=3.13over==3.13.*because it's what the lock already encodes and doesn't fight the in-progress 3.14 work in the mirror repo. A follow-up worth doing separately (it changes the lock):backports-zstdshould carry apython_version < "3.14"marker, matching howurllib3[zstd]declares it — it only exists in our deps for urllib3's benefit.This unblocks Dependabot for the open
uv.lockalerts; #125177 / #125178 were done by hand because of this.