Skip to main content

pre-commit-uv

PyPI PyPI - Implementation PyPI - Python Version Downloads PyPI - License check

Use uv to create virtual environments and install packages for pre-commit.

Installation

With pipx:

pipx install pre-commit
pipx inject pre-commit pre-commit-uv

With uv:

uv tool install pre-commit --with pre-commit-uv --force-reinstall

Why?

Compared to upstream pre-commit will speed up the initial seed operation. In general, upstream recommends caching the pre-commit cache, however, that is not always possible and is still helpful to have a more performant initial cache creation., Here's an example of what you could expect demonstrated on this project's own pre-commit setup (with a hot uv cache):

❯ hyperfine  'pre-commit install-hooks' 'pre-commit-uv install-hooks'
Benchmark 1: pre-commit install-hooks
  Time (mean ± σ):     54.132 s ±  8.827 s    [User: 15.424 s, System: 9.359 s]
  Range (min … max):   45.972 s … 66.506 s    10 runs

Benchmark 2: pre-commit-uv install-hooks
  Time (mean ± σ):     41.695 s ±  7.395 s    [User: 7.614 s, System: 6.133 s]
  Range (min … max):   32.198 s … 58.467 s    10 runs

Summary
  pre-commit-uv install-hooks ran 1.30 ± 0.31 times faster than pre-commit install-hooks

Configuration

Once installed will use uv out of box, however the DISABLE_PRE_COMMIT_UV_PATCH environment variable if is set it will work as an escape hatch to disable the new behavior.

To avoid interpreter startup overhead of the patching, we only perform this when we detect you calling pre-commit. Should this logic fail you can force the patching by setting the FORCE_PRE_COMMIT_UV_PATCH variable. Should you experience this please raise an issue with the content of the sys.argv. Note that DISABLE_PRE_COMMIT_UV_PATCH will overwrite this flag should both be set.

Metadata

Release files for pre-commit-uv 4.4.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 pre-commit-uv 4.4.0
File Size Uploaded
pre_commit_uv-4.4.0.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pre-commit-uv 4.4.0
File Interpreter ABI Platform
pre_commit_uv-4.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.8 kB

Release files / pre_commit_uv-4.4.0.tar.gz

Download URL pre_commit_uv-4.4.0.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8e1b91485fdaba0673fc0f81229cab364c00fb6193b5fe0bcee2862b1a4ce1d4
BLAKE2b-256 checksum
How to use checksums
953c65ca92a8343efcf16107824d01c4664bb9a2b2e8b7fb4efc954375e56c26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / pre_commit_uv-4.4.0-py3-none-any.whl

Download URL pre_commit_uv-4.4.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9012b09950a50efdcfb03b95355e1f65c14f9a5cb425d12c6bf2c6d6807617d7
BLAKE2b-256 checksum
How to use checksums
29fad5fe0626ce7a70510e6fbf2c6a9f6da4f1cbc42b86542ada1eae0eea6b55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

4.4.0 This release

2 release files

4.3.0

2 release files

4.2.2

2 release files

4.2.1

2 release files

4.2.0

2 release files

4.1.5

2 release files

4.1.4

2 release files

4.1.3

2 release files

4.1.2

2 release files

4.1.1

2 release files

4.1.0

2 release files

4.0.3

2 release files

4.0.2

2 release files

4.0.1

2 release files

4.0.0

2 release files

3.8.0

2 release files

3.7.0

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