-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
45 lines (32 loc) · 1.03 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
.PHONY: format format-check pylint typecheck lint test docs build pypy-test pypy-live
PYTHON := python3
PLATFORM ?= linux/amd64
PROFILE ?= release
all: format lint test docs
format:
$(PYTHON) -m black .
$(PYTHON) -m isort --profile=black .
format-check:
$(PYTHON) -m black --check .
$(PYTHON) -m isort --profile=black --check .
pylint:
$(PYTHON) -m pylint dustmaker tests
typecheck:
$(PYTHON) -m mypy dustmaker
lint: format-check pylint typecheck
test:
$(PYTHON) -m pytest --cov dustmaker -sv tests/
docs:
make -C docs html
build:
$(PYTHON) -m build
clean:
rm -rf build dist *.egg-info
pypi-test: build
TWINE_USERNAME=__token__ TWINE_PASSWORD="$(shell gpg -d test.pypi-token.gpg)" \
$(PYTHON) -m twine upload --repository testpypi dist/*
pypi-live: build
TWINE_USERNAME=__token__ TWINE_PASSWORD="$(shell gpg -d live.pypi-token.gpg)" \
$(PYTHON) -m twine upload dist/*
docker-%:
docker run --rm -v "$${PWD}:/work" -w /work "$$(tplbuild base-lookup --platform "$${PLATFORM}" --profile "$${PROFILE}" base-dustmaker)" make $*