Pre-commit hook to ensure uv is installed
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ensure_uv-0.1.0.tar.gz.
File metadata
- Download URL: ensure_uv-0.1.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d235ebdb779fd7c45cb39abf5be5597731171e98f6229484c703350b37f66df0
|
|
| MD5 |
dd646fb8aa20c1e7a6e7a3542fac29c8
|
|
| BLAKE2b-256 |
e468281ee2613105432bc78d5dbfb25798e9fcbf1abb93e76c665a1c5f8456fc
|
File details
Details for the file ensure_uv-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ensure_uv-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3638854c76c6b79bae7636d60a9b1168a67fbab516017b1c612e630c26c6f75c
|
|
| MD5 |
4410609e58247cd225f1602d43cf14ad
|
|
| BLAKE2b-256 |
0dc6e71de6b343832736826fc1fa6c0f5b50624c51cfa60eee26cdac1da65a97
|