pyproject-pre-commit 0.4.1__tar.gz → 0.4.3__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.
Files changed (23) hide show
  1. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/.github/workflows/pypi.yml +4 -4
  2. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/.github/workflows/test.yml +5 -2
  3. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/.pre-commit-config.yaml +15 -8
  4. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/.pre-commit-hooks.yaml +12 -9
  5. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/PKG-INFO +6 -26
  6. pyproject_pre_commit-0.4.3/pyproject.toml +192 -0
  7. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/src/pyproject_pre_commit/__init__.py +1 -1
  8. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/tests/test_pyproject_pre_commit.py +8 -4
  9. pyproject_pre_commit-0.4.3/tests/test_version.py +13 -0
  10. pyproject_pre_commit-0.4.3/uv.lock +2668 -0
  11. pyproject_pre_commit-0.4.1/pyproject.toml +0 -233
  12. pyproject_pre_commit-0.4.1/tests/test_version.py +0 -13
  13. pyproject_pre_commit-0.4.1/uv.lock +0 -1842
  14. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/.github/FUNDING.yml +0 -0
  15. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/.gitignore +0 -0
  16. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/.mise.toml +0 -0
  17. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/LICENSE +0 -0
  18. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/README.md +0 -0
  19. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/renovate.json +0 -0
  20. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/src/pyproject_pre_commit/__version__.py +0 -0
  21. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/src/pyproject_pre_commit/py.typed +0 -0
  22. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/src/pyproject_pre_commit/pyproject_pre_commit.py +0 -0
  23. {pyproject_pre_commit-0.4.1 → pyproject_pre_commit-0.4.3}/tests/__init__.py +0 -0
@@ -16,7 +16,7 @@ jobs:
16
16
  permissions:
17
17
  contents: write
18
18
  steps:
19
- - uses: actions/checkout@v4
19
+ - uses: actions/checkout@v6
20
20
  with:
21
21
  ref: main
22
22
  - name: Compare to the last tag
@@ -41,7 +41,7 @@ jobs:
41
41
  new_tag_no_v=${new_tag#v}
42
42
  sed -i"" "s/^version.*$/version = \"${new_tag_no_v}\"/" pyproject.toml
43
43
  if [ -n "$(git diff)" ];then
44
- { echo "flag=1"; "lat_tag=${last_tag}"; "new_tag=${new_tag}"; } >> "$GITHUB_OUTPUT"
44
+ { echo "flag=1"; echo "last_tag=${last_tag}"; echo "new_tag=${new_tag}"; } >> "$GITHUB_OUTPUT"
45
45
  else
46
46
  echo "flag=0" >> "$GITHUB_OUTPUT"
47
47
  fi
@@ -70,10 +70,10 @@ jobs:
70
70
  with:
71
71
  github_token: ${{ github.token }}
72
72
  tags: true
73
- - uses: actions/setup-python@v5
73
+ - uses: actions/setup-python@v6
74
74
  if: ${{ steps.check.outputs.flag == 1 }}
75
75
  with:
76
- python-version: "3.10"
76
+ python-version: "3.14"
77
77
  - name: Publish to PyPI
78
78
  if: ${{ steps.check.outputs.flag == 1 }}
79
79
  run: |
@@ -23,8 +23,11 @@ on:
23
23
  main_py_ver:
24
24
  description: "Main python version for coverage/tmate."
25
25
  type: choice
26
- default: "3.10"
26
+ default: "3.14"
27
27
  options:
28
+ - "3.14"
29
+ - "3.13"
30
+ - "3.12"
28
31
  - "3.11"
29
32
  - "3.10"
30
33
  - "3.9"
@@ -53,7 +56,7 @@ jobs:
53
56
  fail-fast: false
54
57
  matrix:
55
58
  os: [ubuntu-latest]
56
- python-version: ["3.12", "3.11", "3.10", "3.9"]
59
+ python-version: ["3.14", "3.13", "3.12", "3.11", "3.10", "3.9"]
57
60
  permissions:
58
61
  contents: write
59
62
  runs-on: ${{ matrix.os }}
@@ -169,6 +169,14 @@ repos:
169
169
  - pyi
170
170
  require_serial: true
171
171
  pass_filenames: false
172
+ - id: ty
173
+ # https://github.com/astral-sh/ty
174
+ name: ty
175
+ entry: ty check
176
+ language: system
177
+ types_or:
178
+ - python
179
+ - pyi
172
180
  - id: numpydoc-validation
173
181
  # https://github.com/numpy/numpydoc
174
182
  name: numpydoc-validation
@@ -196,21 +204,14 @@ repos:
196
204
  entry: mdformat
197
205
  language: system
198
206
  types: [markdown]
199
- - id: actionlint
200
- name: actionlint
201
- entry: actionlint
202
- language: system
203
- types: [yaml]
204
- files: "^.github/workflows/"
205
207
  - id: validate-pyproject
206
208
  name: validate-pyproject
207
209
  entry: validate-pyproject
208
210
  language: system
209
211
  files: ^pyproject.toml$
210
212
  - repo: https://github.com/pre-commit/pre-commit-hooks
211
- rev: v5.0.0
213
+ rev: v6.0.0
212
214
  hooks:
213
- - id: check-byte-order-marker
214
215
  - id: check-yaml
215
216
  - id: check-json
216
217
  - id: check-toml
@@ -227,3 +228,9 @@ repos:
227
228
  - id: detect-aws-credentials
228
229
  args:
229
230
  - "--allow-missing-credentials"
231
+ - repo: https://github.com/rhysd/actionlint
232
+ rev: v1.7.9
233
+ hooks:
234
+ - id: actionlint
235
+ args:
236
+ - "-ignore=SC2129" # allow individual redirects ({} >> file is not allowed in GitHub Actions' run)
@@ -229,6 +229,18 @@
229
229
  - jupyter
230
230
  pass_filenames: false
231
231
  require_serial: true
232
+ - id: ty
233
+ name: ty
234
+ description: An extremely fast Python type checker and language server, written in Rust.
235
+ entry: ty check
236
+ language: system
237
+ types_or:
238
+ - python
239
+ - pyi
240
+ - cython
241
+ - jupyter
242
+ pass_filenames: false
243
+ require_serial: true
232
244
  - id: numpydoc-validation
233
245
  # https://github.com/numpy/numpydoc
234
246
  name: numpydoc-validation
@@ -267,15 +279,6 @@
267
279
  language: system
268
280
  types: [markdown]
269
281
  require_serial: true
270
- - id: actionlint
271
- # https://github.com/Mateusz-Grzelinski/actionlint-py
272
- name: actionlint
273
- description: Lint GitHub workflows with actionlint
274
- entry: actionlint
275
- language: system
276
- types: [yaml]
277
- files: "^.github/workflows/"
278
- require_serial: true
279
282
  - id: validate-pyproject
280
283
  # https://github.com/abravalheri/validate-pyproject
281
284
  name: validate-pyproject
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyproject-pre-commit
3
- Version: 0.4.1
3
+ Version: 0.4.3
4
4
  Summary: pre-commit hooks for python projects using pyproject.toml.
5
5
  Project-URL: Repository, https://github.com/rcmdnk/pyproject-pre-commit
6
6
  Project-URL: Documentation, https://github.com/rcmdnk/pyproject-pre-commit
@@ -18,12 +18,14 @@ Classifier: Topic :: Software Development
18
18
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
19
  Classifier: Topic :: Utilities
20
20
  Requires-Python: >=3.9.0
21
- Requires-Dist: actionlint-py>=1.7.7.23
21
+ Requires-Dist: mdformat-beautysh>=0.1.1
22
22
  Requires-Dist: mdformat-config>=0.2.1
23
23
  Requires-Dist: mdformat-footnote>=0.1.1
24
24
  Requires-Dist: mdformat-frontmatter>=2.0.1
25
25
  Requires-Dist: mdformat-gfm>=0.3.5
26
+ Requires-Dist: mdformat-gofmt>=0.0.2
26
27
  Requires-Dist: mdformat-pyproject>=0.0.1
28
+ Requires-Dist: mdformat-ruff>=0.1.3
27
29
  Requires-Dist: mdformat-rustfmt>=0.0.3
28
30
  Requires-Dist: mdformat-tables>=1.0.0
29
31
  Requires-Dist: mdformat-toc>=0.3.0
@@ -34,29 +36,6 @@ Requires-Dist: numpydoc>=1.8.0
34
36
  Requires-Dist: pre-commit>=4.0.0
35
37
  Requires-Dist: shellcheck-py>=0.9.0.5
36
38
  Requires-Dist: validate-pyproject[all]>=0.22
37
- Provides-Extra: all
38
- Requires-Dist: autoflake>=2.2.1; extra == 'all'
39
- Requires-Dist: autopep8>=2.0.4; extra == 'all'
40
- Requires-Dist: bandit[toml]>=1.7.5; extra == 'all'
41
- Requires-Dist: black>=24.3.0; extra == 'all'
42
- Requires-Dist: blacken-docs>=1.16.0; extra == 'all'
43
- Requires-Dist: flake8-annotations-complexity>=0.0.8; extra == 'all'
44
- Requires-Dist: flake8-bugbear>=24.0.0; extra == 'all'
45
- Requires-Dist: flake8-builtins>=2.1.0; extra == 'all'
46
- Requires-Dist: flake8-comprehensions>=3.14.0; extra == 'all'
47
- Requires-Dist: flake8-debugger>=4.1.2; extra == 'all'
48
- Requires-Dist: flake8-docstrings>=1.7.0; extra == 'all'
49
- Requires-Dist: flake8-executable>=2.1.3; extra == 'all'
50
- Requires-Dist: flake8-pep3101>=2.0.0; extra == 'all'
51
- Requires-Dist: flake8-print>=5.0.0; extra == 'all'
52
- Requires-Dist: flake8-pyproject>=1.2.3; extra == 'all'
53
- Requires-Dist: flake8-rst-docstrings>=0.3.0; extra == 'all'
54
- Requires-Dist: flake8-string-format>=0.3.0; extra == 'all'
55
- Requires-Dist: isort>=5.12.0; extra == 'all'
56
- Requires-Dist: mdformat-ruff>=0.1.3; extra == 'all'
57
- Requires-Dist: pep8-naming>=0.14.0; extra == 'all'
58
- Requires-Dist: pycodestyle>=2.11.0; extra == 'all'
59
- Requires-Dist: ruff>=0.7.2; extra == 'all'
60
39
  Provides-Extra: black
61
40
  Requires-Dist: autoflake>=2.2.1; extra == 'black'
62
41
  Requires-Dist: autopep8>=2.0.4; extra == 'black'
@@ -79,8 +58,9 @@ Requires-Dist: isort>=5.12.0; extra == 'black'
79
58
  Requires-Dist: pep8-naming>=0.14.0; extra == 'black'
80
59
  Requires-Dist: pycodestyle>=2.11.0; extra == 'black'
81
60
  Provides-Extra: ruff
82
- Requires-Dist: mdformat-ruff>=0.1.3; extra == 'ruff'
83
61
  Requires-Dist: ruff>=0.7.2; extra == 'ruff'
62
+ Provides-Extra: ty
63
+ Requires-Dist: ty>=0.0.7; extra == 'ty'
84
64
  Description-Content-Type: text/markdown
85
65
 
86
66
  # pyproject-pre-commit<a name="pyproject-pre-commit"></a>
@@ -0,0 +1,192 @@
1
+ [project]
2
+ name = "pyproject-pre-commit"
3
+ version = "0.4.3"
4
+ description = "pre-commit hooks for python projects using pyproject.toml."
5
+ authors = [
6
+ { name = "rcmdnk", email = "rcmdnk@gmail.com" }
7
+ ]
8
+ readme = "README.md"
9
+ license = "Apache-2.0"
10
+ keywords = ["pre-commit", "pyproject.toml", "uv"]
11
+ classifiers = [
12
+ "Development Status :: 3 - Alpha",
13
+ "Environment :: Console",
14
+ "Intended Audience :: Developers",
15
+ "Operating System :: OS Independent",
16
+ "Topic :: Software Development",
17
+ "Topic :: Software Development :: Libraries :: Python Modules",
18
+ "Topic :: Utilities",
19
+ ]
20
+ requires-python = ">=3.9.0"
21
+ dependencies = [
22
+ "pre-commit>=4.0.0",
23
+ "mypy>=1.5.1",
24
+ "numpydoc>=1.8.0",
25
+ "shellcheck-py>=0.9.0.5",
26
+ "mdformat>=0.7.17",
27
+ "mdformat-pyproject>=0.0.1",
28
+ "mdformat-ruff>=0.1.3",
29
+ "mdformat-beautysh>=0.1.1",
30
+ "mdformat-config>=0.2.1",
31
+ "mdformat-gofmt>=0.0.2",
32
+ "mdformat-rustfmt>=0.0.3",
33
+ "mdformat-footnote>=0.1.1",
34
+ "mdformat-frontmatter>=2.0.1",
35
+ "mdformat-gfm>=0.3.5",
36
+ "mdformat-tables>=1.0.0",
37
+ "mdformat-web>=0.2.0",
38
+ "mdformat-toc>=0.3.0",
39
+ "validate-pyproject[all]>=0.22",
40
+ ]
41
+
42
+ [project.urls]
43
+ Repository = "https://github.com/rcmdnk/pyproject-pre-commit"
44
+ Documentation = "https://github.com/rcmdnk/pyproject-pre-commit"
45
+ Homepage = "https://github.com/rcmdnk/pyproject-pre-commit"
46
+ Issue = "https://github.com/rcmdnk/pyproject-pre-commit/issues"
47
+
48
+ [project.optional-dependencies]
49
+ ruff = [
50
+ "ruff>=0.7.2",
51
+ ]
52
+ black = [
53
+ "black>=24.3.0",
54
+ "blacken-docs>=1.16.0",
55
+ "flake8-pyproject>=1.2.3",
56
+ "flake8-annotations-complexity>=0.0.8",
57
+ "flake8-bugbear>=24.0.0",
58
+ "flake8-builtins>=2.1.0",
59
+ "flake8-comprehensions>=3.14.0",
60
+ "flake8-debugger>=4.1.2",
61
+ "flake8-docstrings>=1.7.0",
62
+ "flake8-executable>=2.1.3",
63
+ "flake8-pep3101>=2.0.0",
64
+ "flake8-print>=5.0.0",
65
+ "flake8-rst-docstrings>=0.3.0",
66
+ "flake8-string-format>=0.3.0",
67
+ "pep8-naming>=0.14.0",
68
+ "pycodestyle>=2.11.0",
69
+ "autoflake>=2.2.1",
70
+ "autopep8>=2.0.4",
71
+ "isort>=5.12.0",
72
+ "bandit[toml]>=1.7.5",
73
+ ]
74
+ ty = [
75
+ "ty>=0.0.7",
76
+ ]
77
+
78
+ [dependency-groups]
79
+ dev = [
80
+ "pytest>=8.0.0",
81
+ "pytest-cov>=6.0.0",
82
+ "pytest-xdist>=3.3.1",
83
+ "mdformat-ruff>=0.1.3",
84
+ ]
85
+ ruff = [
86
+ "pyproject-pre-commit[ruff]",
87
+ ]
88
+ black = [
89
+ "pyproject-pre-commit[black]",
90
+ ]
91
+ ty = [
92
+ "pyproject-pre-commit[ty]",
93
+ ]
94
+
95
+ [project.scripts]
96
+ ppc = "pyproject_pre_commit:main"
97
+
98
+ [build-system]
99
+ requires = ["hatchling"]
100
+ build-backend = "hatchling.build"
101
+
102
+ [tool.uv]
103
+ default-groups = ["dev", "ruff", "black", "ty"]
104
+
105
+ [tool.pytest.ini_options]
106
+ addopts = "-n auto"
107
+ testpaths = ["tests",]
108
+
109
+ [tool.ruff]
110
+ line-length = 79
111
+
112
+ [tool.ruff.lint]
113
+ select = ["ALL"]
114
+
115
+ ignore = [
116
+ "E203", # Not PEP8 compliant and black insert space around slice: [Frequently Asked Questions - Black 22.12.0 documentation](https://black.readthedocs.io/en/stable/faq.html#why-are-flake8-s-e203-and-w503-violated)
117
+ "E501", # Line too long. Disable it to allow long lines of comments and print lines which black allows.
118
+ "D100", "D102", "D103", "D104", "D105", "D106", # Missing docstrings other than class (D101)
119
+ "D401", # First line should be in imperative mood
120
+ "D211", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.
121
+ "D213", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`.
122
+ "COM812", "D203", "ISC001", # The following rules may cause conflicts when used with the formatter: `COM812`, `D203`, `ISC001`. To avoid unexpected behavior, we recommend disabling these rules, either by removing them from the `select` or `extend-select` configuration, or adding them to the `ignore` configuration.
123
+ "FBT001", # Boolean-typed positional argument in function definition
124
+ "FBT002", # Boolean default positional argument in function definition
125
+ "FBT003", # Boolean positional value in function call
126
+ "TID252", # Prefer absolute imports over relative imports from parent modules
127
+ "PLC0415", # `import` should be at the top-level of a file
128
+ "PLR2004", # Magic value used in comparison
129
+ ]
130
+
131
+ [tool.ruff.lint.per-file-ignores]
132
+ "tests/**" = ["S101"]
133
+
134
+ [tool.ruff.lint.mccabe]
135
+ max-complexity = 10
136
+
137
+ [tool.ruff.format]
138
+ # quote-style = "single"
139
+ docstring-code-format = true
140
+
141
+ [tool.black]
142
+ line-length = 79
143
+
144
+ [tool.autoflake]
145
+ remove-all-unused-imports = true
146
+ expand-star-imports = true
147
+ remove-duplicate-keys = true
148
+ remove-unused-variables = true
149
+
150
+ [tool.autopep8]
151
+ ignore = "E203,E501,W503"
152
+ recursive = true
153
+ aggressive = 3
154
+
155
+ [tool.isort]
156
+ profile = "black"
157
+ line_length = 79
158
+
159
+ [tool.flake8]
160
+ # E203 is not PEP8 compliant and black insert space around slice: [Frequently Asked Questions - Black 22.12.0 documentation](https://black.readthedocs.io/en/stable/faq.html#why-are-flake8-s-e203-and-w503-violated)
161
+ # E501: Line too long. Disable it to allow long lines of comments and print lines which black allows.
162
+ # E704: multiple statements on one line (def). This is inconsistent with black >= 24.1.1 (see ttps://github.com/psf/black/pull/3796)
163
+ # W503 is the counter part of W504, which follows current PEP8: [Line break occurred before a binary operator (W503)](https://www.flake8rules.com/rules/W503.html)
164
+ # D100~D106: Missing docstrings other than class (D101)
165
+ # D401: First line should be in imperative mood
166
+ ignore = "E203,E501,E704,W503,D100,D102,D103,D104,D105,D106,D401"
167
+ max-complexity = 10
168
+ docstring-convention = "numpy"
169
+
170
+ [tool.bandit]
171
+ exclude_dirs = ["tests"]
172
+
173
+ [tool.mypy]
174
+ files = ["src/**/*.py"]
175
+ strict = true
176
+ warn_return_any = false
177
+ ignore_missing_imports = true
178
+ scripts_are_modules = true
179
+ install_types = true
180
+ non_interactive = true
181
+
182
+ [tool.numpydoc_validation]
183
+ checks = [
184
+ "all", # report on all checks, except the below
185
+ "EX01", # "No examples section found"
186
+ "ES01", # "No extended summary found"
187
+ "SA01", # "See Also section not found"
188
+ "GL08", # "The object does not have a docstring"
189
+ "PR01", # "Parameters {missing_params} not documented"
190
+ "PR02", # "Unknown parameters {unknown_params}"
191
+ "RT01", # "No Returns section found"
192
+ ]
@@ -1,4 +1,4 @@
1
1
  from .__version__ import __version__
2
2
  from .pyproject_pre_commit import main
3
3
 
4
- __all__ = ["main", "__version__"]
4
+ __all__ = ["__version__", "main"]
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  import sys
2
4
 
3
5
  import pytest
@@ -6,7 +8,7 @@ from pyproject_pre_commit import __version__, main
6
8
 
7
9
 
8
10
  @pytest.mark.parametrize(
9
- "argv, code, out",
11
+ ("argv", "code", "out"),
10
12
  [
11
13
  (
12
14
  ["ppc"],
@@ -20,7 +22,9 @@ from pyproject_pre_commit import __version__, main
20
22
  ),
21
23
  ],
22
24
  )
23
- def test_sys_exit(argv, code, out, capsys):
25
+ def test_sys_exit(
26
+ argv: list[str], code: int, out: str | None, capsys: pytest.CaptureFixture
27
+ ) -> None:
24
28
  sys.argv = argv
25
29
  with pytest.raises(SystemExit) as test:
26
30
  main()
@@ -30,7 +34,7 @@ def test_sys_exit(argv, code, out, capsys):
30
34
  assert captured.out == out
31
35
 
32
36
 
33
- def test_pre_commit(capsys):
37
+ def test_pre_commit(capsys: pytest.CaptureFixture) -> None:
34
38
  sys.argv = ["ppc", "--pre-commit"]
35
39
  main()
36
40
  captured = capsys.readouterr()
@@ -41,7 +45,7 @@ def test_pre_commit(capsys):
41
45
  assert f"v{__version__}" in captured.out
42
46
 
43
47
 
44
- def test_pyproject(capsys):
48
+ def test_pyproject(capsys: pytest.CaptureFixture) -> None:
45
49
  sys.argv = ["ppc", "--pyproject"]
46
50
  main()
47
51
  captured = capsys.readouterr()
@@ -0,0 +1,13 @@
1
+ from pathlib import Path
2
+
3
+ from pyproject_pre_commit import __version__
4
+
5
+
6
+ def test_version() -> None:
7
+ try:
8
+ import tomllib # ty: ignore[unresolved-import]
9
+ except ModuleNotFoundError:
10
+ import tomli as tomllib # ty: ignore[unresolved-import]
11
+ with (Path(__file__).parents[1] / "pyproject.toml").open("rb") as f:
12
+ version = tomllib.load(f)["project"]["version"]
13
+ assert version == __version__