-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
85 lines (65 loc) · 1.4 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
#!make
export DOCKER_BUILDKIT = 1
export COMPOSE_DOCKER_CLI_BUILD = 1
# Command Variables
D = docker
DC = docker-compose
DCFLAGS = --rm dev
PYTHON = python
build_dir = build
dist_dir = dist
name = `$(PYTHON) setup.py --name`
artifacts = \
.coverage \
.mypy_cache \
.pytest_cache \
src/*.egg-info
all: install
.PHONY: all
clean: distclean
@rm -rf $(artifacts)
@find . -depth -name '__pycache__' -exec rm -rv {} \;
@$(PYTHON) setup.py clean
.PHONY: clean
container:
@$(DC) build
.PHONY: container
dist:
@$(PYTHON) setup.py sdist bdist_wheel
distclean:
@rm -rf $(build_dir) $(dist_dir)
.PHONY: distclean
install: dist
@$(PYTHON) setup.py install
.PHONY: install
install-dev:
@$(PYTHON) -m pip install -e .[dev,doc,extras,test]
.PHONY: install-dev
lint:
@$(PYTHON) -m flake8 src
.PHONY: lint
test:
@$(PYTHON) -m pytest
.PHONY: test
test-clean:
@$(PYTHON) -m pytest --cache-clear
.PHONY: test-clean
typecheck:
@echo "type checking is broken atm, skipping."
@#$(PYTHON) -m mypy src
.PHONY: typecheck
upload: upload-check
@$(PYTHON) -m twine upload $(dist_dir)/*
.PHONY: upload
upload-check: dist
@$(PYTHON) -m twine check $(dist_dir)/*
.PHONY: upload-check
upload-test: upload-check
@$(PYTHON) -m twine upload --repository testpypi $(dist_dir)/*
.PHONY: upload-test
uninstall:
@$(PYTHON) -m pip uninstall -y $(name)
.PHONY: uninstall
uninstall-dev:
@$(PYTHON) setup.py develop -u
.PHONY: uninstall-dev