From df564c1ced86f6b582f53a33295135d991b68d33 Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Tue, 19 Dec 2023 16:10:26 +0100 Subject: [PATCH] Add extra dependencies for test and typing and run mypy prior tests --- .github/workflows/tox.yml | 1 - mypy.ini | 1 + pyproject.toml | 9 +++++++++ tox.ini | 16 +++++----------- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 515094d..5c0458f 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -24,7 +24,6 @@ jobs: include: - tox_env: check-manifest - tox_env: lint - - tox_env: mypy - tox_env: py39 - tox_env: py310 - tox_env: py311 diff --git a/mypy.ini b/mypy.ini index 6b958c4..b63cb2d 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,4 +1,5 @@ [mypy] +files = pdfss show_error_codes = true [mypy-pdfminer.*] diff --git a/pyproject.toml b/pyproject.toml index 0fb5f2b..6939360 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,15 @@ dependencies = [ "pdfminer.six", ] +[project.optional-dependencies] +test = [ + "pytest", + "pytest-cov", +] +typing = [ + "mypy", +] + [project.urls] Source = "https://github.com/lowatt/pdfss" Tracker = "https://github.com/lowatt/pdfss/issues" diff --git a/tox.ini b/tox.ini index 0fa0c89..8d612ba 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,14 @@ [tox] isolated_build = true envlist = - check-manifest,lint,py3,mypy + check-manifest,lint,py3 [testenv] -deps = - pytest - pytest-cov +extras = + test + typing commands = + mypy {envpython} -m pytest {posargs:--cov pdfss --cov-report term --cov-fail-under 88} [testenv:lint] @@ -34,10 +35,3 @@ deps = check-manifest commands = {envpython} -m check_manifest {toxinidir} - - -[testenv:mypy] -deps = - mypy -commands = - {envpython} -m mypy pdfss