pre-commit-uv 4.2.2__tar.gz → 4.4.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
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: pre-commit-uv
3
- Version: 4.2.2
3
+ Version: 4.4.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
@@ -31,14 +31,14 @@ Classifier: License :: OSI Approved :: MIT License
31
31
  Classifier: Operating System :: OS Independent
32
32
  Classifier: Programming Language :: Python
33
33
  Classifier: Programming Language :: Python :: 3 :: Only
34
- Classifier: Programming Language :: Python :: 3.10
35
34
  Classifier: Programming Language :: Python :: 3.11
36
35
  Classifier: Programming Language :: Python :: 3.12
37
36
  Classifier: Programming Language :: Python :: 3.13
38
37
  Classifier: Programming Language :: Python :: 3.14
39
- Requires-Python: >=3.10
40
- Requires-Dist: pre-commit>=4.3
41
- Requires-Dist: uv>=0.9.1
38
+ Classifier: Programming Language :: Python :: 3.15
39
+ Requires-Python: >=3.11
40
+ Requires-Dist: pre-commit>=4.6.2
41
+ Requires-Dist: uv>=0.12.22
42
42
  Description-Content-Type: text/markdown
43
43
 
44
44
  # pre-commit-uv
@@ -2,7 +2,7 @@
2
2
  build-backend = "hatchling.build"
3
3
  requires = [
4
4
  "hatch-vcs>=0.5",
5
- "hatchling>=1.28",
5
+ "hatchling>=1.32.4",
6
6
  ]
7
7
 
8
8
  [project]
@@ -17,24 +17,24 @@ license.file = "LICENSE.txt"
17
17
  authors = [
18
18
  { name = "Bernat Gabor", email = "gaborjbernat@gmail.com" },
19
19
  ]
20
- requires-python = ">=3.10"
20
+ requires-python = ">=3.11"
21
21
  classifiers = [
22
22
  "License :: OSI Approved :: MIT License",
23
23
  "Operating System :: OS Independent",
24
24
  "Programming Language :: Python",
25
25
  "Programming Language :: Python :: 3 :: Only",
26
- "Programming Language :: Python :: 3.10",
27
26
  "Programming Language :: Python :: 3.11",
28
27
  "Programming Language :: Python :: 3.12",
29
28
  "Programming Language :: Python :: 3.13",
30
29
  "Programming Language :: Python :: 3.14",
30
+ "Programming Language :: Python :: 3.15",
31
31
  ]
32
32
  dynamic = [
33
33
  "version",
34
34
  ]
35
35
  dependencies = [
36
- "pre-commit>=4.3",
37
- "uv>=0.9.1",
36
+ "pre-commit>=4.6.2",
37
+ "uv>=0.12.22",
38
38
  ]
39
39
  urls."Bug Tracker" = "https://github.com/tox-dev/pre-commit-uv/issues"
40
40
  urls."Source Code" = "https://github.com/tox-dev/pre-commit-uv"
@@ -50,12 +50,12 @@ dev = [
50
50
  ]
51
51
  test = [
52
52
  "covdefaults>=2.3",
53
- "pytest>=8.4.2",
54
- "pytest-cov>=7",
55
- "pytest-mock>=3.15.1",
53
+ "pytest>=9.1.1",
54
+ "pytest-cov>=7.1",
55
+ "pytest-mock>=3.16",
56
56
  ]
57
57
  type = [
58
- "ty>=0.0.17",
58
+ "ty>=0.0.84",
59
59
  { include-group = "test" },
60
60
  ]
61
61
  lint = [
@@ -63,8 +63,8 @@ lint = [
63
63
  ]
64
64
  pkg-meta = [
65
65
  "check-wheel-contents>=0.6.3",
66
- "twine>=6.2",
67
- "uv>=0.10.2",
66
+ "twine>=7",
67
+ "uv>=0.12.22",
68
68
  ]
69
69
 
70
70
  [tool.hatch]
@@ -89,26 +89,26 @@ lint.select = [
89
89
  "ALL",
90
90
  ]
91
91
  lint.ignore = [
92
- "ANN401", # allow Any as type annotation
93
- "COM812", # Conflict with formatter
94
- "CPY", # No copyright statements
95
- "D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
96
- "D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
97
- "DOC501", # not working with Sphinx
98
- "ISC001", # Conflict with formatter
99
- "RUF067", # `__init__` module should only contain docstrings and re-exports
100
- "S104", # Possible binding to all interfaces
92
+ "any-type", # allow Any as type annotation
93
+ "CPY", # No copyright statements
94
+ "docstring-missing-exception", # not working with Sphinx
95
+ "hardcoded-bind-all-interfaces", # Possible binding to all interfaces
96
+ "incorrect-blank-line-before-class", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
97
+ "missing-trailing-comma", # Conflict with formatter
98
+ "multi-line-summary-first-line", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
99
+ "non-empty-init-module", # `__init__` module should only contain docstrings and re-exports
100
+ "single-line-implicit-string-concatenation", # Conflict with formatter
101
101
  ]
102
102
  lint.per-file-ignores."tests/**/*.py" = [
103
- "D", # don"t care about documentation in tests
104
- "FBT", # don"t care about booleans as positional arguments in tests
105
- "INP001", # no implicit namespace
106
- "PLC2701", # private import
107
- "PLR0913", # any number of arguments in tests
108
- "PLR0917", # any number of arguments in tests
109
- "PLR2004", # Magic value used in comparison, consider replacing with a constant variable
110
- "S", # `subprocess` call: check for execution of untrusted input
111
- "S101", # asserts allowed in tests...
103
+ "assert", # asserts allowed in tests...
104
+ "D", # don"t care about documentation in tests
105
+ "FBT", # don"t care about booleans as positional arguments in tests
106
+ "implicit-namespace-package", # no implicit namespace
107
+ "import-private-name", # private import
108
+ "magic-value-comparison", # Magic value used in comparison, consider replacing with a constant variable
109
+ "S", # `subprocess` call: check for execution of untrusted input
110
+ "too-many-arguments", # any number of arguments in tests
111
+ "too-many-positional-arguments", # any number of arguments in tests
112
112
  ]
113
113
  lint.isort = { known-first-party = [
114
114
  "pre_commit_uv",
@@ -122,10 +122,10 @@ builtin = "clear,usage,en-GB_to_en-US"
122
122
  count = true
123
123
 
124
124
  [tool.pyproject-fmt]
125
- max_supported_python = "3.14"
125
+ max_supported_python = "3.15"
126
126
 
127
127
  [tool.ty]
128
- environment.python-version = "3.14"
128
+ environment.python-version = "3.15"
129
129
 
130
130
  [tool.pytest]
131
131
  ini_options.testpaths = [
@@ -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