|
31 | 31 | use_ty, |
32 | 32 | ) |
33 | 33 | from usethis._deps import add_deps_to_group, get_deps_from_group, is_dep_satisfied_in |
| 34 | +from usethis._fallback import FALLBACK_RUFF_VERSION, FALLBACK_SYNC_WITH_UV_VERSION |
34 | 35 | from usethis._file.pyproject_toml.io_ import PyprojectTOMLManager |
35 | 36 | from usethis._integrations.pre_commit.hooks import _HOOK_ORDER, get_hook_ids |
36 | 37 | from usethis._integrations.pre_commit.yaml import PreCommitConfigYAMLManager |
37 | 38 | from usethis._python.version import PythonVersion |
38 | 39 | from usethis._test import change_cwd |
39 | 40 | from usethis._tool.all_ import ALL_TOOLS |
40 | | -from usethis._tool.impl.base.ruff import _RUFF_VERSION, RuffTool |
41 | | -from usethis._tool.impl.spec.pre_commit import _SYNC_WITH_UV_VERSION |
| 41 | +from usethis._tool.impl.base.ruff import RuffTool |
42 | 42 | from usethis._types.backend import BackendEnum |
43 | 43 | from usethis._types.deps import Dependency |
44 | 44 |
|
@@ -725,7 +725,7 @@ def test_pre_commit_after( |
725 | 725 | f"""\ |
726 | 726 | repos: |
727 | 727 | - repo: https://github.com/tsvikas/sync-with-uv |
728 | | - rev: {_SYNC_WITH_UV_VERSION} |
| 728 | + rev: {FALLBACK_SYNC_WITH_UV_VERSION} |
729 | 729 | hooks: |
730 | 730 | - id: sync-with-uv |
731 | 731 | - repo: local |
@@ -893,7 +893,7 @@ def test_pre_commit_first( |
893 | 893 | f"""\ |
894 | 894 | repos: |
895 | 895 | - repo: https://github.com/tsvikas/sync-with-uv |
896 | | - rev: {_SYNC_WITH_UV_VERSION} |
| 896 | + rev: {FALLBACK_SYNC_WITH_UV_VERSION} |
897 | 897 | hooks: |
898 | 898 | - id: sync-with-uv |
899 | 899 | - repo: local |
@@ -1907,7 +1907,7 @@ def test_fresh(self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]): |
1907 | 1907 | f"""\ |
1908 | 1908 | repos: |
1909 | 1909 | - repo: https://github.com/tsvikas/sync-with-uv |
1910 | | - rev: {_SYNC_WITH_UV_VERSION} |
| 1910 | + rev: {FALLBACK_SYNC_WITH_UV_VERSION} |
1911 | 1911 | hooks: |
1912 | 1912 | - id: sync-with-uv |
1913 | 1913 | """ |
@@ -1985,7 +1985,7 @@ def test_config_file_already_exists(self, uv_init_repo_dir: Path): |
1985 | 1985 | entry: uv run --isolated --frozen --offline python -c "print('hello world!')" |
1986 | 1986 | language: system |
1987 | 1987 | - repo: https://github.com/tsvikas/sync-with-uv |
1988 | | - rev: {_SYNC_WITH_UV_VERSION} |
| 1988 | + rev: {FALLBACK_SYNC_WITH_UV_VERSION} |
1989 | 1989 | hooks: |
1990 | 1990 | - id: sync-with-uv |
1991 | 1991 | """ |
@@ -3435,7 +3435,7 @@ def test_pre_commit( |
3435 | 3435 | f"""\ |
3436 | 3436 | repos: |
3437 | 3437 | - repo: https://github.com/tsvikas/sync-with-uv |
3438 | | - rev: {_SYNC_WITH_UV_VERSION} |
| 3438 | + rev: {FALLBACK_SYNC_WITH_UV_VERSION} |
3439 | 3439 | hooks: |
3440 | 3440 | - id: sync-with-uv |
3441 | 3441 | - repo: local |
@@ -3985,11 +3985,11 @@ def test_add_only_linter( |
3985 | 3985 | f"""\ |
3986 | 3986 | repos: |
3987 | 3987 | - repo: https://github.com/tsvikas/sync-with-uv |
3988 | | - rev: {_SYNC_WITH_UV_VERSION} |
| 3988 | + rev: {FALLBACK_SYNC_WITH_UV_VERSION} |
3989 | 3989 | hooks: |
3990 | 3990 | - id: sync-with-uv |
3991 | 3991 | - repo: https://github.com/astral-sh/ruff-pre-commit |
3992 | | - rev: {_RUFF_VERSION} |
| 3992 | + rev: {FALLBACK_RUFF_VERSION} |
3993 | 3993 | hooks: |
3994 | 3994 | - id: ruff-check |
3995 | 3995 | """ |
@@ -4023,15 +4023,15 @@ def test_add_only_linter_to_existing_formatter( |
4023 | 4023 | f"""\ |
4024 | 4024 | repos: |
4025 | 4025 | - repo: https://github.com/tsvikas/sync-with-uv |
4026 | | - rev: {_SYNC_WITH_UV_VERSION} |
| 4026 | + rev: {FALLBACK_SYNC_WITH_UV_VERSION} |
4027 | 4027 | hooks: |
4028 | 4028 | - id: sync-with-uv |
4029 | 4029 | - repo: https://github.com/astral-sh/ruff-pre-commit |
4030 | | - rev: {_RUFF_VERSION} |
| 4030 | + rev: {FALLBACK_RUFF_VERSION} |
4031 | 4031 | hooks: |
4032 | 4032 | - id: ruff-check |
4033 | 4033 | - repo: https://github.com/astral-sh/ruff-pre-commit |
4034 | | - rev: {_RUFF_VERSION} |
| 4034 | + rev: {FALLBACK_RUFF_VERSION} |
4035 | 4035 | hooks: |
4036 | 4036 | - id: ruff-format |
4037 | 4037 | """ |
@@ -4064,11 +4064,11 @@ def test_add_only_formatter( |
4064 | 4064 | f"""\ |
4065 | 4065 | repos: |
4066 | 4066 | - repo: https://github.com/tsvikas/sync-with-uv |
4067 | | - rev: {_SYNC_WITH_UV_VERSION} |
| 4067 | + rev: {FALLBACK_SYNC_WITH_UV_VERSION} |
4068 | 4068 | hooks: |
4069 | 4069 | - id: sync-with-uv |
4070 | 4070 | - repo: https://github.com/astral-sh/ruff-pre-commit |
4071 | | - rev: {_RUFF_VERSION} |
| 4071 | + rev: {FALLBACK_RUFF_VERSION} |
4072 | 4072 | hooks: |
4073 | 4073 | - id: ruff-format |
4074 | 4074 | """ |
@@ -4102,11 +4102,11 @@ def test_remove_only_linter( |
4102 | 4102 | f"""\ |
4103 | 4103 | repos: |
4104 | 4104 | - repo: https://github.com/tsvikas/sync-with-uv |
4105 | | - rev: {_SYNC_WITH_UV_VERSION} |
| 4105 | + rev: {FALLBACK_SYNC_WITH_UV_VERSION} |
4106 | 4106 | hooks: |
4107 | 4107 | - id: sync-with-uv |
4108 | 4108 | - repo: https://github.com/astral-sh/ruff-pre-commit |
4109 | | - rev: {_RUFF_VERSION} |
| 4109 | + rev: {FALLBACK_RUFF_VERSION} |
4110 | 4110 | hooks: |
4111 | 4111 | - id: ruff-format |
4112 | 4112 | """ |
|
0 commit comments