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.2.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.2-py3-none-win_amd64.whl (1.9 MB view details)

Uploaded Python 3Windows x86-64

py_uv_audit-0.1.2-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.2-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.2-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.2.tar.gz.

File metadata

  • Download URL: py_uv_audit-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 daa57d9bde31ee2ae0be817598d29bb069fd1639e4fcd9fb2614fdab8451fcfc
MD5 c2832e7330462f342536ca1fac5635fc
BLAKE2b-256 af9ab83d5b857b4dfc7dbac47d55227d766c70481357bcae31d2888f49356360

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_uv_audit-0.1.2.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.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: py_uv_audit-0.1.2-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.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d548f407c02272df2c7ff71a420527cb1fbaa7b299decfa4eb5b8d4b167ae443
MD5 8ba527a9f71369a3803110659306c84d
BLAKE2b-256 f2ee57ba7a9ca253f2854cb62c85643f7dbb9a799a2e7017bc1a8adea1cc1650

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_uv_audit-0.1.2-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.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for py_uv_audit-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eeeb8743de6af47703880cd856f288db11ae48537237b83722aa4f9f0968c565
MD5 ac3b87957d57f60d8f10df47506b4846
BLAKE2b-256 3ec14e4c974800a93c156d5492ea2d1486f3e2c96692ff5313f45c859508e183

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_uv_audit-0.1.2-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.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for py_uv_audit-0.1.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a268c2bfcf5ed2faae8a7299249b6400524f45e753823afe703ec740e0f0996d
MD5 f1a1b506f6800eac945769af06b2a4d4
BLAKE2b-256 7ad00977eaefe1c16d3156988b7c9ba5280c3af0f8300078d1e92b49aca1de38

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_uv_audit-0.1.2-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.2-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for py_uv_audit-0.1.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ea38e9c708bf7e0d56d0e84972ebed55227d7955085a83578c7074b643c4357
MD5 c94e9ba75f5922ee385eaaf825012c9f
BLAKE2b-256 3a23c8773558c778e2c6a9353d6d863f07ca40d227c0f92a67a8c704268d5ae3

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_uv_audit-0.1.2-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