From fbe5e24f519d43f8dad01a468c3a8c36a9c6fa2e Mon Sep 17 00:00:00 2001 From: Unrud Date: Sun, 3 Jul 2022 11:36:28 +0200 Subject: [PATCH] Skip mypy installation for pypy<3.9 --- setup.cfg | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 24d6c958..1bf92919 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,13 +13,18 @@ extras = deps = flake8 isort - mypy + # mypy installation fails with pypy<3.9 + mypy; implementation_name!='pypy' or python_version>='3.9' types-setuptools pytest-cov commands = flake8 . isort --check --diff . - mypy . + # Run mypy if it's installed + python -c 'import importlib.util, subprocess, sys; \ + importlib.util.find_spec("mypy") \ + and sys.exit(subprocess.run(["mypy", "."]).returncode) \ + or print("mypy is not installed")' pytest -r s --cov --cov-report=term --cov-report=xml . [tool:isort]