-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
executable file
·53 lines (40 loc) · 1.48 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
OK_COLOR=\033[32;01m
NO_COLOR=\033[0m
all: test
export PYTHONPATH:=${PWD}
version=`python -c 'import grappa; print(grappa.__version__)'`
filename=grappa-`python -c 'import grappa; print(grappa.__version__)'`.tar.gz
apidocs:
@sphinx-apidoc -f --follow-links -H "API documentation" -o docs/source grappa
htmldocs:
@rm -rf docs/_build
$(MAKE) -C docs html
lint:
@printf "$(OK_COLOR)==> Linting code...$(NO_COLOR)\n"
@flake8 .
test: lint
@printf "$(OK_COLOR)==> Runnings tests...$(NO_COLOR)\n"
@pytest -s -v --tb=native --capture=sys --cov grappa --cov-report term-missing tests
coverage:
@coverage run --source grappa -m py.test
@coverage report
bump:
@bumpversion --commit --tag --current-version $(version) patch grappa/__init__.py
history:
@git changelog --tag $(version)
tag:
@printf "$(OK_COLOR)==> Creating tag $(version)...$(NO_COLOR)\n"
@git tag -a "v$(version)" -m "Version $(version)"
@printf "$(OK_COLOR)==> Pushing tag $(version) to origin...$(NO_COLOR)\n"
@git push origin "v$(version)"
clean:
@printf "$(OK_COLOR)==> Cleaning up files that are already in .gitignore...$(NO_COLOR)\n"
@for pattern in `cat .gitignore`; do find . -name "$$pattern" -delete; done
release: clean publish
@printf "$(OK_COLOR)==> Exporting to $(filename)...$(NO_COLOR)\n"
@tar czf $(filename) grappa setup.py README.rst LICENSE
publish:
@echo "$(OK_COLOR)==> Releasing package $(version)...$(NO_COLOR)"
@python setup.py sdist bdist_wheel
@twine upload dist/*
@rm -fr build dist .egg pook.egg-info