-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
37 lines (30 loc) · 788 Bytes
/
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
ENV=$(CURDIR)/.env
BIN=$(ENV)/bin
.PHONY: help
# target: help - Display callable targets
help:
@egrep "^# target:" [Mm]akefile
.PHONY: clean
# target: clean - Display callable targets
clean:
@rm -rf build dist docs/_build
@find . -name \*.py[co] -delete
@find . -name *\__pycache__ -delete
env:
@python3.8 -m venv $(ENV)
.PHONY: test
# target: test - test the code
test: env
$(BIN)/python -m unittest
.PHONY: build
# target: build - Build package
build: clean
$(BIN)/python setup.py sdist bdist_wheel
.PHONY: test-release
# target: test-release - Release package to test pypi
test-release: build
$(BIN)/twine upload --repository-url https://test.pypi.org/legacy/ dist/*
.PHONY: release
# target: release - Release package to pypi
release: build
$(BIN)/twine upload dist/*