forked from nornir-automation/nornir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (56 loc) · 1.58 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
ifeq ($(PYTHON), )
override PYTHON=3.6
endif
DOCKER_COMPOSE_FILE=docker-compose.yaml
DOCKER_COMPOSE=PYTHON=${PYTHON} docker-compose -f ${DOCKER_COMPOSE_FILE}
NORNIR_DIRS=nornir tests docs
.PHONY: start_dev_env
start_dev_env:
${DOCKER_COMPOSE} \
up -d \
dev1.group_1 dev2.group_1 dev3.group_2 dev4.group_2 dev5.no_group httpbin netconf1.no_group
.PHONY: stop_dev_env
stop_dev_env:
${DOCKER_COMPOSE} \
down
.PHONY: build_test_container
build_test_container:
${DOCKER_COMPOSE} \
build nornir
.PHONY: enter-container
enter-container:
${DOCKER_COMPOSE} \
run --rm nornir bash
.PHONY: pytest
pytest:
${DOCKER_COMPOSE} \
run --rm nornir pytest --cov=nornir --cov-report=term-missing -vs ${ARGS}
.PHONY: black
black:
${DOCKER_COMPOSE} \
run --rm nornir black --check ${NORNIR_DIRS}
.PHONY: sphinx
sphinx:
# TODO REPLACE with: sphinx-build -n -E -q -N -b dummy -d docs/_build/doctrees docs asd
${DOCKER_COMPOSE} \
run --rm nornir sphinx-build -W -b html -d docs/_build/doctrees docs docs/_build/html
.PHONY: pylama
pylama:
${DOCKER_COMPOSE} \
run --rm nornir pylama ${NORNIR_DIRS}
.PHONY: mypy
mypy:
${DOCKER_COMPOSE} \
run --rm nornir mypy nornir tests
.PHONY: nbval
nbval:
${DOCKER_COMPOSE} \
run --rm nornir pytest --nbval --sanitize-with docs/nbval_sanitize.cfg \
docs/plugins \
docs/howto \
docs/tutorials/intro/initializing_nornir.ipynb \
docs/tutorials/intro/inventory.ipynb
.PHONY: tests
tests: stop_dev_env build_test_container start_dev_env black sphinx pylama mypy nbval
make pytest PYTEST=3.6
make pytest PYTEST=3.7