dycw-pre-commit-hooks 0.10.21__py3-none-any.whl → 0.10.24__py3-none-any.whl

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.

Potentially problematic release.


This version of dycw-pre-commit-hooks might be problematic. Click here for more details.

@@ -1,11 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dycw-pre-commit-hooks
3
- Version: 0.10.21
3
+ Version: 0.10.24
4
4
  Author-email: Derek Wan <d.wan@icloud.com>
5
- Requires-Python: >=3.11
5
+ Requires-Python: >=3.12
6
6
  Requires-Dist: click<8.2,>=8.1.8
7
- Requires-Dist: dycw-utilities<0.96,>=0.95.21
8
- Requires-Dist: jupyterlab>=4.3.5
7
+ Requires-Dist: dycw-utilities<0.105,>=0.104.7
9
8
  Requires-Dist: loguru<0.8,>=0.7.3
10
9
  Requires-Dist: semver<3.1,>=3.0.4
11
10
  Requires-Dist: tomlkit<0.14,>=0.13.2
@@ -1,13 +1,13 @@
1
- pre_commit_hooks/__init__.py,sha256=Kl1CGvFCtMKhwmNrSv6UxFVZCcuERQS4LE1u87kW7ZQ,60
1
+ pre_commit_hooks/__init__.py,sha256=A2CO8YXbK_4wM9T4MjB9ER7186mt_3IDyyFvBxYjBc4,60
2
2
  pre_commit_hooks/common.py,sha256=v2pUvEMLMfAXg2nNJOH9LYHbFWkdOssLFwnDXsIEkqk,2703
3
3
  pre_commit_hooks/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  pre_commit_hooks/run_bump2version/__init__.py,sha256=1Qgt7njFfTlH39ZY4TucZREUJgqtGMe37U5mLkFmupc,1433
5
5
  pre_commit_hooks/run_bump2version/__main__.py,sha256=BZy8mDElAK3-X2iKvqg1XnGbCiYXcLoMDefaPanWx4g,153
6
6
  pre_commit_hooks/run_bump_my_version/__init__.py,sha256=cl6KTxPaKPmHuebddgfs_OqPK_oYI3R15AbLo8kcFRY,1837
7
7
  pre_commit_hooks/run_bump_my_version/__main__.py,sha256=w2V3y61jrSau-zxjl8ciHtWPlJQwXbYxNJ2tGYVyI4s,156
8
- pre_commit_hooks/run_ruff_format/__init__.py,sha256=Lr_9M0WHhJl6WARAf8Lr830PG9bMbkDXvNSmEkrSxK8,1993
8
+ pre_commit_hooks/run_ruff_format/__init__.py,sha256=4qLSMmPwS50Uqo3FW9joYXaiQ5uKwlvjmk4Vzu6PLrI,2041
9
9
  pre_commit_hooks/run_ruff_format/__main__.py,sha256=faesqqpMaesg5r-LvkkQt1W9kahvNr-60K3SMYv1NgY,152
10
- dycw_pre_commit_hooks-0.10.21.dist-info/METADATA,sha256=d07FIgkDzxrNd9xYm63JCiCC0W2ovk9wNhChlh6ZM3Q,884
11
- dycw_pre_commit_hooks-0.10.21.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
- dycw_pre_commit_hooks-0.10.21.dist-info/entry_points.txt,sha256=URODtkWLHrg6PagXnVbubNWnEUjExjCM_lCPf2LEllo,196
13
- dycw_pre_commit_hooks-0.10.21.dist-info/RECORD,,
10
+ dycw_pre_commit_hooks-0.10.24.dist-info/METADATA,sha256=orT7e-hcorSV7yk0rxVT6BXcxfYRF1pOZwe3BiBS_5g,852
11
+ dycw_pre_commit_hooks-0.10.24.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
+ dycw_pre_commit_hooks-0.10.24.dist-info/entry_points.txt,sha256=URODtkWLHrg6PagXnVbubNWnEUjExjCM_lCPf2LEllo,196
13
+ dycw_pre_commit_hooks-0.10.24.dist-info/RECORD,,
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.10.21"
3
+ __version__ = "0.10.24"
@@ -1,15 +1,17 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from subprocess import CalledProcessError, check_call
4
- from typing import cast
4
+ from typing import TYPE_CHECKING, cast
5
5
 
6
6
  from click import command
7
7
  from loguru import logger
8
8
  from tomlkit import dumps, table
9
- from tomlkit.container import Container
10
9
 
11
10
  from pre_commit_hooks.common import PYPROJECT_TOML, PyProject, read_pyproject
12
11
 
12
+ if TYPE_CHECKING:
13
+ from tomlkit.container import Container
14
+
13
15
 
14
16
  @command()
15
17
  def main() -> bool:
@@ -30,25 +32,25 @@ def _get_modified_pyproject() -> PyProject:
30
32
  pyproject = read_pyproject()
31
33
  doc = pyproject.doc
32
34
  try:
33
- tool = cast(Container, doc["tool"])
35
+ tool = cast("Container", doc["tool"])
34
36
  except KeyError:
35
37
  tool = table()
36
38
  try:
37
- ruff = cast(Container, tool["ruff"])
39
+ ruff = cast("Container", tool["ruff"])
38
40
  except KeyError:
39
41
  ruff = table()
40
42
  ruff["line-length"] = 320
41
43
  try:
42
- format_ = cast(Container, ruff["format"])
44
+ format_ = cast("Container", ruff["format"])
43
45
  except KeyError:
44
46
  format_ = table()
45
47
  format_["skip-magic-trailing-comma"] = True
46
48
  try:
47
- lint = cast(Container, ruff["lint"])
49
+ lint = cast("Container", ruff["lint"])
48
50
  except KeyError:
49
51
  lint = table()
50
52
  try:
51
- isort = cast(Container, lint["isort"])
53
+ isort = cast("Container", lint["isort"])
52
54
  except KeyError:
53
55
  isort = table()
54
56
  isort["split-on-trailing-comma"] = False