Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (28 loc) · 1.32 KB
/
Copy pathMakefile
File metadata and controls
34 lines (28 loc) · 1.32 KB
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
PROJECT_NAME = ThinkPythonSolutions
PYTHON_VERSION = 3.10
PYTHON_INTERPRETER = python
## Set up the environment
create_environment:
conda create --name $(PROJECT_NAME) python=$(PYTHON_VERSION) -y
@echo ">>> conda env created. Activate with:\nconda activate $(PROJECT_NAME)"
## Install Python Dependencies
requirements:
$(PYTHON_INTERPRETER) -m pip install -U pip setuptools wheel
$(PYTHON_INTERPRETER) -m pip install -r requirements.txt
## Check that the stored outputs in soln/ are what the builds expect.
## Read-only; see check_outputs.py for what it guards against.
check_outputs:
$(PYTHON_INTERPRETER) check_outputs.py
## Clear outputs stored for cells that no build target renders.
strip_outputs:
$(PYTHON_INTERPRETER) check_outputs.py --strip
# Test every chapter. The whole suite takes about 2.5 minutes; chapter 4 is
# roughly a third of that on its own, because jupyturtle sleeps TURTLE_DELAY
# (0.2s) after each visual command and chapter 4 draws a lot. --durations
# keeps that visible, so a chapter that starts to drag is easy to spot.
#
# Use a glob rather than a list of chapter numbers: the previous version used
# two globs, chap0[12356789] and chap1[1345678], which silently left chapters
# 0, 10 and 19 untested for as long as anyone can remember.
tests: check_outputs
cd soln && pytest --nbmake --durations=5 chap*.ipynb