From a73bba72e755cf08fc88f9bce06ad989004bf18f Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Tue, 5 Dec 2023 16:09:32 -0500 Subject: [PATCH 1/2] Put mypy, coverage.py, pytest in pyproject Signed-off-by: William Woodruff --- .coveragerc | 14 -------------- mypy.ini | 24 ------------------------ pyproject.toml | 45 +++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 4 ---- 4 files changed, 45 insertions(+), 42 deletions(-) delete mode 100644 .coveragerc delete mode 100644 mypy.ini diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index e98950366..000000000 --- a/.coveragerc +++ /dev/null @@ -1,14 +0,0 @@ -[run] -branch = True -source = - OpenSSL - tests/ - -[paths] -source = - src/OpenSSL - .tox/*/lib/python*/site-packages/OpenSSL - .tox/pypy/site-packages/OpenSSL - -[report] -show_missing = True diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index 03f507024..000000000 --- a/mypy.ini +++ /dev/null @@ -1,24 +0,0 @@ -[mypy] -warn_unused_configs = True -follow_imports = skip -strict = True - -exclude = (?x)( - SSL\.py$ - ) - -[mypy-OpenSSL.crypto] -warn_return_any = False -disallow_any_expr = False - -[mypy-OpenSSL.rand] -warn_return_any = False - -[mypy-OpenSSL._util] -warn_return_any = False - -[mypy-cryptography.*] -ignore_missing_imports = True - -[mypy-cffi.*] -ignore_missing_imports = True diff --git a/pyproject.toml b/pyproject.toml index 1400fd5b9..293ac06cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,48 @@ +[tool.coverage.run] +branch = true +source = ["OpenSSL", "tests/"] + +[tool.coverage.paths] +source = [ + "src/OpenSSL", + ".tox/*/lib/python*/site-packages/OpenSSL", + ".tox/pypy/site-packages/OpenSSL", +] + +[tool.coverage.report] +show_missing = true + +[tool.mypy] +warn_unused_configs = true +follow_imports = "skip" +strict = true +exclude = ['SSL\.py$'] + +[[tool.mypy.overrides]] +module = "OpenSSL.crypto" +warn_return_any = false +disallow_any_expr = false + +[[tool.mypy.overrides]] +module = "OpenSSL.rand" +warn_return_any = false + +[[tool.mypy.overrides]] +module = "OpenSSL._util" +warn_return_any = false + +[[tool.mypy.overrides]] +module = "cryptography.*" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "cffi.*" +ignore_missing_imports = true + +[tool.pytest.ini_options] +addopts = "-r s --strict-markers" +testpaths = ["tests"] + [tool.ruff] select = ['E', 'F', 'I', 'W', 'UP', 'RUF'] line-length = 79 diff --git a/setup.cfg b/setup.cfg index c33dc2e3a..ba1663051 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,3 @@ -[tool:pytest] -addopts = "-r s --strict-markers" -testpaths = tests - [metadata] # Ensure LICENSE is included in wheels. license_file = LICENSE From 086cecc53701fbab8c2324960cc6b0e2f1cbf622 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Tue, 5 Dec 2023 17:12:13 -0500 Subject: [PATCH 2/2] tox: coverage[toml] Signed-off-by: William Woodruff --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index a53004034..d0543d6a0 100644 --- a/tox.ini +++ b/tox.ini @@ -71,7 +71,7 @@ commands = sphinx-build -W -b html doc doc/_build/html {posargs} [testenv:coverage-report] -deps = coverage>=4.2 +deps = coverage[toml]>=4.2 skip_install = true commands = coverage combine