-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (36 loc) · 1.2 KB
/
Copy pathMakefile
File metadata and controls
47 lines (36 loc) · 1.2 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
35
36
37
38
39
40
41
42
43
44
45
46
47
.PHONY : dist docs doctests docker-image lint tests
# Build documentation, lint the code, and run tests.
build : doctests docs lint tests dist
dist : pyproject.toml
python -m build
twine check dist/*.tar.gz dist/*.whl
lint :
flake8
black --check .
mypy localscope
docs :
# Always build from scratch because of dodgy Sphinx caching.
rm -rf docs/_build
sphinx-build -nW -b html . docs/_build
doctests :
# Always build from scratch because of dodgy Sphinx caching.
rm -rf docs/_build
sphinx-build -nW -b doctest . docs/_build
tests :
pytest -v --cov localscope --cov-report=html --cov-report=term-missing \
--cov-fail-under=100
# Build pinned requirements file.
requirements.txt : requirements.in pyproject.toml
pip-compile -v $<
# Docker versions.
VERSIONS = 3.9 3.10 3.11 3.12 3.13
IMAGES = $(addprefix docker-image/,${VERSIONS})
RUNS = $(addprefix docker-run/,${VERSIONS})
docker-images : ${IMAGES}
${IMAGES} : docker-image/% :
docker build --build-arg version=$* -t localscope:$* .
$(addprefix docker-shell/,${VERSIONS}) : docker-shell/% : docker-image/%
docker run --rm -it localscope:$* bash
docker-runs : ${RUNS}
${RUNS} : docker-run/% : docker-image/%
docker run --rm -it localscope:$* make build