diff --git a/.travis.yml b/.travis.yml index 2dce8b3..e20ae1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,11 @@ python: - "3.6" - "3.7" - "3.8" + - "pypy3" install: - pip install -r requirements.txt - pip install -e .[test] script: - - pytest --cov=aiosonic + - python travis_tests.py after_success: coveralls diff --git a/README.md b/README.md index 1a8f447..0ed379f 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ You can perform this test by installing all test dependencies with `pip install # Requirements: * Python>=3.6 +* PyPy>=3.6 # Features: 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..cf96bf5 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'" ) @@ -62,11 +66,13 @@ def _map_func(dependency): classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', - 'Topic :: Software Development', + 'Topic :: Internet :: WWW/HTTP', + 'Operating System :: OS Independent', 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + "Programming Language :: Python :: Implementation :: PyPy", ], setup_requires=['pytest-runner'], install_requires=requirements('./requirements.txt'), @@ -76,6 +82,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, } ) } diff --git a/travis_tests.py b/travis_tests.py new file mode 100755 index 0000000..aaea14b --- /dev/null +++ b/travis_tests.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python + +import subprocess +import platform +import sys + +command = 'pytest --cov=aiosonic --doctest-modules' +if platform.python_implementation() != 'PyPy': + command += ' --mypy --mypy-ignore-missing-imports' +sys.exit(subprocess.call(command, shell=True))