Skip to main content

pre-commit-ensure-uv

A pre-commit hook that ensures uv is installed and available.

Works with both pre-commit and prek.

Usage

Add this to your .pre-commit-config.yaml:

repos:
  - repo: https://github.com/bitflight-devops/pre-commit-ensure-uv
    rev: v0.1.0
    hooks:
      - id: ensure-uv

Place it first in your repos list so uv is available for subsequent hooks.

Behavior

Condition Action
uv in PATH Pass silently
uv installed, not in PATH Re-run hooks with corrected PATH
uv not installed Install uv, then re-run with corrected PATH

When uv needs to be added to PATH, the hook automatically re-runs all hooks with the corrected environment. No shell restart required.

Platform Support

  • Linux
  • macOS
  • Windows

Installation Method

Uses the official uv installer:

  • Unix: curl -LsSf https://astral.sh/uv/install.sh | sh
  • Windows: powershell irm https://astral.sh/uv/install.ps1 | iex

License

MIT

Metadata

Release files for ensure_uv 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ensure_uv 0.1.0
File Size Uploaded
ensure_uv-0.1.0.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ensure_uv 0.1.0
File Interpreter ABI Platform
ensure_uv-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / ensure_uv-0.1.0.tar.gz

Download URL ensure_uv-0.1.0.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d235ebdb779fd7c45cb39abf5be5597731171e98f6229484c703350b37f66df0
BLAKE2b-256 checksum
How to use checksums
e468281ee2613105432bc78d5dbfb25798e9fcbf1abb93e76c665a1c5f8456fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ensure_uv-0.1.0-py3-none-any.whl

Download URL ensure_uv-0.1.0-py3-none-any.whl
Size 2.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3638854c76c6b79bae7636d60a9b1168a67fbab516017b1c612e630c26c6f75c
BLAKE2b-256 checksum
How to use checksums
0dc6e71de6b343832736826fc1fa6c0f5b50624c51cfa60eee26cdac1da65a97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page