pre-commit-uv
Run pre-commit with uv
What it is and what it does
pre-commit-uv is a plugin that replaces pre-commit's default virtual environment and package installation mechanism with uv, a faster Rust-based Python package installer. It works by patching pre-commit at runtime to use uv instead of the standard tools, transparently speeding up the initial hook installation and environment setup without requiring changes to your pre-commit configuration.
The package is installed as an injection into an existing pre-commit installation (via pipx inject) or alongside it (via uv tool install). Once active, it automatically intercepts pre-commit's environment creation calls and delegates them to uv, which typically reduces hook installation time by roughly 30% according to the project's own benchmarks. It includes escape hatches via environment variables to disable the patching if needed, and only applies the patch when pre-commit is actually invoked to avoid startup overhead.
Use it for:
- Speed up initial pre-commit hook installation in CI/CD pipelines where cache is unavailable or ephemeral.
- Reduce local development setup time when running pre-commit install-hooks for the first time on a new machine.
- Replace pre-commit's default package installer in projects where uv is already the standard tool.
- Maintain faster hook environments in monorepos or projects with many dependencies.
- Disable selectively on specific machines or environments using the DISABLE_PRE_COMMIT_UV_PATCH variable.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates uv as the virtual environment and package installer for pre-commit, speeding up hook installation and environment setup.
Yes, if you use pre-commit and want faster initial hook installation without configuration changes. The low install friction, active maintenance, permissive license, and demonstrated performance gain (roughly 30% faster in the benchmark) make it a straightforward win. Install via pipx inject or uv tool install, and it works transparently. No known vulnerabilities.
Install
pre-commit-uv on PyPI
pip
pip install pre-commit-uvuv
uv add pre-commit-uvpoetry
poetry add pre-commit-uvInstalling pre-commit-uv
Before you install
Low friction install as a pure Python wheel. Actively maintained with a recent release; repository shows steady activity and no archived status.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal obligations—suitable for both commercial and personal projects.
Quickstart
pipx inject pre-commit pre-commit-uv
Then use pre-commit normally; pre-commit-uv will automatically patch pre-commit to use uv for environment creation and package installation.
Requires pre-commit to already be installed; works with Python 3.10 or later.
Verify before relying
- Whether the 1.30x speedup shown in the benchmark holds across different project configurations and cache states.
- Compatibility with all pre-commit hook types and custom hook configurations.
- Whether the DISABLE_PRE_COMMIT_UV_PATCH and FORCE_PRE_COMMIT_UV_PATCH environment variables cover all edge cases.
Package facts
| License | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pre-commit, uv |
| Maintenance | actively maintained — 24 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 722,100/month — #5,228 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pre_commit_uv-4.3.0-py3-none-any.whl
Keywords: format, pyproject
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
detect-installerDetects which package manager installed a given…
permissive · top 5,000 on PyPI
prekprek is a Git hook manager written in Rust that…
permissive · top 1,000 on PyPI
clang-formatPackages the clang-format code formatter as a…
permissive · top 5,000 on PyPI
conventional-pre-commitA pre-commit hook that validates git commit…
permissive · top 15,000 on PyPI
pbs-installerDownloads and installs python-build-standalone…
permissive · top 1,000 on PyPI
uv-secureScans uv.lock, pylock.toml, and…
permissive · top 15,000 on PyPI
uv-builduv-build is a build backend that integrates…
permissive · top 1,000 on PyPI
commitizenCommitizen enforces standardized commit…
permissive · top 5,000 on PyPI
freeze-corefreeze-core provides core runtime support for…
permissive · top 15,000 on PyPI