-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (65 loc) · 2.32 KB
/
Copy pathMakefile
File metadata and controls
83 lines (65 loc) · 2.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
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
# SageMath is needed in path unless we use docker
ifeq (docker,$(findstring docker, $(MAKECMDGOALS)))
DOCKER = 1
endif
ifeq (,$(DOCKER)$(shell which sage))
$(error "No sage in $(PATH). Please install sage first or add the relevant path.")
endif
# Command line arguments:
# Set to 0 to use local source instead of GIT
REMOTE_SRC=1
# Set to desired git branch
GIT_BRANCH=main
# Port for notebook
NBPORT=8888
# Arguments for tox
TOX_ARGS=doctest,coverage,pycodestyle,relint,codespell,flake8
ifeq (0,$(REMOTE_SRC))
TAG=local
GIT_BRANCH=
else
TAG=$(GIT_BRANCH)
endif
EXAMPLES_ARGS:=$(GIT_BRANCH) $(NBPORT)
build:
sage -python setup.py build_ext --inplace $* 2>&1
sdist:
sage -python setup.py sdist
install:
sage -python setup.py install
test:
sage -t src/*
examples:
sage -n jupyter --no-browser --ip='0.0.0.0' --port=$(NBPORT)\
--notebook-dir=examples\
--NotebookApp.custom_display_url=http://127.0.0.1:$(NBPORT)\
--NotebookApp.use_redirect_file=False\
--NotebookApp.browser=x-www-browser
tox:
sage -pip install tox
sage --python -m tox src -c tox.ini -e $(TOX_ARGS)
docker:
docker build --build-arg GIT_BRANCH=$(GIT_BRANCH) --build-arg REMOTE_SRC=$(REMOTE_SRC) -t fqm_weil-$(TAG) .
docker-rebuild:
docker build --build-arg GIT_BRANCH=$(GIT_BRANCH) --build-arg REMOTE_SRC=$(REMOTE_SRC) --no-cache -t fqm_weil-$(TAG) .
docker-test: docker
docker run -it --init fqm_weil-$(GIT_BRANCH) test
docker-examples: docker
docker run -p $(NBPORT):$(NBPORT) -it -e GIT_BRANCH=$(GIT_BRANCH) -e NBPORT=$(NBPORT) --init fqm_weil-$(TAG) examples $(EXAMPLES_ARGS)
docker-tox: docker
docker run -it -e GIT_BRANCH=$(GIT_BRANCH) -e TOX_ARGS=$(TOX_ARGS) --init fqm_weil-$(TAG) tox
docker-shell: docker
docker run -it -e GIT_BRANCH=$(GIT_BRANCH) --init fqm_weil-$(TAG) shell
docker-sage: docker
docker run -it -e GIT_BRANCH=$(GIT_BRANCH) --init fqm_weil-$(TAG) run
clean:
rm -rf src/fqm_weil/modules/*.c
rm -rf src/fqm_weil/modules/*.so
rm -rf src/fqm_weil/modules/weil_module/*.c
rm -rf src/fqm_weil/modules/weil_module/*.so
rm -rf *.egg-info
rm -rf build
rm -rf dist
rm -rf Library
.PHONY: build sdist install test examples clean shell tox docker docker-examples docker-examples docker-rebuild \
docker-shell docker-test docker-tox