Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
82d9f4b
feat: add uv-run hook
wpk-nist-gov Jun 13, 2025
7339acc
chore: update uv-run hook
wpk-nist-gov Jun 13, 2025
914a81a
chore: change wording of uv-run description
wpk-nist-gov Jun 13, 2025
fc93d17
Merge branch 'main' into add-uv-run-hook
wpk-nist-gov Jun 25, 2025
2d6fd4f
chore: bump uv version to 0.7.15
wpk-nist-gov Jun 25, 2025
33d92c0
Mirror: 0.7.16
zanieb Jun 28, 2025
d84bd09
Mirror: 0.7.17
zanieb Jun 29, 2025
fe915de
Mirror: 0.7.18
zanieb Jul 2, 2025
cbdcdfc
Mirror: 0.7.19
zanieb Jul 3, 2025
a6c1234
Mirror: 0.7.20
zanieb Jul 10, 2025
8981b3c
Mirror: 0.7.21
zanieb Jul 14, 2025
4176797
Mirror: 0.7.22
zanieb Jul 17, 2025
e92fcea
Mirror: 0.8.0
zanieb Jul 18, 2025
371d4b1
Mirror: 0.8.1
zanieb Jul 22, 2025
fd34bd8
Mirror: 0.8.2
zanieb Jul 23, 2025
1356154
Mirror: 0.8.3
zanieb Jul 25, 2025
ed4cbbe
chore: fixed typo
wpk-nist-gov Jul 28, 2025
c5f08ca
chore: update version to 0.8.3
wpk-nist-gov Jul 28, 2025
56a1f0b
Mirror: 0.8.4
zanieb Jul 30, 2025
b887cda
Use `--quiet` by default in `uv-export` (#55)
EdAbati Aug 1, 2025
9c58bdc
Mirror: 0.8.5
zanieb Aug 6, 2025
7263e3e
Mirror: 0.8.6
zanieb Aug 7, 2025
21aa2bc
Mirror: 0.8.7
zanieb Aug 9, 2025
5c60025
Mirror: 0.8.8
zanieb Aug 9, 2025
614228f
Mirror: 0.8.9
zanieb Aug 12, 2025
d0c9c64
Mirror: 0.8.10
zanieb Aug 14, 2025
062fc1f
Mirror: 0.8.11
zanieb Aug 14, 2025
9b7b258
chore(ci): add Dependabot config, pin some workflows (#57)
woodruffw Aug 15, 2025
27051f7
fix(ci): enable persist-credentials (#58)
woodruffw Aug 19, 2025
b5704af
Mirror: 0.8.12
zanieb Aug 19, 2025
365fddc
Mirror: 0.8.13
zanieb Aug 21, 2025
3cefa1b
Mirror: 0.8.14
zanieb Aug 29, 2025
89968d6
Mirror: 0.8.15
zanieb Sep 3, 2025
c0a9ac0
Mirror: 0.8.16
zanieb Sep 10, 2025
04b3e7c
Mirror: 0.8.17
zanieb Sep 11, 2025
0cf0b17
Mirror: 0.8.18
zanieb Sep 18, 2025
0cbd5eb
Mirror: 0.8.19
zanieb Sep 20, 2025
0a83bf5
Mirror: 0.8.20
zanieb Sep 23, 2025
79397b2
Mirror: 0.8.21
zanieb Sep 23, 2025
63d86e0
Mirror: 0.8.22
zanieb Sep 24, 2025
9c0b22c
Mirror: 0.8.23
zanieb Oct 4, 2025
3099aeb
Mirror: 0.8.24
zanieb Oct 7, 2025
8b850b4
Mirror: 0.9.0
zanieb Oct 8, 2025
79d315f
Mirror: 0.9.1
zanieb Oct 9, 2025
f7e617f
Mirror: 0.9.2
zanieb Oct 10, 2025
fd461fd
Mirror: 0.9.3
zanieb Oct 15, 2025
677e25c
Mirror: 0.9.4
zanieb Oct 19, 2025
88c9430
Mirror: 0.9.5
zanieb Oct 21, 2025
f0a23fd
Mirror: 0.9.6
zanieb Oct 29, 2025
21816f5
Mirror: 0.9.7
zanieb Oct 31, 2025
a5fbe4f
Mirror: 0.9.8
zanieb Nov 8, 2025
f96d2c7
Mirror: 0.9.9
zanieb Nov 12, 2025
d30b429
chore: rebase from main
wpk-nist-gov Nov 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
github-actions:
patterns:
- "*"
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ jobs:
- if: ${{ startsWith(github.event_name, 'repository_dispatch') }}
run: sleep 30

- uses: actions/checkout@v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: true # needed to push commits below

- uses: actions/setup-python@v5
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.11"
cache: pip
Expand Down
13 changes: 12 additions & 1 deletion .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
entry: uv export
language: python
files: ^uv\.lock$
args: ["--frozen", "--output-file=requirements.txt"]
args: ["--frozen", "--output-file=requirements.txt", "--quiet"]
pass_filenames: false
additional_dependencies: []
minimum_pre_commit_version: "2.9.2"
Expand All @@ -38,3 +38,14 @@
pass_filenames: false
stages: [post-checkout, post-merge, post-rewrite]
minimum_pre_commit_version: "2.9.2"
- id: uv-run
name: uv-run
description: "Automatically run scripts with 'uv run'"
entry: uv run --no-active
args: []
language: python
pass_filenames: false
additional_dependencies: []
minimum_pre_commit_version: "2.9.2"


38 changes: 27 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To ensure the lockfile is up-to-date:
```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.7.15
rev: 0.9.9
hooks:
# Update the uv lockfile
- id: uv-lock
Expand All @@ -31,28 +31,30 @@ To autoexport `uv.lock` to `requirements.txt`:
```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.7.15
rev: 0.9.9
hooks:
- id: uv-export
```

By default, this hook uses the ["quiet" output](https://docs.astral.sh/uv/reference/cli/#uv-export--quiet).

To export to an alternative file, modify the `args`:

```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.7.15
rev: 0.9.9
hooks:
- id: uv-export
args: ["--frozen", "--output-file=requirements-custom.txt"]
args: ["--frozen", "--output-file=requirements-custom.txt", "--quiet"]
```

To compile your requirements via pre-commit, add the following to your `.pre-commit-config.yaml`:

```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.7.15
rev: 0.9.9
hooks:
# Run the pip compile
- id: pip-compile
Expand All @@ -64,7 +66,7 @@ To compile alternative files, modify the `args` and `files`:
```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.7.15
rev: 0.9.9
hooks:
# Run the pip compile
- id: pip-compile
Expand All @@ -77,7 +79,7 @@ To run the hook over multiple files at the same time:
```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.7.15
rev: 0.9.9
hooks:
# Run the pip compile
- id: pip-compile
Expand All @@ -94,7 +96,7 @@ To run a hook on a project within a subdirectory (i.e., in a monorepo):
```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.7.15
rev: 0.9.9
hooks:
# Update the uv lockfile
- id: uv-lock
Expand All @@ -114,7 +116,7 @@ default_install_hook_types:
repos:
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.7.15
rev: 0.9.9
hooks:
- id: uv-sync
```
Expand All @@ -127,7 +129,7 @@ To synchronize all dependencies in a workspace:
```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.7.15
rev: 0.9.9
hooks:
- id: uv-sync
args: ["--locked", "--all-packages"]
Expand All @@ -139,12 +141,26 @@ include it as an additional sync dependency:
```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.7.15
rev: 0.9.9
hooks:
- id: uv-sync
additional_dependencies: [keyring]
```

To run an arbitrary script using `uv run`, (e.g., one using [inline script
metadata](https://packaging.python.org/en/latest/specifications/inline-script-metadata/#inline-script-metadata)):

```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.9.9
hooks:
- id: uv-run
args: ["--script", "path/to/script.py"]
files: file-pattern-script-depends-on
```


## License

uv-pre-commit is licensed under either of
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "uv-pre-commit"
version = "0.0.0"
dependencies = [
"uv==0.7.15",
"uv==0.9.9",
]

[project.optional-dependencies]
Expand Down