skillfed

pre-commit-uv

Run pre-commit with uv

pre-commit-uv v4.3.0 722.1K downloads/30d#5,228 on PyPI204
Permissive 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) Active released

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-uv

uv

uv add pre-commit-uv

poetry

poetry add pre-commit-uv

Installing 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

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15

Tags

pre-commit uv integrationfaster pre-commit hook installationuv virtual environment managerpre-commit performance optimizationuv package installer for hooks
pre-commit-pluginperformance-optimization

More Build Tools packages