-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (58 loc) · 1.5 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
SHELL:=/bin/bash -O globstar
ROOT_DIR=$(shell pwd)
.PHONY: check-version
check-version:
ifdef v
VERSION=$(v)
endif
ifdef V
VERSION=$(V)
endif
ifndef VERSION
$(error VERSION argument must be defined. (make rel-agent VERSION=0.0.2))
endif
.PHONY: test
test:
pytest tests/unit_tests
.PHONY: it-test
it-test:
pytest tests/it_tests
.PHONY: coverage
coverage:
pytest tests/unit_tests --cov=deep --cov-report term --cov-fail-under=84 --cov-report html --cov-branch --junitxml=report.xml
.PHONY: lint
lint:
flake8
.PHONY: flake
flake: lint
.PHONY: build
build:
rm -Rf $(ROOT_DIR)/dist
python -m build $(ROOT_DIR)
.PHONY: check-python-vars
check-python-vars:
ifndef TWINE_USER
$(error TWINE_USER argument must be defined.)
endif
ifndef TWINE_PASSWORD
$(error TWINE_PASSWORD argument must be defined.)
endif
.PHONY: rel-agent
rel-agent: check-version check-python-vars
rm -Rf $(ROOT_DIR)/dist
sed -i "s/[0-9]*\.[0-9]*\.[0-9]*/$(VERSION)/" $(ROOT_DIR)/src/deep/version.py
python -m build $(ROOT_DIR)
python -m twine upload -u $(TWINE_USER) -p $(TWINE_PASSWORD) $(ROOT_DIR)/dist/*
.PHONY: rel-docker-test-app
rel-docker-test-app:
docker build -t intergral/deep-python:latest $(ROOT_DIR)/examples/simple-app-docker
docker push intergral/deep-python:latest
.PHONY: docs
docs:
python $(ROOT_DIR)/scripts/gendocs.py $(ROOT_DIR)
mkdocs build --config-file=$(ROOT_DIR)/mkdocs-mod.yml
.PHONY: clean
clean:
rm -Rf _site docs/apidocs .pytest_cache test/.pytest_cache
.PHONY: precommit
precommit: lint tests coverage