-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
57 lines (46 loc) · 931 Bytes
/
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
NAME=$(shell basename $(PWD))
PYTHON:=3.7
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: pytest
pytest:
poetry run pytest --cov=nornir_napalm --cov-report=term-missing -vs ${ARGS} .
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 .
.PHONY: tests
tests: black pylama mypy pytest
.PHONY: docker-tests
.PHONY:docker-tests
docker-tests: docker
$(DOCKER) make tests
.PHONY: jupyter
jupyter:
docker run \
--name $(NAME)-jupyter --rm \
-v $(PWD):/$(NAME) \
$(NAME):latest \
jupyter notebook \
--allow-root \
--ip 0.0.0.0
.PHONY: docs
docs:
make -C docs html