From 79de84941a50eda7a6f0511cb0ce7a63776e4563 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 5 Feb 2024 11:53:21 +0200 Subject: [PATCH 1/6] setup.cfg: move mypy configuration from setup.cfg to pyproject.toml TOML is a nicer format than the INI format setup.cfg uses. --- pyproject.toml | 14 ++++++++++++++ setup.cfg | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e3d64805d..15a855ce6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -192,3 +192,17 @@ lines-after-imports = 2 "src/_pytest/_py/**/*.py" = ["B", "PYI"] "src/_pytest/_version.py" = ["I001"] "testing/python/approx.py" = ["B015"] + +[tool.mypy] +mypy_path = ["src"] +check_untyped_defs = true +disallow_any_generics = true +disallow_untyped_defs = true +ignore_missing_imports = true +show_error_codes = true +strict_equality = true +warn_redundant_casts = true +warn_return_any = true +warn_unreachable = true +warn_unused_configs = true +no_implicit_reexport = true diff --git a/setup.cfg b/setup.cfg index eebce8c7c..a9943cef1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -89,17 +89,3 @@ ignore = [devpi:upload] formats = sdist.tgz,bdist_wheel - -[mypy] -mypy_path = src -check_untyped_defs = True -disallow_any_generics = True -disallow_untyped_defs = True -ignore_missing_imports = True -show_error_codes = True -strict_equality = True -warn_redundant_casts = True -warn_return_any = True -warn_unreachable = True -warn_unused_configs = True -no_implicit_reexport = True From 2fc7926bae8774f1a929752525b6ec1b95ea15e5 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 5 Feb 2024 11:55:38 +0200 Subject: [PATCH 2/6] setup.cfg: remove `[build_sphinx]` section Legacy thing that is no longer needed. --- setup.cfg | 5 ----- 1 file changed, 5 deletions(-) diff --git a/setup.cfg b/setup.cfg index a9943cef1..6ceb968f7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -78,11 +78,6 @@ testing = _pytest = py.typed pytest = py.typed -[build_sphinx] -source_dir = doc/en/ -build_dir = doc/build -all_files = 1 - [check-manifest] ignore = src/_pytest/_version.py From 5c67cb2cf57e50680ebdc5591b38dc2ab23834e4 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 5 Feb 2024 11:58:56 +0200 Subject: [PATCH 3/6] setup.cfg: remove `[check-manifest]` section Not used since 731c35fcabef1e145e8049e1bf565a7c18ca328d. --- setup.cfg | 4 ---- 1 file changed, 4 deletions(-) diff --git a/setup.cfg b/setup.cfg index 6ceb968f7..df8e177ca 100644 --- a/setup.cfg +++ b/setup.cfg @@ -78,9 +78,5 @@ testing = _pytest = py.typed pytest = py.typed -[check-manifest] -ignore = - src/_pytest/_version.py - [devpi:upload] formats = sdist.tgz,bdist_wheel From cd9b2410472076652499512567ea40815f67654a Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 5 Feb 2024 12:08:21 +0200 Subject: [PATCH 4/6] setup.cfg: remove `[devpi:upload]` section Not needed since bfe2cbe875f81bd8e333796d2594a9cd36806374. --- setup.cfg | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index df8e177ca..ebc956347 100644 --- a/setup.cfg +++ b/setup.cfg @@ -77,6 +77,3 @@ testing = [options.package_data] _pytest = py.typed pytest = py.typed - -[devpi:upload] -formats = sdist.tgz,bdist_wheel From ccbae95ad4fd69b0b006272aa3cc65090bdb674d Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 5 Feb 2024 12:16:52 +0200 Subject: [PATCH 5/6] setup.cfg: remove redundant `packages`/`py_modules` The `package_dir` already achieves this. --- setup.cfg | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/setup.cfg b/setup.cfg index ebc956347..354f9418c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,16 +33,6 @@ project_urls = Tracker=https://github.com/pytest-dev/pytest/issues [options] -packages = - _pytest - _pytest._code - _pytest._io - _pytest._py - _pytest.assertion - _pytest.config - _pytest.mark - pytest -py_modules = py install_requires = iniconfig packaging From 90634a6060a21e8e8209ed96dc032e4a4258eabe Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 5 Feb 2024 12:20:37 +0200 Subject: [PATCH 6/6] setup.cfg: remove `zip_safe` The setuptools docs say it's obsolete and no longer needed: https://setuptools.pypa.io/en/latest/deprecated/zip_safe.html#understanding-the-zip-safe-flag --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 354f9418c..a1a47e1ba 100644 --- a/setup.cfg +++ b/setup.cfg @@ -46,7 +46,6 @@ package_dir = setup_requires = setuptools setuptools-scm>=6.0 -zip_safe = no [options.entry_points] console_scripts =