From a1d99e4bdd6effa2f2c9a50a2f4712e7fe1823d2 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 5 Feb 2024 13:56:07 +0100 Subject: [PATCH 1/5] [pyproject.toml] Move information from setup.cfg to pyproject.toml --- .pre-commit-config.yaml | 5 ----- pyproject.toml | 50 +++++++++++++++++++++++++++++++++++++++++ setup.cfg | 31 ------------------------- 3 files changed, 50 insertions(+), 36 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 032fe8c4d..ca3b41d58 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,11 +21,6 @@ repos: hooks: - id: blacken-docs additional_dependencies: [black==24.1.1] -- repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.5.0 - hooks: - - id: setup-cfg-fmt - args: ["--max-py-version=3.12", "--include-version-classifiers"] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index 15a855ce6..6e3d3612a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,53 @@ +[project] + +name = "pytest" +dynamic = [ + "version", + "optional-dependencies", + "dependencies", + "scripts", + "requires-python" +] +description = "pytest: simple powerful testing with Python" +authors = [ + {name = "Holger Krekel"}, + {name = "Bruno Oliveira"}, + {name = "Ronny Pfannschmidt"}, + {name = "Floris Bruynooghe"}, + {name = "Brianna Laugher"}, + {name = "Florian Bruhin"}, + {name = "Others (See AUTHORS)"}, +] +readme = "README.rst" +license = {text = "MIT"} +keywords = ["test", "unittest"] +classifiers = [ + "Development Status :: 6 - Mature", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: Unix", + "Operating System :: POSIX", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Testing", + "Topic :: Utilities", +] + +[project.urls] +Homepage = "https://docs.pytest.org/en/latest/" +Changelog = "https://docs.pytest.org/en/stable/changelog.html" +Twitter = "https://twitter.com/pytestdotorg" +Source = "https://github.com/pytest-dev/pytest" +Tracker = "https://github.com/pytest-dev/pytest/issues" + [build-system] requires = [ "setuptools>=45.0", diff --git a/setup.cfg b/setup.cfg index a1a47e1ba..bf981840b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,36 +1,5 @@ [metadata] -name = pytest -description = pytest: simple powerful testing with Python -long_description = file: README.rst -long_description_content_type = text/x-rst -url = https://docs.pytest.org/en/latest/ -author = Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Florian Bruhin and others -license = MIT -license_files = LICENSE platforms = unix, linux, osx, cygwin, win32 -classifiers = - Development Status :: 6 - Mature - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Operating System :: MacOS :: MacOS X - Operating System :: Microsoft :: Windows - Operating System :: POSIX - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Topic :: Software Development :: Libraries - Topic :: Software Development :: Testing - Topic :: Utilities -keywords = test, unittest -project_urls = - Changelog=https://docs.pytest.org/en/stable/changelog.html - Twitter=https://twitter.com/pytestdotorg - Source=https://github.com/pytest-dev/pytest - Tracker=https://github.com/pytest-dev/pytest/issues [options] install_requires = From c3583dee0b274af84b56e70f270d3a42d0ce2463 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 5 Feb 2024 14:02:06 +0100 Subject: [PATCH 2/5] [pyproject.toml] Translate 'metadata:platforms' to pyproject.toml --- setup.cfg | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index bf981840b..8707c6180 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,3 @@ -[metadata] -platforms = unix, linux, osx, cygwin, win32 - [options] install_requires = iniconfig From 411c2cbf9d8f1e18aa4b7e53ff3d60790beacf1d Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 5 Feb 2024 14:20:10 +0100 Subject: [PATCH 3/5] [pyproject.toml] Translate dynamic option to pyproject.toml --- pyproject.toml | 35 +++++++++++++++++++++++++++-------- setup.cfg | 24 ------------------------ 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6e3d3612a..38a9471e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,6 @@ [project] - name = "pytest" -dynamic = [ - "version", - "optional-dependencies", - "dependencies", - "scripts", - "requires-python" -] +dynamic = ["version"] description = "pytest: simple powerful testing with Python" authors = [ {name = "Holger Krekel"}, @@ -41,6 +34,32 @@ classifiers = [ "Topic :: Utilities", ] +dependencies = [ + "colorama;sys_platform=='win32'", + "exceptiongroup>=1.0.0rc8;python_version<'3.11'", + "iniconfig", + "packaging", + "pluggy>=1.4.0,<2.0", + "tomli>=1.0.0;python_version<'3.11'", +] +requires-python = ">=3.8" + +[project.optional-dependencies] +testing = [ + "argcomplete", + "attrs>=19.2.0", + "hypothesis>=3.56", + "mock", + "pygments>=2.7.2", + "requests", + "setuptools", + "xmlschema", +] + +[project.scripts] +"py.test" = "pytest:console_main" +pytest = "pytest:console_main" + [project.urls] Homepage = "https://docs.pytest.org/en/latest/" Changelog = "https://docs.pytest.org/en/stable/changelog.html" diff --git a/setup.cfg b/setup.cfg index 8707c6180..364db8d70 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,34 +1,10 @@ [options] -install_requires = - iniconfig - packaging - pluggy>=1.4.0,<2.0 - colorama;sys_platform=="win32" - exceptiongroup>=1.0.0rc8;python_version<"3.11" - tomli>=1.0.0;python_version<"3.11" -python_requires = >=3.8 package_dir = =src setup_requires = setuptools setuptools-scm>=6.0 -[options.entry_points] -console_scripts = - pytest=pytest:console_main - py.test=pytest:console_main - -[options.extras_require] -testing = - argcomplete - attrs>=19.2.0 - hypothesis>=3.56 - mock - pygments>=2.7.2 - requests - setuptools - xmlschema - [options.package_data] _pytest = py.typed pytest = py.typed From dab1583ce1ad9c08b64fefc632c9e3d900d4c3dd Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 5 Feb 2024 15:27:53 +0100 Subject: [PATCH 4/5] [pyproject.toml] Remove setup_requires / package_dir in setup.cfg already exists --- setup.cfg | 7 ------- 1 file changed, 7 deletions(-) diff --git a/setup.cfg b/setup.cfg index 364db8d70..3e72c56d7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,10 +1,3 @@ -[options] -package_dir = - =src -setup_requires = - setuptools - setuptools-scm>=6.0 - [options.package_data] _pytest = py.typed pytest = py.typed From c76ea72331f6c45e248b92be8233188ecd2347b7 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 5 Feb 2024 15:33:27 +0100 Subject: [PATCH 5/5] [pyproject.toml] Moving 'package_data' (py.typed) from setup.cfg --- pyproject.toml | 4 ++++ setup.cfg | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index 38a9471e0..427de749a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,6 +74,10 @@ requires = [ ] build-backend = "setuptools.build_meta" +[tool.setuptools.package-data] +"_pytest" = ["py.typed"] +"pytest" = ["py.typed"] + [tool.setuptools_scm] write_to = "src/_pytest/_version.py" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 3e72c56d7..000000000 --- a/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[options.package_data] -_pytest = py.typed -pytest = py.typed