| 1 | PYTHONVERSION=`python3 -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))'` |
| 2 | |
| 3 | .PHONY: tests tests-python2 |
| 4 | |
| 5 | version: |
| 6 | @echo "$(PYTHONVERSION)" |
| 7 | |
| 8 | doc: |
| 9 | echo "" > DOC |
| 10 | pydoc3 ./clap/* >> DOC |
| 11 | |
| 12 | global-install: |
| 13 | make tests |
| 14 | make clean |
| 15 | mkdir -p $(PREFIX)/lib/python$(PYTHONVERSION)/site-packages/clap |
| 16 | cp -v ./clap/*.py $(PREFIX)/lib/python$(PYTHONVERSION)/site-packages/clap/ |
| 17 | |
| 18 | install: ./clap/*.py |
| 19 | mkdir -p ~/.local/lib/python$(PYTHONVERSION)/site-packages/clap |
| 20 | cp -v ./clap/*.py ~/.local/lib/python$(PYTHONVERSION)/site-packages/clap/ |
| 21 | |
| 22 | clean: |
| 23 | rm -rf ./clap/__pycache__ |
| 24 | |
| 25 | |
| 26 | test: |
| 27 | python3 ./tests/clap/tests.py --catch --failfast --verbose |
| 28 | |
| 29 | test-builder: |
| 30 | python3 ./tests/clap/buildertests.py --catch --failfast --verbose |
| 31 | |
| 32 | test-example-ui-run: |
| 33 | python3 ./examples/nested.py > /dev/null |
| 34 | python3 ./examples/nested.py help > /dev/null |
| 35 | python3 ./examples/nested.py help help > /dev/null |
| 36 | python3 ./examples/nested.py help help --help > /dev/null |
| 37 | |
| 38 | test-example-ui-helper-output: |
| 39 | @python3 ./examples/nested.py help |
| 40 | @python3 ./examples/nested.py help help |
| 41 | @python3 ./examples/nested.py help help --usage |
| 42 | |
| 43 | test-cover: test test-builder test-example-ui-run |