Skip to content

Commit

Permalink
Don't run mypy on pypy because it can't be installed
Browse files Browse the repository at this point in the history
See python/typed_ast#111 for more.
  • Loading branch information
spenczar committed May 20, 2020
1 parent bac6980 commit d198649
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion developer_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ twine
coverage
codecov
python-dateutil
mypy; python_version >= '3.5'
mypy; python_version >= '3.5' and implementation_name != "pypy"

# codec libraries (snappy is intentionally left off this list as it requires other system libraries to be installed and is non-trivial)
# Also don't install on windows for similar reasons
Expand Down
12 changes: 10 additions & 2 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@ echo "running flake8"
flake8 fastavro tests
flake8 --config=.flake8.cython fastavro

if [[ "$(python --version)" =~ "Python 3" ]]; then

RUN_MYPY=$(python -c `import sys
if sys.version_info[0] >= 3 and sys.implementation.name != "pypy":
sys.stdout.write("yes")
else:
sys.stdout.write("no")
`)
if [[ "$RUN_MYPY" -eq "yes" ]]; then
echo "running mypy"
mypy ./fastavro
else
echo "skipping mypy in Python 2"
echo "skipping mypy"
fi
check-manifest
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def version():
setup_requires += cpython_requires

tests_require = ['pytest', 'flake8', 'check-manifest']
if sys.version_info >= (3, 0):
if sys.version_info >= (3, 0) and sys.implementation.name != "pypy":
tests_require.append('mypy')

setup(
Expand Down

0 comments on commit d198649

Please sign in to comment.