|
| 1 | +.PHONY: help clean clean-pyc clean-build list test test-dbg test-cov test-all coverage docs release sdist install install-dev install-ci lint mypy isort isort-check |
| 2 | + |
| 3 | +project-name = pycon_schemas |
| 4 | + |
| 5 | +version-var := "__version__ = " |
| 6 | +version-string := $(shell grep $(version-var) $(project-name)/version.py) |
| 7 | +version := $(subst __version__ = ,,$(version-string)) |
| 8 | + |
| 9 | +help: |
| 10 | + @echo "install - install" |
| 11 | + @echo "install-dev - install also development dependencies" |
| 12 | + @echo "clean - clean all below" |
| 13 | + @echo "clean-build - remove build artifacts" |
| 14 | + @echo "clean-pyc - remove Python file artifacts" |
| 15 | + @echo "clean-tox - clean tox cache" |
| 16 | + @echo "lint - check style with flake8" |
| 17 | + @echo "test - run tests quickly with the default Python" |
| 18 | + @echo "test-cov - run tests with the default Python and report coverage" |
| 19 | + @echo "test-dbg - run tests and debug with pdb" |
| 20 | + @echo "develop - run tests in loop mode" |
| 21 | + @echo "deploy - deploy" |
| 22 | + @echo "mypy - check type hinting with mypy" |
| 23 | + @echo "isort - sort imports" |
| 24 | + @echo "isort-check - check if your imports are correctly sorted" |
| 25 | + @echo "build - create the distribution package" |
| 26 | + @echo "release - package a release in wheel and tarball, requires twine" |
| 27 | + |
| 28 | +install: |
| 29 | + python -m pip install pipenv |
| 30 | + pipenv install |
| 31 | + python -m pip install . |
| 32 | + |
| 33 | +install-ci: |
| 34 | + python -m pip install pipenv |
| 35 | + pipenv install --dev |
| 36 | + python -m pip install -e . |
| 37 | + |
| 38 | +install-dev: install-ci |
| 39 | + pre-commit install |
| 40 | + |
| 41 | +clean: clean-build clean-pyc clean-caches |
| 42 | + |
| 43 | +clean-build: |
| 44 | + rm -fr build/ |
| 45 | + rm -fr dist/ |
| 46 | + rm -fr .eggs/ |
| 47 | + rm -fr *.egg-info |
| 48 | + rm -fr *.spec |
| 49 | + |
| 50 | +clean-pyc: |
| 51 | + pyclean $(project-name) |
| 52 | + find . -name '*~' -exec rm -f {} + |
| 53 | + find . -name __pycache__ -exec rm -rf {} + |
| 54 | + find . -name '*.log*' -delete |
| 55 | + find . -name '*_cache' -exec rm -rf {} + |
| 56 | + find . -name '*.egg-info' -exec rm -rf {} + |
| 57 | + |
| 58 | +clean-caches: |
| 59 | + rm -rf .tox |
| 60 | + rm -rf .pytest_cache |
| 61 | + |
| 62 | +testloop: |
| 63 | + pytest --color=yes -s -f $(project-name) |
| 64 | + |
| 65 | +lint: |
| 66 | + tox -e lint |
| 67 | + |
| 68 | +test: |
| 69 | + tox -e tests |
| 70 | + |
| 71 | +mypy: |
| 72 | + tox -e mypy |
| 73 | + |
| 74 | +isort-check: |
| 75 | + tox -e isort |
| 76 | + |
| 77 | +isort: |
| 78 | + isort -rc $(project-name) |
| 79 | + |
| 80 | +test-cov: |
| 81 | + py.test --cov-report term-missing --cov=$(project-name) |
| 82 | + |
| 83 | +test-dbg: |
| 84 | + py.test --pdb |
| 85 | + |
| 86 | +develop: |
| 87 | + py.test --color=yes -f |
| 88 | + |
| 89 | +coverage: |
| 90 | + pytest --cov=hansel |
| 91 | + coverage report -m |
| 92 | + |
| 93 | +build: |
| 94 | + python setup.py sdist bdist_wheel |
| 95 | + |
| 96 | +pypi: |
| 97 | + twine upload dist/* |
| 98 | + |
| 99 | +release: clean build pypi |
0 commit comments