Skip to content

Commit

Permalink
Merge 3da2a7b into b0cb7be
Browse files Browse the repository at this point in the history
  • Loading branch information
sonic182 committed Jan 26, 2021
2 parents b0cb7be + 3da2a7b commit baa4883
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 13 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
)


Expand Down Expand Up @@ -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'),
Expand All @@ -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,
}
)
}
Expand Down
10 changes: 10 additions & 0 deletions travis_tests.py
Original file line number Diff line number Diff line change
@@ -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))

0 comments on commit baa4883

Please sign in to comment.