pyproject-pre-commit 0.4.2__tar.gz → 0.5.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.
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/.github/workflows/pypi.yml +3 -3
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/.github/workflows/test.yml +5 -2
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/.pre-commit-config.yaml +7 -8
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/.pre-commit-hooks.yaml +0 -9
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/PKG-INFO +4 -26
- pyproject_pre_commit-0.5.0/pyproject.toml +186 -0
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/src/pyproject_pre_commit/__init__.py +1 -1
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/tests/test_pyproject_pre_commit.py +8 -4
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/tests/test_version.py +2 -2
- pyproject_pre_commit-0.5.0/uv.lock +2635 -0
- pyproject_pre_commit-0.4.2/pyproject.toml +0 -233
- pyproject_pre_commit-0.4.2/uv.lock +0 -1936
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/.github/FUNDING.yml +0 -0
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/.gitignore +0 -0
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/.mise.toml +0 -0
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/LICENSE +0 -0
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/README.md +0 -0
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/renovate.json +0 -0
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/src/pyproject_pre_commit/__version__.py +0 -0
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/src/pyproject_pre_commit/py.typed +0 -0
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/src/pyproject_pre_commit/pyproject_pre_commit.py +0 -0
- {pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/tests/__init__.py +0 -0
|
@@ -16,7 +16,7 @@ jobs:
|
|
|
16
16
|
permissions:
|
|
17
17
|
contents: write
|
|
18
18
|
steps:
|
|
19
|
-
- uses: actions/checkout@
|
|
19
|
+
- uses: actions/checkout@v6
|
|
20
20
|
with:
|
|
21
21
|
ref: main
|
|
22
22
|
- name: Compare to the last tag
|
|
@@ -70,10 +70,10 @@ jobs:
|
|
|
70
70
|
with:
|
|
71
71
|
github_token: ${{ github.token }}
|
|
72
72
|
tags: true
|
|
73
|
-
- uses: actions/setup-python@
|
|
73
|
+
- uses: actions/setup-python@v6
|
|
74
74
|
if: ${{ steps.check.outputs.flag == 1 }}
|
|
75
75
|
with:
|
|
76
|
-
python-version: "3.
|
|
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.
|
|
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 }}
|
|
@@ -196,21 +196,14 @@ repos:
|
|
|
196
196
|
entry: mdformat
|
|
197
197
|
language: system
|
|
198
198
|
types: [markdown]
|
|
199
|
-
- id: actionlint
|
|
200
|
-
name: actionlint
|
|
201
|
-
entry: actionlint
|
|
202
|
-
language: system
|
|
203
|
-
types: [yaml]
|
|
204
|
-
files: "^.github/workflows/"
|
|
205
199
|
- id: validate-pyproject
|
|
206
200
|
name: validate-pyproject
|
|
207
201
|
entry: validate-pyproject
|
|
208
202
|
language: system
|
|
209
203
|
files: ^pyproject.toml$
|
|
210
204
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
211
|
-
rev:
|
|
205
|
+
rev: v6.0.0
|
|
212
206
|
hooks:
|
|
213
|
-
- id: check-byte-order-marker
|
|
214
207
|
- id: check-yaml
|
|
215
208
|
- id: check-json
|
|
216
209
|
- id: check-toml
|
|
@@ -227,3 +220,9 @@ repos:
|
|
|
227
220
|
- id: detect-aws-credentials
|
|
228
221
|
args:
|
|
229
222
|
- "--allow-missing-credentials"
|
|
223
|
+
- repo: https://github.com/rhysd/actionlint
|
|
224
|
+
rev: v1.7.8
|
|
225
|
+
hooks:
|
|
226
|
+
- id: actionlint
|
|
227
|
+
args:
|
|
228
|
+
- "-ignore=SC2129" # allow individual redirects ({} >> file is not allowed in GitHub Actions' run)
|
|
@@ -267,15 +267,6 @@
|
|
|
267
267
|
language: system
|
|
268
268
|
types: [markdown]
|
|
269
269
|
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
270
|
- id: validate-pyproject
|
|
280
271
|
# https://github.com/abravalheri/validate-pyproject
|
|
281
272
|
name: validate-pyproject
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyproject-pre-commit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
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:
|
|
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,7 +58,6 @@ 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'
|
|
84
62
|
Description-Content-Type: text/markdown
|
|
85
63
|
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "pyproject-pre-commit"
|
|
3
|
+
version = "0.5.0"
|
|
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
|
+
|
|
75
|
+
[dependency-groups]
|
|
76
|
+
dev = [
|
|
77
|
+
"pytest>=8.0.0",
|
|
78
|
+
"pytest-cov>=6.0.0",
|
|
79
|
+
"pytest-xdist>=3.3.1",
|
|
80
|
+
"mdformat-ruff>=0.1.3",
|
|
81
|
+
]
|
|
82
|
+
ruff = [
|
|
83
|
+
"pyproject-pre-commit[ruff]",
|
|
84
|
+
]
|
|
85
|
+
black = [
|
|
86
|
+
"pyproject-pre-commit[black]",
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
[project.scripts]
|
|
90
|
+
ppc = "pyproject_pre_commit:main"
|
|
91
|
+
|
|
92
|
+
[build-system]
|
|
93
|
+
requires = ["hatchling"]
|
|
94
|
+
build-backend = "hatchling.build"
|
|
95
|
+
|
|
96
|
+
[tool.uv]
|
|
97
|
+
default-groups = ["dev", "ruff", "black"]
|
|
98
|
+
|
|
99
|
+
[tool.pytest.ini_options]
|
|
100
|
+
addopts = "-n auto"
|
|
101
|
+
testpaths = ["tests",]
|
|
102
|
+
|
|
103
|
+
[tool.ruff]
|
|
104
|
+
line-length = 79
|
|
105
|
+
|
|
106
|
+
[tool.ruff.lint]
|
|
107
|
+
select = ["ALL"]
|
|
108
|
+
|
|
109
|
+
ignore = [
|
|
110
|
+
"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)
|
|
111
|
+
"E501", # Line too long. Disable it to allow long lines of comments and print lines which black allows.
|
|
112
|
+
"D100", "D102", "D103", "D104", "D105", "D106", # Missing docstrings other than class (D101)
|
|
113
|
+
"D401", # First line should be in imperative mood
|
|
114
|
+
"D211", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.
|
|
115
|
+
"D213", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`.
|
|
116
|
+
"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.
|
|
117
|
+
"FBT001", # Boolean-typed positional argument in function definition
|
|
118
|
+
"FBT002", # Boolean default positional argument in function definition
|
|
119
|
+
"FBT003", # Boolean positional value in function call
|
|
120
|
+
"TID252", # Prefer absolute imports over relative imports from parent modules
|
|
121
|
+
"PLC0415", # `import` should be at the top-level of a file
|
|
122
|
+
"PLR2004", # Magic value used in comparison
|
|
123
|
+
]
|
|
124
|
+
|
|
125
|
+
[tool.ruff.lint.per-file-ignores]
|
|
126
|
+
"tests/**" = ["S101"]
|
|
127
|
+
|
|
128
|
+
[tool.ruff.lint.mccabe]
|
|
129
|
+
max-complexity = 10
|
|
130
|
+
|
|
131
|
+
[tool.ruff.format]
|
|
132
|
+
# quote-style = "single"
|
|
133
|
+
docstring-code-format = true
|
|
134
|
+
|
|
135
|
+
[tool.black]
|
|
136
|
+
line-length = 79
|
|
137
|
+
|
|
138
|
+
[tool.autoflake]
|
|
139
|
+
remove-all-unused-imports = true
|
|
140
|
+
expand-star-imports = true
|
|
141
|
+
remove-duplicate-keys = true
|
|
142
|
+
remove-unused-variables = true
|
|
143
|
+
|
|
144
|
+
[tool.autopep8]
|
|
145
|
+
ignore = "E203,E501,W503"
|
|
146
|
+
recursive = true
|
|
147
|
+
aggressive = 3
|
|
148
|
+
|
|
149
|
+
[tool.isort]
|
|
150
|
+
profile = "black"
|
|
151
|
+
line_length = 79
|
|
152
|
+
|
|
153
|
+
[tool.flake8]
|
|
154
|
+
# 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)
|
|
155
|
+
# E501: Line too long. Disable it to allow long lines of comments and print lines which black allows.
|
|
156
|
+
# E704: multiple statements on one line (def). This is inconsistent with black >= 24.1.1 (see ttps://github.com/psf/black/pull/3796)
|
|
157
|
+
# 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)
|
|
158
|
+
# D100~D106: Missing docstrings other than class (D101)
|
|
159
|
+
# D401: First line should be in imperative mood
|
|
160
|
+
ignore = "E203,E501,E704,W503,D100,D102,D103,D104,D105,D106,D401"
|
|
161
|
+
max-complexity = 10
|
|
162
|
+
docstring-convention = "numpy"
|
|
163
|
+
|
|
164
|
+
[tool.bandit]
|
|
165
|
+
exclude_dirs = ["tests"]
|
|
166
|
+
|
|
167
|
+
[tool.mypy]
|
|
168
|
+
files = ["src/**/*.py"]
|
|
169
|
+
strict = true
|
|
170
|
+
warn_return_any = false
|
|
171
|
+
ignore_missing_imports = true
|
|
172
|
+
scripts_are_modules = true
|
|
173
|
+
install_types = true
|
|
174
|
+
non_interactive = true
|
|
175
|
+
|
|
176
|
+
[tool.numpydoc_validation]
|
|
177
|
+
checks = [
|
|
178
|
+
"all", # report on all checks, except the below
|
|
179
|
+
"EX01", # "No examples section found"
|
|
180
|
+
"ES01", # "No extended summary found"
|
|
181
|
+
"SA01", # "See Also section not found"
|
|
182
|
+
"GL08", # "The object does not have a docstring"
|
|
183
|
+
"PR01", # "Parameters {missing_params} not documented"
|
|
184
|
+
"PR02", # "Unknown parameters {unknown_params}"
|
|
185
|
+
"RT01", # "No Returns section found"
|
|
186
|
+
]
|
{pyproject_pre_commit-0.4.2 → pyproject_pre_commit-0.5.0}/tests/test_pyproject_pre_commit.py
RENAMED
|
@@ -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(
|
|
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()
|
|
@@ -3,11 +3,11 @@ from pathlib import Path
|
|
|
3
3
|
from pyproject_pre_commit import __version__
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
def test_version():
|
|
6
|
+
def test_version() -> None:
|
|
7
7
|
try:
|
|
8
8
|
import tomllib
|
|
9
9
|
except ModuleNotFoundError:
|
|
10
10
|
import tomli as tomllib
|
|
11
|
-
with
|
|
11
|
+
with (Path(__file__).parents[1] / "pyproject.toml").open("rb") as f:
|
|
12
12
|
version = tomllib.load(f)["project"]["version"]
|
|
13
13
|
assert version == __version__
|