pre-commit-uv 4.2.2__tar.gz → 4.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pre-commit-uv
3
- Version: 4.2.2
3
+ Version: 4.3.0
4
4
  Summary: Run pre-commit with uv
5
5
  Project-URL: Bug Tracker, https://github.com/tox-dev/pre-commit-uv/issues
6
6
  Project-URL: Source Code, https://github.com/tox-dev/pre-commit-uv
@@ -36,6 +36,7 @@ Classifier: Programming Language :: Python :: 3.11
36
36
  Classifier: Programming Language :: Python :: 3.12
37
37
  Classifier: Programming Language :: Python :: 3.13
38
38
  Classifier: Programming Language :: Python :: 3.14
39
+ Classifier: Programming Language :: Python :: 3.15
39
40
  Requires-Python: >=3.10
40
41
  Requires-Dist: pre-commit>=4.3
41
42
  Requires-Dist: uv>=0.9.1
@@ -28,6 +28,7 @@ classifiers = [
28
28
  "Programming Language :: Python :: 3.12",
29
29
  "Programming Language :: Python :: 3.13",
30
30
  "Programming Language :: Python :: 3.14",
31
+ "Programming Language :: Python :: 3.15",
31
32
  ]
32
33
  dynamic = [
33
34
  "version",
@@ -122,7 +123,7 @@ builtin = "clear,usage,en-GB_to_en-US"
122
123
  count = true
123
124
 
124
125
  [tool.pyproject-fmt]
125
- max_supported_python = "3.14"
126
+ max_supported_python = "3.15"
126
127
 
127
128
  [tool.ty]
128
129
  environment.python-version = "3.14"
@@ -44,13 +44,13 @@ def _patch() -> None:
44
44
  return
45
45
 
46
46
  if _is_calling_pre_commit() and os.environ.get("DISABLE_PRE_COMMIT_UV_PATCH") is None:
47
- from pre_commit import main # noqa: PLC0415
47
+ from pre_commit import main # ruff:ignore[import-outside-top-level]
48
48
 
49
49
  _original_main, main.main = main.main, _new_main # ty: ignore[invalid-assignment]
50
50
  if "--version" in sys.argv:
51
- from importlib.metadata import version as _metadata_version # noqa: PLC0415
51
+ from importlib.metadata import version as _metadata_version # ruff:ignore[import-outside-top-level]
52
52
 
53
- from pre_commit import constants # noqa: PLC0415
53
+ from pre_commit import constants # ruff:ignore[import-outside-top-level]
54
54
 
55
55
  constants.VERSION = (
56
56
  f"{constants.VERSION} ("
@@ -62,20 +62,20 @@ def _patch() -> None:
62
62
 
63
63
  def _new_main(argv: Sequence[str] | None = None) -> int:
64
64
  # imports applied locally to avoid patching import overhead cost
65
- from functools import cache # noqa: PLC0415
65
+ from functools import cache # ruff:ignore[import-outside-top-level]
66
66
 
67
- from pre_commit.languages import python # noqa: PLC0415
67
+ from pre_commit.languages import python # ruff:ignore[import-outside-top-level]
68
68
 
69
69
  def _install_environment(
70
70
  prefix: Prefix,
71
71
  version: str,
72
72
  additional_dependencies: Sequence[str],
73
73
  ) -> None:
74
- import logging # noqa: PLC0415
74
+ import logging # ruff:ignore[import-outside-top-level]
75
75
 
76
- from pre_commit.git import get_root # noqa: PLC0415
77
- from pre_commit.lang_base import environment_dir, setup_cmd # noqa: PLC0415
78
- from pre_commit.util import cmd_output_b # noqa: PLC0415
76
+ from pre_commit.git import get_root # ruff:ignore[import-outside-top-level]
77
+ from pre_commit.lang_base import environment_dir, setup_cmd # ruff:ignore[import-outside-top-level]
78
+ from pre_commit.util import cmd_output_b # ruff:ignore[import-outside-top-level]
79
79
 
80
80
  project_root_dir = get_root()
81
81
 
@@ -111,31 +111,31 @@ def _new_main(argv: Sequence[str] | None = None) -> int:
111
111
 
112
112
  @cache
113
113
  def _uv() -> str:
114
- from uv import find_uv_bin # noqa: PLC0415
114
+ from uv import find_uv_bin # ruff:ignore[import-outside-top-level]
115
115
 
116
116
  return find_uv_bin()
117
117
 
118
118
  @cache
119
119
  def self_version() -> str:
120
- from importlib.metadata import version as _metadata_version # noqa: PLC0415
120
+ from importlib.metadata import version as _metadata_version # ruff:ignore[import-outside-top-level]
121
121
 
122
122
  return _metadata_version("pre-commit-uv")
123
123
 
124
124
  @cache
125
125
  def uv_version() -> str:
126
- from importlib.metadata import version as _metadata_version # noqa: PLC0415
126
+ from importlib.metadata import version as _metadata_version # ruff:ignore[import-outside-top-level]
127
127
 
128
128
  return _metadata_version("uv")
129
129
 
130
130
  patched = cast("_PatchablePython", python)
131
131
  patched.install_environment = _install_environment
132
132
  patched.health_check = _health_check
133
- assert _original_main is not None # noqa: S101
133
+ assert _original_main is not None # ruff:ignore[assert]
134
134
  return _original_main(argv)
135
135
 
136
136
 
137
137
  def _version_info(exe: str) -> str:
138
- from pre_commit.util import CalledProcessError, cmd_output # noqa: PLC0415
138
+ from pre_commit.util import CalledProcessError, cmd_output # ruff:ignore[import-outside-top-level]
139
139
 
140
140
  prog = 'import sys;print(".".join(str(p) for p in sys.version_info[0:3]))'
141
141
  try:
@@ -147,15 +147,15 @@ def _version_info(exe: str) -> str:
147
147
  def _health_check(prefix: Prefix, version: str) -> str | None:
148
148
  # uv may record fewer version components in pyvenv.cfg than pre-commit expects (e.g. "3.14" vs "3.14.6"),
149
149
  # so compare only the components uv actually wrote rather than requiring an exact string match
150
- from pre_commit.lang_base import environment_dir # noqa: PLC0415
151
- from pre_commit.languages import python # noqa: PLC0415
152
- from pre_commit.util import win_exe # noqa: PLC0415
150
+ from pre_commit.lang_base import environment_dir # ruff:ignore[import-outside-top-level]
151
+ from pre_commit.languages import python # ruff:ignore[import-outside-top-level]
152
+ from pre_commit.util import win_exe # ruff:ignore[import-outside-top-level]
153
153
 
154
154
  pyvenv_cfg = pathlib.Path(environment_dir(prefix, python.ENVIRONMENT_DIR, version)) / "pyvenv.cfg"
155
155
  if not pyvenv_cfg.exists():
156
156
  return "pyvenv.cfg does not exist (old virtualenv?)"
157
157
 
158
- cfg = python._read_pyvenv_cfg(str(pyvenv_cfg)) # noqa: SLF001
158
+ cfg = python._read_pyvenv_cfg(str(pyvenv_cfg)) # ruff:ignore[private-member-access]
159
159
  if "version_info" not in cfg:
160
160
  return "created virtualenv's pyvenv.cfg is missing `version_info`"
161
161
  expected = cfg["version_info"].split(".")
@@ -55,9 +55,9 @@ def test_call_as_module() -> None:
55
55
  def test_install(git_repo: Path, caplog: pytest.LogCaptureFixture, monkeypatch: pytest.MonkeyPatch) -> None:
56
56
  monkeypatch.setenv("FORCE_PRE_COMMIT_UV_PATCH", "1")
57
57
 
58
- import pre_commit_uv # noqa: PLC0415
58
+ import pre_commit_uv # ruff:ignore[import-outside-top-level]
59
59
 
60
- pre_commit_uv._patch() # noqa: SLF001
60
+ pre_commit_uv._patch() # ruff:ignore[private-member-access]
61
61
  main.main(["install-hooks", "-c", str(git_repo / precommit_file)])
62
62
 
63
63
  assert caplog.messages == [
@@ -72,9 +72,9 @@ def test_install(git_repo: Path, caplog: pytest.LogCaptureFixture, monkeypatch:
72
72
  def test_install_seeds_pip(git_repo: Path, monkeypatch: pytest.MonkeyPatch) -> None:
73
73
  monkeypatch.setenv("FORCE_PRE_COMMIT_UV_PATCH", "1")
74
74
 
75
- import pre_commit_uv # noqa: PLC0415
75
+ import pre_commit_uv # ruff:ignore[import-outside-top-level]
76
76
 
77
- pre_commit_uv._patch() # noqa: SLF001
77
+ pre_commit_uv._patch() # ruff:ignore[private-member-access]
78
78
  main.main(["install-hooks", "-c", str(git_repo / precommit_file)])
79
79
 
80
80
  env_dirs = list((git_repo / "store").rglob("py_env-*"))
@@ -121,9 +121,9 @@ def test_install_with_uv_config(
121
121
 
122
122
  monkeypatch.setenv("FORCE_PRE_COMMIT_UV_PATCH", "1")
123
123
 
124
- import pre_commit_uv # noqa: PLC0415
124
+ import pre_commit_uv # ruff:ignore[import-outside-top-level]
125
125
 
126
- pre_commit_uv._patch() # noqa: SLF001
126
+ pre_commit_uv._patch() # ruff:ignore[private-member-access]
127
127
  main.main(["install-hooks", "-c", str(git_repo / precommit_file)])
128
128
 
129
129
  assert caplog.messages == [
@@ -169,9 +169,9 @@ def test_install_with_uv_config_raises_error(
169
169
 
170
170
  monkeypatch.setenv("FORCE_PRE_COMMIT_UV_PATCH", "1")
171
171
 
172
- import pre_commit_uv # noqa: PLC0415
172
+ import pre_commit_uv # ruff:ignore[import-outside-top-level]
173
173
 
174
- pre_commit_uv._patch() # noqa: SLF001
174
+ pre_commit_uv._patch() # ruff:ignore[private-member-access]
175
175
 
176
176
  # would raise SystemExit due to bad config
177
177
  with pytest.raises(SystemExit):
File without changes
File without changes
File without changes