Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (74 loc) · 2.73 KB
/
Copy pathMakefile
File metadata and controls
95 lines (74 loc) · 2.73 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
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
86
87
88
89
90
91
92
93
94
95
DOCKER_BASE_PYTHON?=3.7
# one of mpi, notebooks_dir, oldest, vanilla, mpi, numpy_git, pip_installed
PYMOR_TEST_SCRIPT?=vanilla
# stable or oldest
PYPI_MIRROR?=stable
# debian_buster centos_8 debian_testing
PYMOR_TEST_OS?=debian_buster
DOCKER_COMPOSE=DOCKER_BASE_PYTHON=$(DOCKER_BASE_PYTHON) PYPI_MIRROR_TAG=$(PYPI_MIRROR_TAG) \
PYMOR_TEST_SCRIPT=$(PYMOR_TEST_SCRIPT) PYPI_MIRROR=$(PYPI_MIRROR) \
CI_IMAGE_TAG=$(CI_IMAGE_TAG) CI_COMMIT_SHA=$(shell git log -1 --pretty=format:"%H") \
docker-compose -f .binder/docker-compose.yml -p pymor
NB_DIR=notebooks
PANDOC_MAJOR=$(shell pandoc --version | head -n1 | cut -d ' ' -f 2 | cut -d '.' -f 1)
ifeq ($(PANDOC_MAJOR),1)
PANDOC_FORMAT=-f markdown_github
endif
PYPI_MIRROR_TAG:=$(shell cat .ci/PYPI_MIRROR_TAG)
CI_IMAGE_TAG:=$(shell cat .ci/CI_IMAGE_TAG)
SED_OPTIONS=-e "s;CI_IMAGE_TAG;$(CI_IMAGE_TAG);g" -e "s;DOCKER_BASE_PYTHON;$(DOCKER_BASE_PYTHON);g"
.PHONY: docker README.html pylint test docs
all:
./dependencies.py
# I want HTML (to preview the formatting :))
README.html: README.md
pandoc $(PANDOC_FORMAT) -t html $< > $@
README: README.html
pep8:
pep8 ./src
flake8:
flake8 ./src
test:
python setup.py test
jupyter:
jupyter notebook --notebook-dir=$(NB_DIR) --NotebookApp.disable_check_xsrf=True
tutorials: NB_DIR="docs/_build/html"
tutorials: docs jupyter
fasttest:
PYMOR_PYTEST_MARKER="not slow" python setup.py test
full-test:
@echo
@echo "Ensuring that all required pytest plugins are installed ..."
@echo "--------------------------------------------------------------------------------"
@echo
pip install pytest-flakes
pip install pytest-pep8
pip install pytest-cov
@echo
@echo "--------------------------------------------------------------------------------"
@echo
py.test --flakes --pep8 --cov=src/pymor --cov-report=html --cov-report=xml src/pymortests
docs:
PYTHONPATH=${PWD}/src/:${PYTHONPATH} make -C docs html
template: docker_file
./dependencies.py
./.ci/gitlab/template.ci.py
# Docker targets
docker_file:
sed $(SED_OPTIONS) .binder/Dockerfile.in > .binder/Dockerfile
docker_image: docker_file
$(DOCKER_COMPOSE) build
docker_docs: docker_image
NB_DIR=notebooks $(DOCKER_COMPOSE) run docs ./.ci/gitlab/test_docs.bash
docker_run: docker_image
$(DOCKER_COMPOSE) run --service-ports jupyter bash
docker_exec: docker_image
$(DOCKER_COMPOSE) run --service-ports jupyter bash -l -c "${DOCKER_CMD}"
docker_tutorials: NB_DIR=docs/_build/html
docker_tutorials: docker_docs docker_jupyter
docker_test: docker_image
PYMOR_PYTEST_MARKER=$(PYMOR_PYTEST_MARKER) $(DOCKER_COMPOSE) up pytest
docker_jupyter: docker_image
NB_DIR=$(NB_DIR) $(DOCKER_COMPOSE) up jupyter
docker_wheel_check: docker_image
PYMOR_TEST_OS=$(PYMOR_TEST_OS) $(DOCKER_COMPOSE) run --service-ports wheel_check bash