-
Notifications
You must be signed in to change notification settings - Fork 111
/
Makefile
83 lines (62 loc) · 1.98 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
all:
make html
make pdf
install:
pip install -r requirements.txt
clean:
cd book; rm -rf \
*.aux *.out *.log pylabimshow* myplot* myfile* \
combined_files hello.txt hello.py data.mat test.txt vectools.py \
module1.py pylabhistogram.pdf eu-pop-2017.csv \
_build .ipynb_checkpoints
html:
jupyter-book build book --builder html
linkcheck:
jupyter-book build book --builder linkcheck
pdf: book/*-*.ipynb
jupyter-book build book --builder pdflatex
nbval:
@echo "Testing all chapters (apart from 18) with --nbval"
pytest -v --nbval book --sanitize-with book/static/nbval_sanitize.cfg \
--ignore=book/18-environments.ipynb --ignore=book/_build
@echo "Testing chapter 18 with --nbval-lax"
pytest -v --nbval-lax book/18-environments.ipynb
nbval-native:
@echo "Testing all chapters (apart from 18) with --nbval"
pytest -v --nbval book --sanitize-with book/static/nbval_sanitize.cfg \
--ignore=book/18-environments.ipynb --ignore=book/_build
@echo "Testing chapter 18 with --nbval-lax"
pytest -v --nbval-lax book/18-environments.ipynb
docker-all:
make docker-build
make docker-html
make docker-linkcheck
make docker-pdf
make docker-nbval
docker-build:
docker build -t python4compscience .
# Occasionally (after changing branch) we need to force rebuild:
docker-build-nocache:
docker build -t python4compscience2 --no-cache .
define DOCKER_RUN
docker run --rm -v $(CURDIR):/io python4compscience
endef
docker-bash:
docker run --workdir=/io -t -i -v $(CURDIR):/io python4compscience bash
docker-html:
$(DOCKER_RUN) make html
docker-linkcheck:
$(DOCKER_RUN) make linkcheck
docker-pdf:
$(DOCKER_RUN) make pdf
docker-nbval:
$(DOCKER_RUN) make nbval
docker-clean:
$(DOCKER_RUN) make clean
docker-binder-nbval:
$(DOCKER_RUN) make nbval-native
# to update the title page:
# - screenshot first page of pdf
# - (edit out date if desired)
# - add border around bitmap, for example using
# "convert titlepage.png -shave 1x1 -bordercolor black -border 1 titlepage-with-border.png"