Repository navigation
Add 3-day dependency cooldown via uv - #277
Merged
Merged
Conversation
Refuse to resolve any package version published less than 3 days ago. The community typically flags malicious PyPI releases within hours; a 3-day quarantine catches almost all of them before they reach the lockfile or, more importantly, a developer's laptop. Triggering incident: on 2026-03-24 the TeamPCP threat actor published backdoored litellm 1.82.7/1.82.8 to PyPI after compromising LiteLLM's CI through a poisoned Trivy GitHub Action. The payload was a `.pth` file that ran on every Python process - not just `litellm` imports - stealing SSH keys, cloud credentials, and API keys. Live for ~3h before PyPI quarantined them; a 3-day cooldown would have prevented all exposure. https://simonwillison.net/2026/Mar/24/package-managers-need-to-cool-down/ Pip has no native cooldown, so this migrates the dev workflow to uv with a committed lockfile: - pyproject.toml gains [build-system], [project] (PEP 621, migrated from setup.py), [tool.setuptools.*], and [tool.uv] with required-version = ">=0.11.2", exclude-newer = "3 days", and environments = ["python_version >= '3.11'"]. setup.py is removed. - uv.lock is committed; its [options] block carries exclude-newer-span = "P3D". - Python 3.6 is dropped from CI / tox / classifiers - PEP 621 needs setuptools >= 61 which is 3.7+. 3.6 EOL'd Dec 2021, py37's tox env already covers every Django+psycopg combo py36 used to share, and end users on 3.6 still get the published wheel (wheel installs do not trigger [build-system]). - CircleCI's matrix testing stays on pip (3.7-3.13). Per the threat model, CI is "minor" compared to laptop installs; the cooldown's primary value lives in the committed uv.lock and the dev `uv sync` workflow. - README's "Getting started" switches from virtualenv + pip to `uv sync --extra dev --extra test`. Verified: `uv lock` resolves 104 packages cleanly with no missing upload-time warnings. Negative test - pinning joust==1.1.0 (published 2026-04-25, same day) is rejected by uv with the cooldown enabled and accepted without it. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Without `isolated_build = true`, tox 3 (pinned for Python 3.7 and 3.8) falls back to legacy `python setup.py` builds and fails with "ERROR: pyproject.toml file found" once setup.py is removed. tox 4 (used on 3.9+) defaults to isolated builds and was unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Photonios
approved these changes
Apr 30, 2026
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.
IMPORTANT:
This PR
Refuse to resolve any package version published less than 3 days ago. The community typically flags malicious PyPI releases within hours; a 3-day quarantine catches almost all of them before they reach the lockfile or, more importantly, a developer's laptop.
Triggering incident: on 2026-03-24 the TeamPCP threat actor published backdoored litellm 1.82.7/1.82.8 to PyPI after compromising LiteLLM's CI through a poisoned Trivy GitHub Action. The payload was a
.pthfile that ran on every Python process - not justlitellmimports - stealing SSH keys, cloud credentials, and API keys. Live for ~3h before PyPI quarantined them; a 3-day cooldown would have prevented all exposure.https://simonwillison.net/2026/Mar/24/package-managers-need-to-cool-down/
Pip has no native cooldown, so this migrates the dev workflow to uv with a committed lockfile:
uv syncworkflow.uv sync --extra dev --extra test.Verified:
uv lockresolves 104 packages cleanly with no missing upload-time warnings. Negative test - pinning joust==1.1.0 (published 2026-04-25, same day) is rejected by uv with the cooldown enabled and accepted without it.