From 054544b943d1b17f5c5c8a2bcad1e5b90b74cc05 Mon Sep 17 00:00:00 2001 From: Johanderson Date: Tue, 26 Jan 2021 18:24:59 +0100 Subject: [PATCH] pypy support in travis tests --- .travis.yml | 2 +- azure-pipelines.yml | 2 +- pytest.ini | 2 +- setup.py | 10 +++++++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0232226..f714856 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,6 @@ install: - pip install -r requirements.txt - pip install -e .[test] script: - - pytest --cov=aiosonic + - pytest --cov=aiosonic --doctest-modules --mypy --mypy-ignore-missing-imports after_success: coveralls diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 883a3b9..6158583 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -59,7 +59,7 @@ steps: pip install --upgrade pip setuptools wheel pip install -r requirements.txt pip install -e ".[test]" - pytest --cov=aiosonic --doctest-modules --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html + pytest --cov=aiosonic --doctest-modules --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html --mypy --mypy-ignore-missing-imports timeoutInMinutes: 5 displayName: 'Run tests' diff --git a/pytest.ini b/pytest.ini index 7e6d572..4378af8 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,6 +3,6 @@ DJANGO_SETTINGS_MODULE = djangotestproj.djangotestproj.settings python_files = **/*.py testpaths = tests/ python_functions = test_* -addopts = --cov=aiosonic --cov-report term --cov-report html --mypy --mypy-ignore-missing-imports --doctest-modules +addopts = --cov=aiosonic --cov-report term --cov-report html --doctest-modules filterwarnings = ignore::UserWarning diff --git a/setup.py b/setup.py index 6633c0a..8e42aa2 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,11 @@ def version(): env_marker = ( "sys_platform != 'win32'" " and sys_platform != 'cygwin'" - " and platform_python_implementation != 'pypy'" + " and platform_python_implementation != 'PyPy'" +) + +pypy_marker = ( + "platform_python_implementation != 'PyPy'" ) @@ -76,6 +80,10 @@ def _map_func(dependency): { 'uvloop': ' ;' + env_marker, 'httptools': ' ;' + env_marker, + 'mypy': ' ;' + pypy_marker, + 'mypy-extensions': ' ;' + pypy_marker, + 'pytest-mypy': ' ;' + pypy_marker, + 'typed-ast': ' ;' + pypy_marker, } ) }