Use tox
This commit is contained in:
parent
76492aaa9e
commit
3ee2deecae
4 changed files with 40 additions and 7 deletions
|
@ -9,14 +9,11 @@ jobs:
|
|||
- checkout
|
||||
|
||||
- run: ./demo.py
|
||||
|
||||
# TODO FIXME switch to tox?
|
||||
# - run: pip3 install --user mypy pylint
|
||||
# - run: python3 -m mypy --namespace-packages my
|
||||
# - run: python3 -m pylint -E my
|
||||
|
||||
# TODO need to keep full mycfg.py as example? to dummy run CI
|
||||
|
||||
- run: python3 -m pip install --user tox
|
||||
- run: python3 -m tox
|
||||
|
||||
|
||||
|
||||
workflows:
|
||||
|
|
6
setup.py
6
setup.py
|
@ -27,6 +27,12 @@ def main():
|
|||
},
|
||||
|
||||
python_requires='>=3.5', # depends on the modules though..
|
||||
extras_require={
|
||||
'testing': [
|
||||
'pytest',
|
||||
'pytz',
|
||||
],
|
||||
},
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
30
tox.ini
Normal file
30
tox.ini
Normal file
|
@ -0,0 +1,30 @@
|
|||
[tox]
|
||||
minversion = 3.5
|
||||
envlist = py36,py37 # ,pylint,mypy
|
||||
skip_missing_interpreters = True
|
||||
|
||||
# TODO ugh. unclear how to reuse setup.cfg deps in tox
|
||||
[testenv]
|
||||
passenv = CI CI_* CIRCLE*
|
||||
changedir = {toxworkdir}/{envname}
|
||||
commands =
|
||||
# pip install -e .[testing]
|
||||
# TODO ??
|
||||
# python -m pytest {posargs}
|
||||
python3 -c 'import my; print(my.__path__)'
|
||||
# TODO run demo.py? just make sure with_my is a bit cleverer?
|
||||
# TODO e.g. under CI, rely on installing
|
||||
|
||||
|
||||
# [testenv:mypy]
|
||||
# skip_install = true
|
||||
# commands =
|
||||
# pip install -e .[testing]
|
||||
# python -m mypy --check-untyped src/cachew
|
||||
|
||||
|
||||
# [testenv:pylint]
|
||||
# skip_install = true
|
||||
# commands =
|
||||
# pip install -e .[testing]
|
||||
# python -m pylint -E src/cachew
|
|
@ -41,7 +41,7 @@ if __name__ == '__main__':
|
|||
|
||||
# TODO wonder why py.typed file in mycfg didn't help?
|
||||
for v in ['MYPYPATH', 'PYTHONPATH']:
|
||||
upd(v, MY_DIR)
|
||||
upd(v, MY_DIR) # TODO not sure if it should do it if you use install -e?
|
||||
upd(v, MYCFG_DIR)
|
||||
|
||||
rest = sys.argv[1:]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue