Skip to content

fix(deps): install pre-commit only on Python 3.11+ to drop vulnerable filelock - #89

Merged
peterfoldes merged 1 commit into
mainfrom
fix/filelock-py310-dev-chain
Oct 29, 2026
Merged

peterfoldes merged 1 commit into
mainfrom
fix/filelock-py310-dev-chain

Conversation

@peterfoldes

@peterfoldes peterfoldes commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Clears the 17 open filelock Dependabot alerts (50–66: 1 high, 12 medium, 4 low; all filelock <= 4.2.0 in uv.lock).

Root cause

uv.lock forks on Python version. Under python_full_version < '3.11' it resolved filelock 4.1.0; 3.11+ already had 4.2.4. Every patched filelock release (4.2.1+) requires Python >= 3.11, so the 3.10 fork could never be upgraded. The only path to filelock on 3.10 was dev-only:

dev group -> pre-commit 4.6.2 -> virtualenv 21.15.1 / python-discovery 1.6.7 -> filelock 4.1.0

(This chain appeared with the virtualenv 20 -> 21 bump in #88.)

Fix

Gate the dev dependency to pre-commit; python_version >= '3.11' and relock. No runtime dependency changes. CI is unaffected: the test workflow installs via pip install ".[test]", and the pre-commit workflow does its own pip install pre-commit on Python 3.x.

Side effect: developers on Python 3.10 no longer get pre-commit from uv sync; use 3.11+ (or install it separately) to run the hooks.

Verification

Every [[package]] entry for the alerted package, all resolution forks:

Alert(s) Range Before After
50–66 (filelock) <= 4.2.0 (narrowest lower bound varies) 4.1.0 [py<3.11] vulnerable; 4.2.4 [py>=3.11] ok 4.2.4 only (reachable on py>=3.11 via pre-commit) ok

Also dropped from the 3.10 fork: pre-commit 4.6.2, platformdirs 4.12.4.

  • pip-audit (PyPI source) on the exported lock, evaluated per Python 3.10 / 3.11 / 3.12 / 3.13 / 3.14 x linux / darwin / win32: before = 17 filelock vulns on 3.10 only; after = no known vulnerabilities in any combination.
  • All 53 locked registry packages checked against the GitHub Advisory Database (/advisories?ecosystem=pip&affects=<pkg>@<ver>): 0 hits.
  • pytest tests/: 315 passed on 3.10, 3.11 and 3.14. On 3.10 neither filelock nor pre_commit is installed.
  • pre-commit run --all-files passes on 3.11.

🤖 Generated with Claude Code

On Python 3.10 the lock resolved pre-commit 4.6.2, whose virtualenv and
python-discovery dependencies pulled filelock 4.1.0. Every patched
filelock release (4.2.1+) requires Python 3.11, so the 3.10 fork could
never move off the vulnerable version.

pre-commit is a local-only tool here (the pre-commit workflow installs
it itself on Python 3.x), so gate it to python_version >= '3.11'. The
3.10 resolution no longer contains filelock at all, and the 3.11+ fork
keeps filelock 4.2.4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@peterfoldes
peterfoldes requested a review from a team as a code owner October 29, 2026 21:18

@salty-hambot salty-hambot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed by Salty Hambot 🤖🧂 at 8c1b82e

No issues found.
💰 $0.0701 · 36.9k in / 1.1k out tokens · ⏱️ 10.3s · us.openai.gpt-6-sol high, prompt coverage-v1
💬 To request a re-review, comment @salty-hambot review

@peterfoldes
peterfoldes merged commit d1d80c7 into main Oct 29, 2026
7 checks passed
@peterfoldes
peterfoldes deleted the fix/filelock-py310-dev-chain branch October 29, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants