astral-sh / astral-sh/uv-pre-commit
Add uv-run hook
- Dominant language
- Python
- Stars
- 348
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
We have a small python script with a handful of external dependencies which we want to run as a local pre-commit hook. To ensure that the dependencies are installed, it would be great to use PEP-723 inline script metadata and use `uv run --script` to execute the script.
Would it be possible to add a `uv-run` hook that would allow for this?
This would be helpful since we don't want our developer to have to install `uv` (as much as I love it of course :D), so ideally this would "just work" behind the scenes.
I am happy to submit a PR if that would be helpful.
Thanks!
(if there are other ways to do the thing outlined above I am all ears)
Contributor guide
No contributing guide indexed for this repository
Research direction
No files or tests are named in the issue. Start by inspecting how this repository defines existing pre-commit hooks and how dependencies are provisioned, then verify the expected behavior of uv run --script with PEP-723 metadata. Done means a uv-run hook can execute a Python script with inline dependencies without requiring developers to install uv separately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100