[python] require Python >= 3.10 and restore full dependency floors#24280
Open
johanneswuerbach wants to merge 1 commit into
Open
[python] require Python >= 3.10 and restore full dependency floors#24280johanneswuerbach wants to merge 1 commit into
johanneswuerbach wants to merge 1 commit into
Conversation
Follow-up to OpenAPITools#24186, which raised the generated Python client dependency floors above known-vulnerable ranges but had to lower urllib3 to 2.6.3, aiohttp to 3.13.5 and pytest to 8.4.2 to stay installable under the PEP-621 requires-python >=3.9 declaration. The safest patched releases of those packages ship only for Python >= 3.10, so the newest advisories were left uncleared at the declaration level. This raises requires-python to >=3.10 (aligning the PEP-621 metadata with the poetry/setup.py declarations, which already dropped 3.9) and restores the higher floors so the declared ranges fully exclude the vulnerable versions: urllib3 >= 2.7.0, < 3.0.0 (clears GHSA-mf9v-mfxr-j63j, GHSA-qccp-gfcp-xxvc) aiohttp >= 3.14.1 (clears the aiohttp <=3.14.0 advisory batch) pytest >= 9.0.3 (dev; clears GHSA-6w46-j5rx-g56g / CVE-2025-71176) Dropping Python 3.9 is a deliberate breaking change. Samples regenerated. Signed-off-by: Johannes Würbach <johannes.wuerbach@googlemail.com>
3 tasks
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.
Follow-up to #24186 — raise
requires-pythonto>=3.10and restore the full dependency floors#24186 raised the generated Python client dependency floors above known-vulnerable ranges, but had to lower three of them to keep the generated clients installable under the declared
requires-python:urllib3>= 2.6.3, < 3.0.0>= 2.7.0, < 3.0.0aiohttp>= 3.13.5>= 3.14.1pytest(dev)>= 8.4.2>= 9.0.3The safest patched releases of these packages are published only for Python ≥ 3.10, so at
requires-python = ">=3.9"the resolver would still be free to pick vulnerable versions on 3.9. That left the newest advisories uncleared at the declaration level:<= 3.14.0advisory batch (fixed in 3.14.1)What this PR does
requires-pythonfrom>=3.9to>=3.10in the Python generator templates. This aligns the PEP-621[project]metadata with the poetry (python = "^3.10") andsetup.py(PYTHON_REQUIRES = ">= 3.10") declarations, which already dropped 3.9 in Drop python 3.9 and support python 3.14 in python generator #22926 — the PEP-621requires-pythonline was the one spot left at>=3.9.urllib3 >= 2.7.0,aiohttp >= 3.14.1,pytest >= 9.0.3) so the declared ranges fully exclude the vulnerable versions for every supported interpreter.With the minimum interpreter at 3.10, the restored floors resolve cleanly and the declared ranges no longer admit any of the advisory-affected releases.
Breaking change
Dropping Python 3.9 support from the generated clients is intentional and is the mechanism by which the floors can be raised. Generated-client consumers still on 3.9 would need to stay on an older generator version.
Samples
Regenerated the affected Python client samples (
python,python-aiohttp,python-httpx,python-httpx-sync,python-lazyImports,python-echo-api, and thedisallowAdditionalPropertiesIfNotPresentecho variant) — the same set touched by #24186. The diff is limited to the floor lines and therequires-pythonline.Summary by cubic
Raise Python requirement for generated Python clients to >=3.10 and restore secure floors for
urllib3,aiohttp, andpytest. This aligns PEP-621 metadata withpoetry/setup.pyand prevents installs from picking vulnerable versions.Dependencies
urllib3 >= 2.7.0, < 3.0.0aiohttp >= 3.14.1pytest >= 9.0.3(dev)Migration
Written for commit 56efc73. Summary will update on new commits.