From 03b2deee8242115fadbf6859cbb365d70fbcfed5 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 6 Apr 2026 16:18:34 +0000 Subject: [PATCH 1/2] Add pyproject-fmt pre-commit hook Following pytest's pre-commit config. Uses pytest-dev/pyproject-fmt with tox>=4.9 for computing max supported Python version. Adds [tool.pyproject-fmt] max_supported_python = "3.15" to preserve the 3.15 classifier. Removes redundant 'Programming Language :: Python :: 3' classifier (implied by '3 :: Only'). --- .pre-commit-config.yaml | 6 +++ pyproject.toml | 94 ++++++++++++++++++----------------------- 2 files changed, 48 insertions(+), 52 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 542a828..c861842 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,12 @@ repos: - id: ruff-check args: [--fix] - id: ruff-format + - repo: https://github.com/pytest-dev/pyproject-fmt + rev: "v2.12.1" + hooks: + - id: pyproject-fmt + # https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version + additional_dependencies: ["tox>=4.9"] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index 30bacbb..3c73a98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,49 +1,58 @@ [build-system] -requires = ["setuptools>=77"] build-backend = "setuptools.build_meta" +requires = [ "setuptools>=77" ] [project] name = "unittest2pytest" -authors = [{name = "Hartmut Goebel", email = "h.goebel@crazy-compilers.com"}] -license = "GPL-3.0-or-later" -license-files = ["COPYING-GPLv3.txt", "AUTHORS.txt"] description = "Convert unittest test-cases to pytest" +license = "GPL-3.0-or-later" +license-files = [ "COPYING-GPLv3.txt", "AUTHORS.txt" ] +authors = [ { name = "Hartmut Goebel", email = "h.goebel@crazy-compilers.com" } ] +requires-python = ">=3.9" classifiers = [ - "Development Status :: 4 - Beta", - "Environment :: Console", - "Intended Audience :: Developers", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3.14", - "Programming Language :: Python :: 3.15", - "Topic :: Software Development", - "Topic :: Utilities", + "Development Status :: 4 - Beta", + "Environment :: Console", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", + "Topic :: Software Development", + "Topic :: Utilities", ] -dynamic = ["readme", "version"] -requires-python = ">=3.9" -dependencies = ["fissix"] - -[project.urls] -Homepage = "https://github.com/pytest-dev/unittest2pytest" - -[project.scripts] -unittest2pytest = "unittest2pytest.__main__:main" +dynamic = [ "readme", "version" ] +dependencies = [ "fissix" ] +urls.Homepage = "https://github.com/pytest-dev/unittest2pytest" +scripts.unittest2pytest = "unittest2pytest.__main__:main" [tool.setuptools] -packages = ["unittest2pytest", "unittest2pytest.fixes"] +packages = [ "unittest2pytest", "unittest2pytest.fixes" ] zip-safe = false include-package-data = false +dynamic.readme = { file = [ "README.rst", "NEWLINE.rst", "CHANGELOG.rst" ], content-type = "text/x-rst" } +dynamic.version = { attr = "unittest2pytest.__version__" } -[tool.setuptools.dynamic] -readme = {file = ["README.rst", "NEWLINE.rst", "CHANGELOG.rst"], content-type = "text/x-rst"} -version = {attr = "unittest2pytest.__version__"} +[tool.ruff] +target-version = "py39" +extend-exclude = [ "tests/fixtures" ] +lint.select = [ "E", "F", "I", "UP", "W" ] +lint.ignore = [ "E501", "E701", "E741", "UP031" ] +lint.per-file-ignores."unittest2pytest/fixes/fix_remove_class.py" = [ "W291" ] +lint.per-file-ignores."unittest2pytest/fixes/fix_self_assert.py" = [ "F841" ] + +[tool.pyproject-fmt] +max_supported_python = "3.15" + +[tool.tox] +env_list = [ "py39", "py310", "py311", "py312", "py313", "py314", "py315" ] +env_run_base.deps = [ "pytest" ] +env_run_base.commands = [ [ "pytest", "{posargs}" ] ] [tool.zest-releaser] python-file-with-version = "unittest2pytest/__init__.py" @@ -51,22 +60,3 @@ push-changes = false tag-format = "v{version}" tag-message = "unittest2pytest {version}" tag-signing = true - -[tool.ruff] -target-version = "py39" -extend-exclude = ["tests/fixtures"] - -[tool.ruff.lint] -select = ["E", "F", "I", "W", "UP"] -ignore = ["E501", "E701", "E741", "UP031"] - -[tool.ruff.lint.per-file-ignores] -"unittest2pytest/fixes/fix_remove_class.py" = ["W291"] -"unittest2pytest/fixes/fix_self_assert.py" = ["F841"] - -[tool.tox] -env_list = ["py39", "py310", "py311", "py312", "py313", "py314", "py315"] - -[tool.tox.env_run_base] -deps = ["pytest"] -commands = [["pytest", "{posargs}"]] From b9737cbf37ef72444116bc8b79f3c49e92890586 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 16:24:14 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3c73a98..6a47b8d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ requires = [ "setuptools>=77" ] [project] name = "unittest2pytest" description = "Convert unittest test-cases to pytest" -license = "GPL-3.0-or-later" +license = "GPL-3.0-OR-later" license-files = [ "COPYING-GPLv3.txt", "AUTHORS.txt" ] authors = [ { name = "Hartmut Goebel", email = "h.goebel@crazy-compilers.com" } ] requires-python = ">=3.9"