Commit b740d01
authored
security: require Python 3.10+, dropping a vulnerable resolution branch (#14)
* security: require Python 3.10+, dropping a vulnerable resolution branch
#11 closed the critical langchain-core advisory, but had a side effect worth
correcting.
langchain-core 1.6.1 requires Python 3.10+, while this package still declared
`requires-python = ">=3.9"`. uv therefore split the resolution, pinning an
older set for the 3.9 branch:
urllib3 2.6.3 (python < 3.10) vs 2.7.0 (>= 3.10)
requests 2.32.5 (python < 3.10) vs 2.34.2 (>= 3.10)
orjson 3.11.5 (python < 3.10) vs 3.12.0 (>= 3.10)
Anyone installing under 3.9 got the left-hand column, which carries three high
and one medium advisory:
urllib3 2.6.3 GHSA-mf9v-mfxr-j63j decompression-bomb bypass high
urllib3 2.6.3 GHSA-qccp-gfcp-xxvc headers forwarded cross-origin high
orjson 3.11.5 GHSA-hx9q-6w63-j58v unbounded recursion high
requests 2.32.5 GHSA-gc5v-m9x4-r6x2 insecure temp file reuse medium
Raising `requires-python` to >=3.10 collapses the split. It is also honest:
the package's primary dependency dropped 3.9, so claiming 3.9 support was
already inaccurate.
- `requires-python` >=3.9 -> >=3.10
- removed the `Programming Language :: Python :: 3.9` classifier
- CI matrix 3.9-3.13 -> 3.10-3.13
## Verification
Every dual resolution is gone except `websockets` (16.1.1 / 17.1), and neither
of those carries an advisory. Single resolutions now:
langchain-core 1.6.1 urllib3 2.7.0 requests 2.34.2
orjson 3.12.0 h11 0.16.0
`uv sync --frozen --all-groups` clean; imports resolve and VectorizeRetriever
still has BaseRetriever in its MRO; urllib3 2.7.0 and requests 2.34.2 confirmed
at runtime.
Claude-Session: https://claude.ai/code/session_01SK2htrNEFAj2VuxKWqFavo
* fix: lint the matrix Pythons, clear anyio, adopt 3.10 annotations
Three things this PR needed to go green and to close the critical anyio
alert (#23, GHSA-82r6-8w77-94w6):
- lint.yml declared a 3.9/3.13 matrix but setup-python read
python-version-file instead, so it installed the newest release (3.14),
which pyo3-ffi 0.22 cannot build against. Use the matrix, and drop 3.9 to
match requires-python >=3.10.
- Re-lock anyio. With 3.9 gone the resolution no longer splits, so the only
anyio is 4.15.1. Before, the 3.9 branch was pinned to a vulnerable 4.12.1
because anyio's fixed releases require Python 3.10+.
- ruff's UP045 now applies (Optional[str] -> str | None) since the minimum
is 3.10; applied with ruff --fix.
Verified locally on 3.10 and 3.13: ruff format --check, ruff check, mypy
all pass. pytest needs VECTORIZE_TOKEN and a paid-plan account (CI fails
with UPGRADE_REQUIRED), so it is environmental and unchanged by this PR.
Claude-Session: https://claude.ai/code/session_014J7s5yzoVEqoZ8LmnD8bQd1 parent 4a9c777 commit b740d01
5 files changed
Lines changed: 74 additions & 638 deletions
File tree
- .github/workflows
- langchain
- langchain_vectorize
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
0 commit comments