Skip to content

build: allow filelock 4.x and sync package metadata - #49137

Merged
tin-berri merged 2 commits into
mainfrom
litellm_pr48635_filelock_cap
Oct 30, 2026
Merged

tin-berri merged 2 commits into
mainfrom
litellm_pr48635_filelock_cap

Conversation

@tin-berri

@tin-berri tin-berri commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Allow projects using LiteLLM to install filelock 4.x without a dependency conflict. Keep both package manifests and the lockfile consistent while retaining Python 3.10 support

Details

[!NOTE]
Continues #48635 by @fas89 on a branch in BerriAI so the required lockfile update can pass the fork dependency guard. The original commit was rebased onto current main with its authorship preserved. Full credit to @fas89 for the original change

TLDR

Problem this solves:

  • LiteLLM blocks downstream installs of fixed filelock releases
  • The original PR left core metadata and uv.lock inconsistent

How it solves it:

  • Allow filelock below version 5 in both package manifests
  • Sync the lockfile requirement without changing resolved package versions

User Flow

Before, a developer cannot resolve LiteLLM alongside filelock 4.2.4

  1. Use Python 3.12 and request LiteLLM plus filelock 4.2.4
  2. The resolver rejects the combination because LiteLLM requires filelock below 4

After, the same dependency request resolves

  1. Use Python 3.12 and request LiteLLM plus filelock 4.2.4
  2. The resolver succeeds and selects filelock 4.2.4

Relevant issues

Fixes #48394

Original PR: #48635

Pre-Submission checklist

  • Existing manifest regression test reproduces the original PR failure and passes with this fix
  • Focused local checks pass
  • Required CI checks pass on the current commit
  • Scope is limited to the filelock upper bound and metadata consistency
  • Automated reviews have completed and findings are addressed

Screenshots / Proof of Fix

Tested tip b22f2cca9ede040f242b5300b6a1fe53da7c3aa9

The recording executes real uv dependency-resolution commands against the baseline and final package manifests. No provider call is involved in this packaging change. A constraints file contains filelock==4.2.4, and --no-sources uses published dependency metadata rather than local workspace overrides

Before (8d441eb)

  1. Run uv pip compile pyproject.toml --no-sources --python-version 3.12 -c fixed.txt
  2. Exit 1 with an unsatisfiable dependency error because LiteLLM requires filelock>=3.16.1,<4.0

After (b22f2cc)

  1. Run the same command against the final pyproject.toml
  2. Exit 0 and resolve filelock==4.2.4

The core package also resolves with filelock 4.2.4 on Python 3.11. Both packages resolve on Python 3.10, selecting compatible filelock 4.1.0 in this run

uv tool run --from uv==0.10.9 uv lock --check --python <version> passes on Python 3.10, 3.11, 3.12, 3.13, 3.14 and 3.15. The local Python 3.15 interpreter is 3.15.0rc3. The lockfile was generated with uv 0.13.6 to retain revision 5 and avoid unrelated marker changes

uv run --no-project --python 3.12 --with pytest --with packaging python -m pytest --noconftest -c /dev/null -p no:cacheprovider tests/unit/test_build_core_distribution.py -q passes. The same existing test fails at the original contributor commit

FileLock smoke checks pass on versions 3.16.1, 4.1.0 and 4.2.4 for acquisition, mode 0600, timeout on contention, release and reacquisition

Type

Bug Fix

Caveats

Medium

  • Allows fixed versions but does not require a security upgrade
  • The lockfile still resolves filelock 3.32.7
  • Python 3.10 cannot install filelock 4.2.4
demo.mp4

Before and after filelock dependency resolution

fas89 and others added 2 commits October 29, 2026 15:25
filelock 3.x is the only line the current cap permits, and three CVEs
(CVE-2026-112940, CVE-2026-112913, CVE-2026-112907) are fixed only in
4.2.1+. The cap means every downstream that depends on litellm is held
on a vulnerable filelock with no way out, since pip has no override.

litellm uses FileLock(path, timeout=..., mode=...) and Timeout, in
litellm/proxy/client/cli/commands/configure_profiles.py and
claude_settings.py. Both keyword arguments still exist in 4.2.4 and
Timeout is still exported, so the two call sites are unaffected. The
CVEs are in the SQLite-backed ReadWriteLock / AsyncReadWriteLock, which
litellm does not use.

<5 rather than a floor bump because litellm supports Python 3.10 and
filelock 4.x requires >=3.11: widening the cap lets 3.11+ resolve 4.x
while 3.10 keeps a 3.x filelock automatically, through filelock's own
requires_python.
@tin-berri
tin-berri requested a review from a team October 29, 2026 22:29
@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

1 warning

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 38 untouched benchmarks


Comparing litellm_pr48635_filelock_cap (b22f2cc) with main (4ce724e)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (1a2b443) during the generation of this report, so 4ce724e was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@tin-berri
tin-berri merged commit dacaaad into main Oct 30, 2026
116 of 118 checks passed
@tin-berri
tin-berri deleted the litellm_pr48635_filelock_cap branch October 30, 2026 01:20
lester076 added a commit to lester076/litellm that referenced this pull request Oct 30, 2026
allenfbyrd added a commit to Polycentric-Labs/evidentia that referenced this pull request Oct 31, 2026
The container smoke test and the tag-time publish both regenerate
docker/requirements.txt from PyPI with pip-compile --upgrade and scan the
result, so the committed pin never reaches them. That fresh closure picks
litellm 1.106.6, whose metadata caps filelock below 4.0, and resolves
filelock 3.32.7 with thirteen advisories (GHSA-v4x8-3wr5-3wq8 High 7.1
among them); the required Build + smoke test check failed on PR 433 and
on the two Dependabot pull requests that touched the container pins, and
release.yml would fail the same way at the next tag.

Both regeneration inputs (container-build.yml, release.yml) and the
committed docker/requirements.in gain a filelock>=4.2.1 line beside the
standing urllib3>=2.7.0 floor; container-build.yml's input now matches
release.yml's exactly. Reproduced locally with pip-tools 7.6.1: the
baseline input resolves filelock 3.32.7 and litellm 1.106.6 with the
thirteen findings; with the floor pip-compile backtracks litellm to
1.103.10 and resolves filelock 4.2.6 and huggingface-hub 2.4.0, and
osv-scanner reports no issues on the regenerated file. Once a stable
litellm release carries the upstream cap lift (BerriAI/litellm#49137,
merged 2026-10-30) the floor is inert and the newest litellm is chosen
again.

container-build.yml is a policy-tracked workflow, so its reviewed source
digest in .github/verification-policy.json and POLICY_SHA256 in
scripts/verification_policy.py are refreshed; the step list is unchanged.
The CHANGELOG filelock entry records the floor.

Verified locally: zizmor 1.26.1 clean, workflow gate fidelity, workflow
permissions strict, workflow tools strict, docs health strict, roadmap
currency, version consistency, doc counts, README regen, wiki mirrors,
ruff check and format; the workflow-, policy-, bumper- and
CHANGELOG-reading tests pass.
schneefisch added a commit to Parlamentszusammenfasser/pazufa-scraper-bw that referenced this pull request Nov 1, 2026
The 13 filelock CVEs are fixed only in 4.2.1, but litellm pins
filelock<4.0. The cap is lifted upstream (BerriAI/litellm#49137), not in
a stable release yet. All need a second local user or Windows; the HIGH
one needs ReadWriteLock, which nothing we ship uses. Entries expire on
2026-12-15 so the next check is forced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

filelock<4.0 cap keeps downstreams on a version with three open CVEs

3 participants