From ccf99378f6feb32696e288f93e92eab8561421c8 Mon Sep 17 00:00:00 2001 From: boholder Date: Thu, 21 Mar 2024 15:06:40 +0800 Subject: [PATCH] chore: move tool configurations under setup.cfg to pyproject.toml, remove setup.cfg close #2703 --- pyproject.toml | 42 ++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 38 -------------------------------------- 2 files changed, 42 insertions(+), 38 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index 7b05d2af70..97e4d6a0cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -212,3 +212,45 @@ addopts = "-r aR" testpaths = [ "tests/", ] + +# https://github.com/codespell-project/codespell?tab=readme-ov-file#ignoring-words +[tool.codespell] +ignore-words-list = "ba,overriden,te" + +[tool.coverage.run] +branch = true +source = ["pdm/"] +omit = [ + "pdm/__main__.py", + "pdm/pep582/sitecustomize.py", + "pdm/models/in_process/*.py", + "pdm/models/setup.py", + "*/pdm-test-*-env/*", +] + +[tool.coverage.report] +# Regexes for lines to exclude from consideration +exclude_lines = [ + "pragma: no cover", + # Don't complain about missing debug-only code: + "def __repr__", + "if self.debug", + # Don't complain if tests don't hit defensive assertion code: + "raise AssertionError", + "raise NotImplementedError", + # Don't complain if non-runnable code isn't run: + "if __name__ == .__main__.:", + "if TYPE_CHECKING:", +] +ignore_errors = true + +[tool.mypy] +follow_imports = "silent" +ignore_missing_imports = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +disallow_untyped_decorators = true +exclude = "pdm/(pep582/|models/in_process/.+\\.py)" +namespace_packages = true +mypy_path = "src" +explicit_package_bases = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index f70ca2c3f8..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,38 +0,0 @@ -[codespell] -ignore-words-list = ba,overriden,te - -[coverage:run] -branch = true -source = pdm/ -omit = - pdm/__main__.py - pdm/pep582/sitecustomize.py - pdm/models/in_process/*.py - pdm/models/setup.py - */pdm-test-*-env/* - -[coverage:report] -# Regexes for lines to exclude from consideration -exclude_lines = - pragma: no cover - # Don't complain about missing debug-only code: - def __repr__ - if self.debug - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError - raise NotImplementedError - # Don't complain if non-runnable code isn't run: - if __name__ == .__main__.: - if TYPE_CHECKING: -ignore_errors = true - -[mypy] -follow_imports = silent -ignore_missing_imports = True -disallow_incomplete_defs = True -disallow_untyped_defs = True -disallow_untyped_decorators = True -exclude = pdm/(pep582/|models/in_process/.+\.py) -namespace_packages = True -mypy_path = src -explicit_package_bases = True