1- # sync-rye -pre-commit
1+ # sync-uv -pre-commit
22[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( https://opensource.org/licenses/MIT )
33
4- > [ !CAUTION]
5- > Migrate from ` rye ` to ` uv ` .
6- >
7- > see more: https://github.com/astral-sh/rye/discussions/1342
8-
94## how to use
105``` yaml
116repos :
127 - hooks :
13- - id : sync-rye -pre-commit
8+ - id : sync-uv -pre-commit
149 args :
1510 - " -a ruff:ruff:v:"
1611 - " -a ruff:ruff-format:v:"
17- repo : https://github.com/phi-friday/sync-rye-pre-commit
18- rev : v0.1.4
12+ - " -e some_extra"
13+ repo : https://github.com/phi-friday/sync-uv-pre-commit
14+ rev : v0.1.1
1915` ` `
2016
2117### args
2218- ` -a` or `--args`: `{library}[:{hook_id}[:{prefix}[:{suffix}]]]` (defaults: `[]`)
2319- `-p` or `--pyproject` : ` pyproject.toml` path (defaults: `pyproject.toml`)
2420- `-P` or `--pre-commit` : ` .pre-commit-config.yaml` path (defaults: `.pre-commit-config.yaml`)
2521- `-l` or `--log-level` : log level (defaults: `INFO`)
22+ - `-e` or `--extra` : optional dependencies (defaults: `[]`)
2623
2724# # success output
2825` ` ` bash
29- ❯ rye run pre-commit run --all-files --show-diff-on-failure --verbose
30- Sync rye and pre commit..................................................Passed
31- - hook id: sync-rye -pre-commit
26+ ❯ uv run pre-commit run --all-files --show-diff-on-failure --verbose
27+ Sync uv and pre commit..................................................Passed
28+ - hook id: sync-uv -pre-commit
3229- duration: 0.53s
3330
3431[INFO] - Processing args:
@@ -37,6 +34,8 @@ Sync rye and pre commit..................................................Passed
3734[INFO] - - `{'name' : ' mypy' , 'hook_id': 'mypy', 'prefix': 'v', 'suffix': ''}`
3835[INFO] - Processing pyproject : ` pyproject.toml`
3936[INFO] - Processing pre_commit : ` .pre-commit-config.yaml`
37+ [INFO] - Running command :
38+ uv pip compile pyproject.toml -o requirements.txt --extra dev_dependencies
4039[INFO] - Expected ruff to be v0.5.7, and found v0.5.7
4140[INFO] - Expected ruff-format to be v0.5.7, and found v0.5.7
4241[INFO] - Expected mypy to be v1.11.1, and found v1.11.1
@@ -45,9 +44,9 @@ Sync rye and pre commit..................................................Passed
4544
4645## error output
4746` ` ` bash
48- ❯ rye run pre-commit run --all-files --show-diff-on-failure --verbose
49- Sync rye and pre commit..................................................Failed
50- - hook id : sync-rye -pre-commit
47+ ❯ uv run pre-commit run --all-files --show-diff-on-failure --verbose
48+ Sync uv and pre commit..................................................Failed
49+ - hook id : sync-uv -pre-commit
5150- duration : 0.13s
5251- exit code : 1
5352
@@ -57,6 +56,8 @@ Sync rye and pre commit..................................................Failed
5756[INFO] - - `{'name' : ' mypy' , 'hook_id': 'mypy', 'prefix': 'v', 'suffix': ''}`
5857[INFO] - Processing pyproject : ` pyproject.toml`
5958[INFO] - Processing pre_commit : ` .pre-commit-config.yaml`
59+ [INFO] - Running command :
60+ uv pip compile pyproject.toml -o requirements.txt --extra dev_dependencies
6061[INFO] - Expected mypy to be v1.11.1, and found v1.11.1
6162[ERROR] - Results: : 1 success, 2 errors
6263[ERROR] - Expected ruff to be v0.5.7, but found v0.5.6
0 commit comments