Skip to content

Commit ea05f53

Browse files
committed
Add pyproject-fmt pre-commit hook
Reformats pyproject.toml: sorts keys, normalises array style, flattens sub-tables, removes redundant classifiers (Programming Language :: Python :: 3 is implied by 3 :: Only, 3.15 is not yet a valid PyPI classifier).
1 parent a28e473 commit ea05f53

File tree

2 files changed

+48
-52
lines changed

2 files changed

+48
-52
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ repos:
55
- id: ruff-check
66
args: [--fix]
77
- id: ruff-format
8+
- repo: https://github.com/pytest-dev/pyproject-fmt
9+
rev: "v2.12.1"
10+
hooks:
11+
- id: pyproject-fmt
12+
# https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version
13+
additional_dependencies: ["tox>=4.9"]
814
- repo: https://github.com/pre-commit/pre-commit-hooks
915
rev: v6.0.0
1016
hooks:

pyproject.toml

Lines changed: 42 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,62 @@
11
[build-system]
2-
requires = ["setuptools>=77"]
32
build-backend = "setuptools.build_meta"
3+
requires = [ "setuptools>=77" ]
44

55
[project]
66
name = "unittest2pytest"
7-
authors = [{name = "Hartmut Goebel", email = "h.goebel@crazy-compilers.com"}]
8-
license = "GPL-3.0-or-later"
9-
license-files = ["COPYING-GPLv3.txt", "AUTHORS.txt"]
107
description = "Convert unittest test-cases to pytest"
8+
license = "GPL-3.0-or-later"
9+
license-files = [ "COPYING-GPLv3.txt", "AUTHORS.txt" ]
10+
authors = [ { name = "Hartmut Goebel", email = "h.goebel@crazy-compilers.com" } ]
11+
requires-python = ">=3.9"
1112
classifiers = [
12-
"Development Status :: 4 - Beta",
13-
"Environment :: Console",
14-
"Intended Audience :: Developers",
15-
"Operating System :: OS Independent",
16-
"Programming Language :: Python",
17-
"Programming Language :: Python :: 3",
18-
"Programming Language :: Python :: 3 :: Only",
19-
"Programming Language :: Python :: 3.9",
20-
"Programming Language :: Python :: 3.10",
21-
"Programming Language :: Python :: 3.11",
22-
"Programming Language :: Python :: 3.12",
23-
"Programming Language :: Python :: 3.13",
24-
"Programming Language :: Python :: 3.14",
25-
"Programming Language :: Python :: 3.15",
26-
"Topic :: Software Development",
27-
"Topic :: Utilities",
13+
"Development Status :: 4 - Beta",
14+
"Environment :: Console",
15+
"Intended Audience :: Developers",
16+
"Operating System :: OS Independent",
17+
"Programming Language :: Python",
18+
"Programming Language :: Python :: 3 :: Only",
19+
"Programming Language :: Python :: 3.9",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12",
23+
"Programming Language :: Python :: 3.13",
24+
"Programming Language :: Python :: 3.14",
25+
"Programming Language :: Python :: 3.15",
26+
"Topic :: Software Development",
27+
"Topic :: Utilities",
2828
]
29-
dynamic = ["readme", "version"]
30-
requires-python = ">=3.9"
31-
dependencies = ["fissix"]
32-
33-
[project.urls]
34-
Homepage = "https://github.com/pytest-dev/unittest2pytest"
35-
36-
[project.scripts]
37-
unittest2pytest = "unittest2pytest.__main__:main"
29+
dynamic = [ "readme", "version" ]
30+
dependencies = [ "fissix" ]
31+
urls.Homepage = "https://github.com/pytest-dev/unittest2pytest"
32+
scripts.unittest2pytest = "unittest2pytest.__main__:main"
3833

3934
[tool.setuptools]
40-
packages = ["unittest2pytest", "unittest2pytest.fixes"]
35+
packages = [ "unittest2pytest", "unittest2pytest.fixes" ]
4136
zip-safe = false
4237
include-package-data = false
38+
dynamic.readme = { file = [ "README.rst", "NEWLINE.rst", "CHANGELOG.rst" ], content-type = "text/x-rst" }
39+
dynamic.version = { attr = "unittest2pytest.__version__" }
4340

44-
[tool.setuptools.dynamic]
45-
readme = {file = ["README.rst", "NEWLINE.rst", "CHANGELOG.rst"], content-type = "text/x-rst"}
46-
version = {attr = "unittest2pytest.__version__"}
41+
[tool.ruff]
42+
target-version = "py39"
43+
extend-exclude = [ "tests/fixtures" ]
44+
lint.select = [ "E", "F", "I", "UP", "W" ]
45+
lint.ignore = [ "E501", "E701", "E741", "UP031" ]
46+
lint.per-file-ignores."unittest2pytest/fixes/fix_remove_class.py" = [ "W291" ]
47+
lint.per-file-ignores."unittest2pytest/fixes/fix_self_assert.py" = [ "F841" ]
48+
49+
[tool.pyproject-fmt]
50+
max_supported_python = "3.15"
51+
52+
[tool.tox]
53+
env_list = [ "py39", "py310", "py311", "py312", "py313", "py314", "py315" ]
54+
env_run_base.deps = [ "pytest" ]
55+
env_run_base.commands = [ [ "pytest", "{posargs}" ] ]
4756

4857
[tool.zest-releaser]
4958
python-file-with-version = "unittest2pytest/__init__.py"
5059
push-changes = false
5160
tag-format = "v{version}"
5261
tag-message = "unittest2pytest {version}"
5362
tag-signing = true
54-
55-
[tool.ruff]
56-
target-version = "py39"
57-
extend-exclude = ["tests/fixtures"]
58-
59-
[tool.ruff.lint]
60-
select = ["E", "F", "I", "W", "UP"]
61-
ignore = ["E501", "E701", "E741", "UP031"]
62-
63-
[tool.ruff.lint.per-file-ignores]
64-
"unittest2pytest/fixes/fix_remove_class.py" = ["W291"]
65-
"unittest2pytest/fixes/fix_self_assert.py" = ["F841"]
66-
67-
[tool.tox]
68-
env_list = ["py39", "py310", "py311", "py312", "py313", "py314", "py315"]
69-
70-
[tool.tox.env_run_base]
71-
deps = ["pytest"]
72-
commands = [["pytest", "{posargs}"]]

0 commit comments

Comments
 (0)