astral-sh / astral-sh/uv-pre-commit
New hook? uv-update-requirements
- Dominant language
- Python
- Stars
- 348
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
Why not have a hook that can export old school requirements.txt and update the legacy requirements.txt without interrupting git commit?
I wanted to achieve similar with uv-export hook, but it was not possible to do this.
```
- repo: local
hooks:
- id: update-requirements
name: Update requirements.txt
entry: bash -c 'uv pip freeze > requirements.txt' # EDITED OUT && git add requirements.txt #
language: system
types: [file]
files: \.(json|py|toml)
stages: [pre-commit]
```
Thought it'd be a legit addition.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the existing uv-export hook and its pre-commit configuration. Done means a hook can export and update requirements.txt during pre-commit without interrupting the commit, including the generated-file handling illustrated in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100