{"id":20784142,"url":"https://github.com/tox-dev/pre-commit-uv","last_synced_at":"2025-04-11T23:21:14.539Z","repository":{"id":251805156,"uuid":"838454462","full_name":"tox-dev/pre-commit-uv","owner":"tox-dev","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-31T16:44:46.000Z","size":67,"stargazers_count":111,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-03T05:13:07.352Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tox-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"tidelift":"pypi/pre-commit-uv"}},"created_at":"2024-08-05T17:11:23.000Z","updated_at":"2025-04-02T09:50:15.000Z","dependencies_parsed_at":"2024-08-05T22:18:16.190Z","dependency_job_id":"19da8812-960e-42ab-b9c7-6eb02a46c91c","html_url":"https://github.com/tox-dev/pre-commit-uv","commit_stats":null,"previous_names":["tox-dev/pre-commit-uv"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tox-dev%2Fpre-commit-uv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tox-dev%2Fpre-commit-uv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tox-dev%2Fpre-commit-uv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tox-dev%2Fpre-commit-uv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tox-dev","download_url":"https://codeload.github.com/tox-dev/pre-commit-uv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248493037,"owners_count":21113188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T14:26:28.988Z","updated_at":"2025-04-11T23:21:14.520Z","avatar_url":"https://github.com/tox-dev.png","language":"Python","readme":"# pre-commit-uv\n\n[![PyPI](https://img.shields.io/pypi/v/pre-commit-uv?style=flat-square)](https://pypi.org/project/pre-commit-uv)\n[![PyPI - Implementation](https://img.shields.io/pypi/implementation/pre-commit-uv?style=flat-square)](https://pypi.org/project/pre-commit-uv)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pre-commit-uv?style=flat-square)](https://pypi.org/project/pre-commit-uv)\n[![Downloads](https://static.pepy.tech/badge/pre-commit-uv/month)](https://pepy.tech/project/pre-commit-uv)\n[![PyPI - License](https://img.shields.io/pypi/l/pre-commit-uv?style=flat-square)](https://opensource.org/licenses/MIT)\n[![check](https://github.com/tox-dev/pre-commit-uv/actions/workflows/check.yaml/badge.svg)](https://github.com/tox-dev/pre-commit-uv/actions/workflows/check.yaml)\n\nUse `uv` to create virtual environments and install packages for `pre-commit`.\n\n## Installation\n\nWith pipx:\n\n```shell\npipx install pre-commit\npipx inject pre-commit pre-commit-uv\n```\n\nWith uv:\n\n```shell\nuv tool install pre-commit --with pre-commit-uv --force-reinstall\n```\n\n## Why?\n\nCompared to upstream `pre-commit` will speed up the initial seed operation. In general, upstream recommends caching the\n`pre-commit` cache, however, that is not always possible and is still helpful to have a more performant initial cache\ncreation., Here's an example of what you could expect demonstrated on this project's own pre-commit setup (with a hot\n`uv` cache):\n\n```shell\n❯ hyperfine  'pre-commit install-hooks' 'pre-commit-uv install-hooks'\nBenchmark 1: pre-commit install-hooks\n  Time (mean ± σ):     54.132 s ±  8.827 s    [User: 15.424 s, System: 9.359 s]\n  Range (min … max):   45.972 s … 66.506 s    10 runs\n\nBenchmark 2: pre-commit-uv install-hooks\n  Time (mean ± σ):     41.695 s ±  7.395 s    [User: 7.614 s, System: 6.133 s]\n  Range (min … max):   32.198 s … 58.467 s    10 runs\n\nSummary\n  pre-commit-uv install-hooks ran 1.30 ± 0.31 times faster than pre-commit install-hooks\n```\n\n## Configuration\n\nOnce installed will use `uv` out of box, however the `DISABLE_PRE_COMMIT_UV_PATCH` environment variable if is set it\nwill work as an escape hatch to disable the new behavior.\n\nTo avoid interpreter startup overhead of the patching, we only perform this when we detect you calling `pre-commit`.\nShould this logic fail you can force the patching by setting the `FORCE_PRE_COMMIT_UV_PATCH` variable. Should you\nexperience this please raise an issue with the content of the `sys.argv`. Note that `DISABLE_PRE_COMMIT_UV_PATCH` will\noverwrite this flag should both be set.\n","funding_links":["https://tidelift.com/funding/github/pypi/pre-commit-uv"],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftox-dev%2Fpre-commit-uv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftox-dev%2Fpre-commit-uv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftox-dev%2Fpre-commit-uv/lists"}