-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
73 lines (59 loc) · 1.18 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
NAME=$(shell basename $(PWD))
PYTHON:=3.7
DOCKER_COMPOSE_FILE=docker-compose.yml
DOCKER_COMPOSE=docker compose -f ${DOCKER_COMPOSE_FILE}
DOCKER=docker run \
--rm -it \
--name $(NAME)-tests \
-v $(PWD):/$(NAME) \
--rm $(NAME):latest
.PHONY: docker
docker:
docker build \
--build-arg PYTHON=$(PYTHON) \
--build-arg NAME=$(NAME) \
-t $(NAME):latest \
-f Dockerfile \
.
.PHONY: start_dev_env
start_dev_env:
${DOCKER_COMPOSE} \
up -d
.PHONY: stop_dev_env
stop_dev_env:
${DOCKER_COMPOSE} \
down
.PHONY: pytest
pytest:
rm -f docs/source/tutorials/out_files/*.txt
poetry run pytest --nbval -vs ${ARGS} docs/source/tutorials
.PHONY: black
black:
poetry run black --check .
.PHONY: pylama
pylama:
poetry run pylama .
.PHONY: mypy
mypy:
poetry run mypy nornir_utils
.PHONY: tests
tests: black pylama mypy pytest
.PHONY:
jupyter:
poetry run jupyter notebook --no-browser
.PHONY: docker-tests
docker-tests: docker
$(DOCKER) make tests
.PHONY: docker-jupyter
docker-jupyter:
docker run \
--name $(NAME)-jupyter --rm \
-v $(PWD):/$(NAME) \
-p 8888:8888 \
$(NAME):latest \
jupyter notebook \
--allow-root \
--ip 0.0.0.0
.PHONY: docs
docs:
make -C docs html