Skip to main content

Vulnerability scanner for uv-managed Python projects (Rust binary shipped via PyPI)

Project description

py-uv-audit

A fast vulnerability scanner for uv-managed Python projects, written in Rust and distributed via PyPI as a precompiled binary.

Reads your pyproject.toml + uv.lock, queries the OSV vulnerability database for every direct and transitive dependency, and prints a colorized report with actionable fix suggestions.

Installation

pip install py-uv-audit
# or, with uv:
uv tool install py-uv-audit
# or, for Rust users:
cargo install py-uv-audit

Pre-built wheels ship for Linux (x86_64, aarch64), macOS (x86_64, Apple Silicon), and Windows (x86_64). No Rust toolchain required on your machine.

Usage

Run from the root of a uv-managed Python project (directory with pyproject.toml and uv.lock):

# See what the tool can do (bare invocation prints help)
py-uv-audit
py-uv-audit --help

# Run a scan — both forms work and do the same thing
py-uv-audit audit                       # scan and report vulnerabilities
py-uv-audit audit --tree                # also print dependency tree
py-uv-audit audit --suggest             # also print remediation suggestions
py-uv-audit audit --tree --suggest      # all of the above

# Flags work at the top level too (subcommand optional)
py-uv-audit --tree --suggest
py-uv-audit --pyproject ./path/to/pyproject.toml --lockfile ./path/to/uv.lock

Example output

=== VULNERABILITY REPORT ===

VULNERABLE: requests v2.31.0
  Introduced via: [direct dependency]
  - GHSA-9wx4-h78v-vm56: requests vulnerable to .netrc credentials leak
    Severity: MODERATE (CVSS_V3)
    Fixed in: 2.32.0
    Advisory: https://github.com/advisories/GHSA-9wx4-h78v-vm56

--- 1 vulnerable package(s) found (42 total scanned) ---

How it works under the hood

py-uv-audit is a Rust binary, but you install it through pip. The trick is what ruff and uv itself do: GitHub Actions compiles the Rust source for every (OS, arch) combination, wraps each binary in a Python wheel, and publishes those wheels to PyPI. When you run pip install py-uv-audit, pip picks the wheel matching your platform, extracts the binary into your venv's bin/, and you can run py-uv-audit from the shell. There is no Python code at runtime — Python is purely the installer.

Development

Requires Rust (≥ 1.85 for edition 2024) and optionally uv + maturin for testing the PyPI build.

# Iterate on the Rust source
cargo run -- --tree --suggest

# Build a release binary
cargo build --release
./target/release/py-uv-audit --tree

# Build a wheel locally (matches what CI produces)
uv tool install "maturin>=1.7,<2.0"
maturin build --release
ls dist/         # py_uv_audit-0.1.1-py3-none-<platform>.whl

# Install the wheel into a throwaway venv to test
uv venv /tmp/v
uv pip install --python /tmp/v dist/py_uv_audit-*.whl
/tmp/v/bin/py-uv-audit --tree

Releasing

Releases are tagged commits on the default branch. GitHub Actions builds wheels for every platform and publishes to PyPI automatically.

# Bump version in Cargo.toml (single source of truth — pyproject.toml reads it dynamically)
git commit -am "bump to 0.2.0"
git tag -a v0.2.0 -m "Release 0.2.0"
git push origin master --tags

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_uv_audit-0.1.1.tar.gz (33.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

py_uv_audit-0.1.1-py3-none-win_amd64.whl (1.9 MB view details)

Uploaded Python 3Windows x86-64

py_uv_audit-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

py_uv_audit-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

py_uv_audit-0.1.1-py3-none-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file py_uv_audit-0.1.1.tar.gz.

File metadata

  • Download URL: py_uv_audit-0.1.1.tar.gz
  • Upload date:
  • Size: 33.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for py_uv_audit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d21eae188996e2c3b91abaa717101e4ca958a67fd6bd86b70336106e474ef493
MD5 5f731583d5d11bc6b878d696c46f19e5
BLAKE2b-256 dcbffcee582423bff6fad396713a2182b534f54108533656aa912e44dd8fcf79

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_uv_audit-0.1.1.tar.gz:

Publisher: ci.yml on shivakharbanda/py-uv-audit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_uv_audit-0.1.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: py_uv_audit-0.1.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for py_uv_audit-0.1.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 638102d35a530fd7bb1aa8f32a549c5f080bddcced2604fbe0034dc13792f5b6
MD5 1c4a1be6d6223734a5b0970de7f586f0
BLAKE2b-256 e79b86da9988a4af265e5d36e3f2730b447cc40befdc6d71ee3b55bcfd31fdab

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_uv_audit-0.1.1-py3-none-win_amd64.whl:

Publisher: ci.yml on shivakharbanda/py-uv-audit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_uv_audit-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for py_uv_audit-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 58a500b146602a8374e10ee6f20ebc3d023e19d42cb589760a22708456b9e2ab
MD5 a44b315b728bb6aa64bf6572aee5570d
BLAKE2b-256 060cf36460e07aba0581eee300143f7e77fa440db1c524966c3ac53237796b43

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_uv_audit-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: ci.yml on shivakharbanda/py-uv-audit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_uv_audit-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for py_uv_audit-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7ae167a181ebd830f0106a4aacc6f2124dd4330bf73d5c90f5fa0d0bd01ea62f
MD5 48393fbc7f6e38659a0a83b57916ad40
BLAKE2b-256 20a58cf503ff37b6bf44151d0ba2b838632b3b21c47f3affeb12c61f9988cd22

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_uv_audit-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: ci.yml on shivakharbanda/py-uv-audit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_uv_audit-0.1.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for py_uv_audit-0.1.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2b1162625bb7d98627043919a5b9943471ffbf972d922373fe75b864fe139050
MD5 0a60bd6e7f52de5f7875574675da5f05
BLAKE2b-256 767a7a0e59dcd95bb10f9e3a919f54405c9f987fe2fded60072f598f12e7596d

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_uv_audit-0.1.1-py3-none-macosx_11_0_arm64.whl:

Publisher: ci.yml on shivakharbanda/py-uv-audit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page