diff --git a/pyproject.toml b/pyproject.toml index 2f21011..02f8a13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,54 @@ [build-system] requires = ["setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" + +[tool.pytest.ini_options] +minversion = "6.0" +testpaths = [".",] +log_cli = false +doctest_optionflags = ["ELLIPSIS", "NORMALIZE_WHITESPACE",] +addopts = "-ra -q -p no:warnings --ignore=svg2rlg_render_test.py" + +[tool.coverage.run] +branch = true +source = ["svg2rlg.py"] +plugins = ["coverage_python_version"] +omit = [ + "svg2rlg_render_test.py", + "test_svg2rlg.py", + "setup.py", + ".tox", +] +[tool.coverage.paths] +source = ["svg2rlg.py"] + +[tool.coverage.report] +fail_under = 50 +show_missing = true +ignore_errors = true +exclude_lines = [ + "pragma: no cover", + "raise NotImplementedError", + "raise AssertionError", + "if typing.TYPE_CHECKING:", + "if TYPE_CHECKING:", +] + +[tool.black] +line-length = 90 +skip-string-normalization = true +include = '\.py$' +exclude = ''' +/( + \.git + | \.hg + | \.mypy_cache + | \.tox + | \.venv + | _build + | buck-out + | build + | dist + | svg2rlg_render_test.py +)/ +''' diff --git a/setup.cfg b/setup.cfg index a215a44..d31f4d2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,3 +8,4 @@ with-coverage = 1 cover-package = svg2rlg #cover-min-percentage = 90 doctest-options = +ELLIPSIS,+NORMALIZE_WHITESPACE + diff --git a/tox.ini b/tox.ini index 9658880..9da5440 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,14 @@ [tox] -envlist = py3{6,7,8,9} +envlist = py3{8,9,10,11} skip_missing_interpreters = true isolated_build = true +skipsdist = true [gh-actions] -3.6 = py36 -3.7 = py37 3.8 = py38 3.9 = py39 +3.10 = py10 +3.11 = py11 [testenv] passenv = @@ -26,12 +27,14 @@ passenv = PIP_DOWNLOAD_CACHE deps = - reportlab - nose - codecov + reportlab[pycairo] + wxPython + pytest + pytest-cov + coverage_python_version commands = - nosetests -sx test_svg2rlg.py + python -m pytest -v . --capture=fd --doctest-modules --cov svg2rlg --cov-branch --cov-report term-missing [testenv:deploy] passenv = CI