Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 10 additions & 10 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.11.29
rev: v0.11.29
hooks:
# Update the uv lockfile
- id: uv-lock
Expand All @@ -31,7 +31,7 @@ To autoexport `uv.lock` to `requirements.txt`:
```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.11.29
rev: v0.11.29
hooks:
- id: uv-export
```
Expand All @@ -43,7 +43,7 @@ To export to an alternative file, modify the `args`:
```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.11.29
rev: v0.11.29
hooks:
- id: uv-export
args: ["--frozen", "--output-file=requirements-custom.txt", "--quiet"]
Expand All @@ -54,7 +54,7 @@ To compile your requirements via pre-commit, add the following to your `.pre-com
```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.11.29
rev: v0.11.29
hooks:
# Run the pip compile
- id: pip-compile
Expand All @@ -66,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.11.29
rev: v0.11.29
hooks:
# Run the pip compile
- id: pip-compile
Expand All @@ -79,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.11.29
rev: v0.11.29
hooks:
# Run the pip compile
- id: pip-compile
Expand All @@ -96,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.11.29
rev: v0.11.29
hooks:
# Update the uv lockfile
- id: uv-lock
Expand All @@ -116,7 +116,7 @@ default_install_hook_types:
repos:
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.11.29
rev: v0.11.29
hooks:
- id: uv-sync
```
Expand All @@ -129,7 +129,7 @@ To synchronize all dependencies in a workspace:
```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.11.29
rev: v0.11.29
hooks:
- id: uv-sync
args: ["--locked", "--all-packages"]
Expand All @@ -141,7 +141,7 @@ include it as an additional sync dependency:
```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.11.29
rev: v0.11.29
hooks:
- id: uv-sync
additional_dependencies: [keyring]
Expand Down
8 changes: 4 additions & 4 deletions mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def main():
paths = process_version(version)
if subprocess.check_output(["git", "status", "-s"]).strip():
subprocess.run(["git", "add", *paths], check=True)
subprocess.run(["git", "commit", "-m", f"Mirror: {version}"], check=True)
subprocess.run(["git", "tag", f"{version}"], check=True)
subprocess.run(["git", "commit", "-m", f"Mirror: v{version}"], check=True)
subprocess.run(["git", "tag", f"v{version}"], check=True)
else:
print(f"No change {version}")

Expand Down Expand Up @@ -54,8 +54,8 @@ def replace_pyproject_toml(content: str) -> str:
return re.sub(r'"uv==.*"', f'"uv=={version}"', content)

def replace_readme_md(content: str) -> str:
content = re.sub(r"rev: \d+\.\d+\.\d+", f"rev: {version}", content)
return re.sub(r"/uv/\d+\.\d+\.\d+\.svg", f"/uv/{version}.svg", content)
content = re.sub(r"rev: v?\d+\.\d+\.\d+", f"rev: v{version}", content)
return re.sub(r"/uv/v?\d+\.\d+\.\d+\.svg", f"/uv/v{version}.svg", content)

paths = {
"pyproject.toml": replace_pyproject_toml,
Expand Down