From fcfc78b7ee745bd2af78e5df9f04a0202c4cafb9 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Tue, 17 Aug 2021 01:43:02 -0700 Subject: [PATCH] Move tool config to pyproject --- pyproject.toml | 38 ++++++++++++++++++++++++++++++++++++++ setup.cfg | 45 +-------------------------------------------- 2 files changed, 39 insertions(+), 44 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8791923e..6a96810d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,3 +34,41 @@ exclude = ''' | src/ocrmypdf/lib/_leptonica.py )/ ''' + +[tool.coverage.run] +branch = true +parallel = true +concurrency = ["multiprocessing"] + +[tool.coverage.paths] +source = ["src/ocrmypdf"] + +[tool.coverage.report] +# Regexes for lines to exclude from consideration +exclude_lines = [ + # Have to re-enable the standard pragma + "pragma: no cover", + + # 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 0:", + "if False:", + "if __name__ == .__main__.:", + "if TYPE_CHECKING:" +] + +[tool.isort] +profile = "black" +known_first_party = "ocrmypdf" +known_third_party = ["PIL","_cffi_backend","cffi","flask","img2pdf","pdfminer","pikepdf","pkg_resources","pluggy","pytest","reportlab","setuptools","sphinx_rtd_theme","tqdm","watchdog","werkzeug"] + +[tool.pytest.ini_options] +minversion = "6.0" +norecursedirs = ["lib", ".pc", ".git", "venv", "output", "cache", "resources"] +testpaths = ["tests"] +addopts = "-n auto" +markers = ["slow"] +filterwarnings = ["ignore:.*XMLParser.*:DeprecationWarning"] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 277b577c..d0ecf331 100644 --- a/setup.cfg +++ b/setup.cfg @@ -72,6 +72,7 @@ where = src [options.extras_require] test = + coverage[toml] >= 5 pytest >= 6.0.0 pytest-xdist >= 2.2.0 pytest-cov >= 2.11.1 @@ -101,47 +102,3 @@ test = pytest [check-manifest] ignore = .github - -[tool:pytest] -norecursedirs = lib .pc .git output cache resources -testpaths = tests -filterwarnings = - ignore:.*XMLParser.*:DeprecationWarning -markers = - slow -addopts = - -n auto - -[isort] -multi_line_output = 3 -include_trailing_comma = True -force_grid_wrap = 0 -use_parentheses = True -line_length = 88 -known_first_party = ocrmypdf -known_third_party = PIL,_cffi_backend,cffi,flask,img2pdf,pdfminer,pikepdf,pkg_resources,pluggy,pytest,reportlab,setuptools,sphinx_rtd_theme,tqdm,watchdog,werkzeug - -[coverage:paths] -source = - src/ocrmypdf - -[coverage:run] -branch = true -parallel = true -concurrency = multiprocessing - -[coverage:report] -# Regexes for lines to exclude from consideration -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - - # 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 0: - if False: - if __name__ == .__main__.: - if TYPE_CHECKING: