-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
64 lines (53 loc) · 1.11 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
#
# This is a helper makefile to run tox.
#
PYTHON3 ?= /usr/bin/python3.12
ACTIVATE ?= .venv/bin/activate
PIP ?= .venv/bin/pip
TOX ?= .venv/bin/tox
.PHONY: help
help:
@echo "usage: make <target>"
@echo ""
@echo "targets:"
@echo " init create python virtualenv to run tox"
@echo " format reformat code with black"
@echo " lint run lint checks"
@echo " test run all tests"
@echo " build build packages"
@echo " release upload to pypi.org"
@echo " clean remove generated files"
@echo " distclean remove generated files and virtualenvs"
$(ACTIVATE):
$(PYTHON3) -m venv .venv
$(PIP) install -U pip setuptools
$(PIP) install tox==4.12.0
touch $(ACTIVATE)
.PHONY: init
init: $(ACTIVATE)
.PHONY: format
format: init
$(TOX) -e format
.PHONY: lint
lint: init
$(TOX) -e lint
.PHONY: test
test: lint
$(TOX)
.PHONY: build
build: init
$(TOX) -e build
.PHONY: release
release: init
$(TOX) -e release
.PHONY: clean
clean:
rm -f MANIFEST
rm -rf */__pycache__/
rm -rf *.egg-info/
rm -rf build/
rm -rf dist/
.PHONY: distclean
distclean: clean
rm -rf .venv/
rm -rf .tox/