ci: add mypy for my.hypothesis

This commit is contained in:
Dima Gerasimov 2020-09-29 18:32:34 +01:00 committed by karlicoss
parent 6199ed7916
commit 24fb983399
3 changed files with 16 additions and 2 deletions

View file

@ -3,6 +3,7 @@ Feel free to remove this if you don't need it/add your own custom settings and u
"""
class hypothesis:
from my.core import Paths
# expects outputs from https://github.com/karlicoss/hypexport
# (it's just the standard Hypothes.is export format)
export_path = '/path/to/hypothesis/data'
export_path: Paths = '/path/to/hypothesis/data'

View file

@ -53,6 +53,7 @@ def main():
'pytest',
'pylint',
'mypy',
'lxml', # for mypy coverage
# used in some tests
'pandas',

14
tox.ini
View file

@ -1,6 +1,6 @@
[tox]
minversion = 3.5
envlist = py3,mypy # pylint
envlist = py3,mypy,mypy-modules # pylint
# TODO ugh. unclear how to reuse setup.cfg deps in tox
[testenv]
@ -24,6 +24,18 @@ commands =
commands = ./demo.py
# specific modules that are known to be mypy compliant (to avoid false negatives)
[testenv:mypy-modules]
# todo add a stub with all the various configs for mypy/doc
setenv = MYPYPATH=doc/example_config
commands =
# TODO ugh. somehow, user installed (editable??) packages leak into this environment??
pip install -e .[testing] .[optional]
pip install git+https://github.com/karlicoss/hypexport
python3 -m mypy -p my.hypothesis {posargs}
# ideally, keep core modules only here
[testenv:mypy]
skip_install = true
commands =