-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
92 lines (70 loc) · 2.27 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
.PHONY: help clean clean-pyc clean-build list test test-dbg test-cov test-all coverage docs release sdist install deps develop tag
project-name = hansel
version-var := "__version__ = "
version-string := $(shell grep $(version-var) $(project-name)/version.py)
version := $(subst __version__ = ,,$(version-string))
help:
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "lint - check style with flake8"
@echo "test - run tests quickly with the default Python"
@echo "test-cov - run tests with the default Python and report coverage"
@echo "test-dbg - run tests and debug with pdb"
@echo "testloop - run tests in a loop"
@echo "coverage - check code coverage quickly with the default Python"
@echo "docs - generate Sphinx HTML documentation, including API docs"
@echo "release - package and upload a release"
@echo "sdist - package"
@echo "install - install"
@echo "develop - install in development mode"
@echo "deps - install dependencies"
@echo "dev_deps - install dependencies for development"
@echo "release - package a release in wheel and tarball"
@echo "upload - make a release and run the scripts/deploy.sh"
@echo "tag - create a git tag with current version"
install:
pipenv run python setup.py install
develop: dev_deps
pipenv run python setup.py develop
deps:
pipenv install
dev_deps:
pipenv install --dev
clean: clean-build clean-pyc
clean-build:
rm -fr build/
rm -fr dist/
rm -fr *.egg-info
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +
find . -name '*.log*' -delete
lint:
pipenv run flake8 $(project-name)/
test:
pipenv run py.test -v
test-cov:
pipenv run py.test --cov-report term-missing --cov=$(project-name)
test-dbg:
pipenv run py.test --pdb
testloop:
pipenv run py.test -f
coverage:
pipenv run pytest --cov=hansel
pipenv run coverage report -m
build:
pipenv run python setup.py sdist --formats gztar bdist_wheel
tag: clean
@echo "Creating git tag v$(version)"
git tag v$(version)
git push --tags
release: clean build tag
pipenv run python setup.py sdist upload
patch:
pipenv run bumpversion patch
minor:
pipenv run bumpversion minor
major:
pipenv run bumpversion major