-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (55 loc) · 2.06 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
.PHONY: help venv clean docker-rm docker-build docker test test-rebuild test-env build upload
TESTS = "tests/"
N = 1
help:
@echo "Please use \"make <target>\" where <target> is one of:"
@echo " clean to remove build artifacts."
@echo " test to run tests with every python interpreter"
@echo " available."
@echo " test-rebuild remove and recreate all tox virtual"
@echo " environments."
@echo " ENV=\"\$$env\" test-env to run tests with a single interpreter"
@echo " where \$$env is one of: py36, py37"
@echo ""
@echo "All test recipes can specify a subset of tests using the "
@echo "\"TESTS\" macro with a py.test target form. E.G:"
@echo ""
@echo " \$$ make TESTS=\"tests/<file>.py[::test]\" test"
@echo ""
@echo "Additionally, you can parallelize tests with pytest-xdist using"
@echo "the \"N\" macro. E.G:"
@echo ""
@echo " \$$ make N=4 test"
@echo ""
venv:
@rm -rf venv
@python3 -m venv venv/coppyr
clean:
@rm -rf dist/*
@rm -rf build/*
@find . -path '*/.*' -prune -o -name '__pycache__' -exec rm -fr {} +
@find . -path '*/.*' -prune -o -name '*.egg-info' -exec rm -fr {} +
@find . -path '*/.*' -prune -o -name '*.py[co]' -exec rm -fr {} +
@find . -path '*/.*' -prune -o -name '*.build' -exec rm -fr {} +
@find . -path '*/.*' -prune -o -name '*.so' -exec rm -fr {} +
@find . -path '*/.*' -prune -o -name '*.c' -exec rm -fr {} +
@find . -path '*/.*' -prune -o -name '*~' -exec rm -fr {} +
docker-rm:
@cd docker && docker-compose -f dev.compose.yaml rm -s -v -f;
docker-build: docker-rm
@cd docker && docker-compose -f dev.compose.yaml build --no-cache;
docker:
@cd docker && docker-compose -f dev.compose.yaml run coppyr-dev;
test: clean
python3 -m tox --skip-missing-interpreters -- ${TESTS} -n ${N}
@make clean
test-rebuild: clean
rm -rf .tox
python3 -m tox --skip-missing-interpreters --recreate --notest
@make clean
test-env: clean
python3 -m tox -e ${ENV} -- ${TESTS} -n ${N}
build: clean
@python3 -m build
upload: build
@twine upload dist/*