| 1 |
all: lint unit |
| 2 |
|
| 3 |
export PYTHONPATH:=${PWD} |
| 4 |
version=`python -c 'import filetype; print(filetype.version)'` |
| 5 |
filename=filetype-`python -c 'import filetype;print(filetype.version)'`.tar.gz |
| 6 |
|
| 7 |
lint: |
| 8 |
@flake8 . |
| 9 |
|
| 10 |
test: clean lint |
| 11 |
@echo "Running tests ..." |
| 12 |
@python -m unittest discover |
| 13 |
|
| 14 |
documentation: |
| 15 |
@pdoc --html --overwrite --all-submodules --html-dir docs filetype |
| 16 |
@rm -rf docs/v${version} |
| 17 |
@mv docs/filetype docs/v${version} |
| 18 |
|
| 19 |
deploy-documentation: documentation |
| 20 |
@cd docs && git checkout gh-pages |
| 21 |
@cd docs && git add . |
| 22 |
@cd docs && git commit -am release |
| 23 |
@cd docs && git push --force origin gh-pages |
| 24 |
|
| 25 |
clean: |
| 26 |
@printf "Cleaning up files that are already in .gitignore... " |
| 27 |
@for pattern in `cat .gitignore`; do find . -name "$$pattern" -delete; done |
| 28 |
@echo "OK!" |
| 29 |
|
| 30 |
tag: |
| 31 |
@echo "Creating tag v$(version)..." |
| 32 |
@echo $(version) |
| 33 |
@git tag -a v$(version) -m "Version v$(version)" |
| 34 |
@git push origin v$(version) |
| 35 |
|
| 36 |
compress: |
| 37 |
@printf "Exporting to $(filename)... " |
| 38 |
@tar czf $(filename) filetype setup.py README.md LICENSE |
| 39 |
|
| 40 |
publish: |
| 41 |
@echo "==> Releasing package $(version)..." |
| 42 |
@python setup.py sdist bdist_wheel |
| 43 |
@twine upload dist/* --repository-url https://upload.pypi.org/legacy/ |
| 44 |
@rm -fr build dist .egg pook.egg-info |
| 45 |
|
| 46 |
release: clean docs deploy-documentation tag compress publish |
| 47 |
@echo "DONE!" |