-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
89 lines (61 loc) · 1.82 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
# Set up development environment.
venv: FORCE
rm -rf ~/.venv/myhn venv
python3 -m venv ~/.venv/myhn
echo . ~/.venv/myhn/bin/activate > venv
deps: FORCE
touch venv
. ./venv && pip install -r requirements.txt
# Check.
lint: FORCE
. ./venv && isort --diff --quiet
. ./venv && pylama
test: FORCE
. ./venv && python -m unittest -v
coverage: FORCE
. ./venv && coverage run --branch -m unittest -v
. ./venv && coverage report --show-missing
. ./venv && coverage html
checks: lint test coverage dist docs
# Package.
dist: clean
. ./venv && python setup.py sdist bdist_wheel
test-upload: dist
. ./venv && twine upload \
--repository-url https://test.pypi.org/legacy/ dist/*
upload: dist
. ./venv && twine upload dist/*
test-venv: FORCE
rm -rf ~/.venv/testmyhn testvenv
python -m venv ~/.venv/testmyhn
echo . ~/.venv/testmyhn/bin/activate > testvenv
# Document.
docs: FORCE
rm -rf docs/api
. ./venv && sphinx-apidoc -o docs/api . setup.py test docs
. ./venv && cd docs && make html
@echo
@echo Documentation at docs/_build/html/index.html.
# Verify package.
verify-test-wheel: test-venv
. ./testvenv && pip install myhn \
--index-url https://test.pypi.org/simple/
. ./testvenv && python -m myhn --version
verify-test-sdist: test-venv
. ./testvenv && pip install myhn \
--index-url https://test.pypi.org/simple/ --no-binary :all:
. ./testvenv && python -m myhn --version
verify-wheel: test-venv
. ./testvenv && pip install myhn
. ./testvenv && python -m myhn --version
verify-sdist: test-venv
. ./testvenv && pip install --no-binary :all: myhn
. ./testvenv && python -m myhn --version
verify-test-upload: verify-test-wheel verify-test-sdist
verify-upload: verify-wheel verify-sdist
# Clean up.
clean: FORCE
rm -rf *.pyc __pycache__
rm -rf build dist myhn.egg-info
rm -rf .coverage htmlcov
FORCE: