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