-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
85 lines (67 loc) · 1.6 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
ifeq (${PYTHON}, )
override PYTHON=3.6
endif
DOCKER=docker run --rm -it ${EXTRA_DOCKER_OPTS} -v ${PWD}:/ntc-rosetta-conf ntc-rosetta-conf-${PYTHON}:latest
.PHONY: start-dev-containers
start-dev-containers:
docker-compose build --build-arg PYTHON=$(PYTHON)
docker-compose up -d
.PHONY: stop-dev-containers
stop-dev-containers:
docker-compose down
.PHONY: build_test_container
build_test_container:
docker build \
--tag ntc-rosetta-conf-${PYTHON}:latest \
--build-arg PYTHON=${PYTHON} \
-f Dockerfile .
.PHONY: build_test_containers
build_test_containers:
make build_test_container PYTHON=3.6
.PHONY: enter-container
enter-container:
${DOCKER} \
bash
.PHONY: pytest
pytest:
${DOCKER} \
pytest --cov=ntc_rosetta_conf --cov-report=term-missing -vs ${ARGS}
.PHONY: black
black:
${DOCKER} \
black --check .
.PHONY: sphinx-test
sphinx-test:
${DOCKER} \
sphinx-build -W -n -E -q -N -b dummy -d docs/_build/doctrees docs /tmp/asd
.PHONY: pylama
pylama:
${DOCKER} \
pylama .
.PHONY: mypy
mypy:
${DOCKER} \
mypy .
.PHONY: nbval
nbval:
docker-compose exec jupyter pytest -vvvvvs --nbval docs/tutorials
.PHONY: _docs
_docs:
cd docs && make html
.PHONY: docs
docs:
${DOCKER} \
make _docs
.PHONY: _jupyter
_jupyter:
${DOCKER} jupyter notebook --allow-root --ip=0.0.0.0 --NotebookApp.token=''
.PHONY: jupyter
jupyter:
make _jupyter EXTRA_DOCKER_OPTS="-p 8888:8888"
.PHONY: tests
tests: build_test_containers black pylama mypy start-dev-containers nbval
make stop-dev-containers
.PHONY: publish
publish:
${DOCKER} \
poetry publish --build --username=$(PYPI_USER) --password="$(PYPI_PASSWORD)"