-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
48 lines (40 loc) · 1.51 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
.PHONY: help
help :
@echo
@echo 'Commands:'
@echo
@echo ' make test run unit tests'
@echo ' make lint run linter'
@echo ' make format run code formatter'
@echo ' make doc make documentation'
@echo ' make changelog update changelog based on version'
@echo ' make pypi-dist make binary and source packages for PyPI'
@echo ' make pypi-dist-check verify binary and source packages for PyPI'
@echo
VERSION ?= $(shell python setup.py --version)
REPO_URL = https://github.com/scimma/hop-client
.PHONY: test
test :
python -m pytest -v --cov=hop --cov-report=term-missing tests
.PHONY: lint
lint :
# stop the build if there are Python syntax errors or undefined names
flake8 hop tests setup.py --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings
flake8 hop tests setup.py --count --exit-zero --max-complexity=15 --max-line-length=100 --statistics
.PHONY: format
format :
autopep8 --recursive --in-place hop tests setup.py
.PHONY: doc
doc :
cd doc && make html
.PHONY: changelog
changelog :
sed -i 's@## \[Unreleased]@## \[Unreleased]\n\n## \[$(VERSION)] - $(shell date +'%Y-%m-%d')@' CHANGELOG.md
sed -i 's@.*\[Unreleased]:.*@\[Unreleased]: $(REPO_URL)/compare/v$(VERSION)...HEAD\n[$(VERSION)]: $(REPO_URL)/releases/tag/v$(VERSION)@' CHANGELOG.md
.PHONY: pypi-dist
pypi-dist :
python setup.py sdist bdist_wheel
.PHONY: pypi-dist-check
pypi-dist-check:
twine check dist/*