-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add uv-run hook #37
Comments
Related to #14 |
@zanieb would you be open to this idea? |
What would this look like in practice? (I'm not a pre-commit expert) |
So basically I'd like to change the current local hook (which requires global uv installation) that looks like this in - repo: local
hooks:
- id: local-python-script
name: Standalone script with PEP-723 deps
entry: uv run ./utils/standalone_script.py --some-option
language: system
pass_filenames: false to - repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.5.22
hooks:
- id: uv-run
name: Standalone script with PEP-723 deps
args: ['utils/standalone_script.py', '--some-option'] Because of the way I am also not a pre-commit expert so it's possible there are some issues that I am not seeing, but it looks doable. |
That seems reasonable to me. |
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)
The text was updated successfully, but these errors were encountered: