diff --git a/.circleci/config.yml b/.circleci/config.yml index 0742266..95b0975 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: diff --git a/setup.py b/setup.py index 128c96b..ee0402b 100644 --- a/setup.py +++ b/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__': diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..8f9a467 --- /dev/null +++ b/tox.ini @@ -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 diff --git a/with_my.example b/with_my.example index c363bf2..9a0824e 100755 --- a/with_my.example +++ b/with_my.example @@ -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:]