uv-override-prune
Detect prunable override-dependencies / constraint-dependencies entries in uv projects.
Install
Requires uv on PATH, since the audit runs uv lock.
uv tool install uv-override-prune
Or run it without installing — useful for one-off checks:
uvx uv-override-prune
Usage
# Detect prunable entries (default)
uv-override-prune # checks ./pyproject.toml
uv-override-prune path/to/pyproject.toml # checks given file
# Remove prunable entries in place
uv-override-prune --fix
Example output:
=== override-dependencies (3 entries) ===
[KEEP] aiohttp>=3.13.5 3.13.3
[PRUNE] httpx>=0.1.0 0.28.1
[SKIP] foo==1.0 (non-lower-bound)
Run with --fix to prune entries marked [PRUNE].
Exit codes:
| Code | Meaning |
|---|---|
0 |
No prunable entries (or --fix succeeded) |
1 |
Prunable entries found (without --fix) |
2 |
pyproject.toml not found or malformed, or an entry marked [ERROR] (the audit is incomplete, even when other entries were pruned) |
Why
uv lets you pin a transitive dependency version via [tool.uv] override-dependencies and constraint-dependencies.
A common reason to reach for these is CVE mitigation: a vulnerability is disclosed in a transitive package, and you force the patched minimum version while direct deps catch up.
Once they do, the entry is no longer doing anything — but it's easy to forget which ones are still load-bearing. Stale overrides become a judgment cost at every audit or upgrade ("is this still needed, or just history?").
uv-override-prune answers that mechanically: it checks whether each entry's lower bound is already satisfied by what uv lock would resolve without the override, starting from the versions in your current uv.lock.
How it works
For each candidate entry, the tool removes it in a temp copy of pyproject.toml and uv.lock, runs uv lock there, and checks whether the resulting natural resolution still satisfies the entry's specifier. If yes, the entry is [PRUNE].
Starting from the existing uv.lock matters because uv lock keeps already-locked versions wherever it can. A from-scratch resolution would upgrade every package first, which can make an entry look redundant even though removing it in the real project would downgrade the package. To evaluate against the newest versions instead, run uv lock --upgrade before the tool. Without a uv.lock, the tool falls back to a from-scratch resolution and says so on stderr.
Scope
- Targets entries in
[tool.uv] override-dependenciesandconstraint-dependencies. - Only specifiers using
>=and/or>are checked. Entries using==,~=,<,<=,!=(alone or mixed) are skipped. - Entries with an environment marker (e.g.
foo>=1.0; python_version >= "3.10") are skipped, since the naturaluv lockresolution doesn't reflect the marker's intent. - Scoped overrides (tables such as
{ package = { name = "httpx" }, dependencies = ["anyio>=4.0"] }) are skipped as(scoped).--fixleaves them in place. - When uv forked the resolution on environment markers and locked several versions of the package (one per fork), the entry is
[PRUNE]only if every version satisfies it.[KEEP]lists the versions below the bound;[PRUNE]lists them all. - An entry that repeats an earlier entry in the same section (same package and specifier, ignoring spelling) is reported as
[PRUNE]with(duplicate). The first copy is evaluated with every copy removed, so its verdict reflects the natural resolution and--fixleaves exactly one copy.
Known limitations
- The temp copy holds only
pyproject.tomlanduv.lock, so metadata that needs a build to read is out of reach. A project whosedependencies,optional-dependencies, orrequires-pythonare declareddynamichas every entry[SKIP]ped as(dynamic-metadata). A dynamicversionis fine (the copy pins a placeholder), and[tool.uv.sources]path deps, workspace members, and[project] readmeare rewritten to absolute paths. - One-at-a-time evaluation: if overrides interact (e.g. cascade redundancy, shared transitive deps), individual runs may miss some prunable entries. Re-run after applying removals to surface the next layer.
License
MIT
Metadata
Release files for uv-override-prune 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| uv_override_prune-1.0.4.tar.gz | 28.9 kB | With provenance | Details for uv_override_prune-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| uv_override_prune-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for uv_override_prune-1.0.4-py3-none-any.whl |
Total release size: 43.1 kB
Release files / uv_override_prune-1.0.4.tar.gz
| Download URL | uv_override_prune-1.0.4.tar.gz |
|---|---|
| Size | 28.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c34c688809168ba8b35e618df8440021ee8a0fe08af17461c45cfce1d30d3695
|
|
BLAKE2b-256 checksum How to use checksums |
b5adb78460ce8350d4c3fce06b2f11e92f2eff0d91d929d17f49562fe4785b30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / uv_override_prune-1.0.4-py3-none-any.whl
| Download URL | uv_override_prune-1.0.4-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71681d9bf6cdd1597fe0369bc3ed77122bdde509e6c6b23b9c906b8d3561c3eb
|
|
BLAKE2b-256 checksum How to use checksums |
55945cd352ef3551f162383c4fa76f28977dd99890e8337d8321a2519e916a90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for uv-override-prune 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for uv_override_prune-1.0.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.