Skip to main content

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


Download files

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

Source Distribution

ensure_uv-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

ensure_uv-0.1.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

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

Hashes for ensure_uv-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d235ebdb779fd7c45cb39abf5be5597731171e98f6229484c703350b37f66df0
MD5 dd646fb8aa20c1e7a6e7a3542fac29c8
BLAKE2b-256 e468281ee2613105432bc78d5dbfb25798e9fcbf1abb93e76c665a1c5f8456fc

See more details on using hashes here.

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

Hashes for ensure_uv-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3638854c76c6b79bae7636d60a9b1168a67fbab516017b1c612e630c26c6f75c
MD5 4410609e58247cd225f1602d43cf14ad
BLAKE2b-256 0dc6e71de6b343832736826fc1fa6c0f5b50624c51cfa60eee26cdac1da65a97

See more details on using hashes here.

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