50 lines
1.8 KiB
INI
50 lines
1.8 KiB
INI
[tox]
|
|
minversion = 3.5
|
|
envlist = py3,mypy,mypy-modules
|
|
|
|
# TODO ugh. unclear how to reuse setup.cfg deps in tox
|
|
[testenv]
|
|
passenv = CI CI_*
|
|
# deliberately set to nonexistent path to check the fallback logic
|
|
setenv = MY_CONFIG = nonexistent
|
|
commands =
|
|
pip install -e .[testing]
|
|
# python -m pytest {posargs}
|
|
# todo these are probably not necessary anymore?
|
|
python3 -c 'from my.config import stub as config; print(config.key)'
|
|
python3 -c 'import my.config; import my.config.repos' # shouldn't fail at least
|
|
python3 -m pytest tests/core.py tests/misc.py tests/get_files.py tests/config.py::test_set_repo tests/config.py::test_environment_variable tests/demo.py
|
|
# TODO add; once I figure out porg depdencency?? tests/config.py
|
|
# TODO run demo.py? just make sure with_my is a bit cleverer?
|
|
# TODO e.g. under CI, rely on installing
|
|
hpi modules
|
|
|
|
|
|
[testenv:demo]
|
|
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
|
|
pip install git+https://github.com/karlicoss/instapexport
|
|
# todo I guess use a script...
|
|
python3 -m mypy -p my.hypothesis \
|
|
-p my.instapaper \
|
|
--txt-report .mypy-coverage \
|
|
--html-report .mypy-coverage \
|
|
{posargs}
|
|
# txt report is a bit more convenient to view on CI
|
|
|
|
|
|
# ideally, keep core modules only here
|
|
[testenv:mypy]
|
|
skip_install = true
|
|
commands =
|
|
pip install -e .[testing] .[optional]
|
|
./lint
|