-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
98 lines (80 loc) · 2.96 KB
/
Makefile
File metadata and controls
98 lines (80 loc) · 2.96 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
96
97
98
.DEFAULT_GOAL := help
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = _build
VERSION="None"
NAME="None"
SCRIPT="all"
# Assuming that the Makefile is located in the root directory of the project
ROOT_DIR = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
help:
@echo "\x1b[31m"
@echo "Please specify what do you want to do!"
@echo "\x1b[0m"
@echo "Available options are:\n"
@echo " help - show this message"
@echo " html - build the html docs"
@echo " clean-html - clean all files from docs and build html docs from scrutch"
@echo " html-from-zero - html from absolute zero (replot everything)"
@echo " doctest - run doctests"
@echo " clean - clean all files from docs and pip routines"
@echo " install - install the package"
@echo " test - execute unit tests"
@echo " test-all - execute full testing suite"
@echo " docs-index - Update graphics of the index page"
@echo " docs-generate-images - update pictures for the docs"
@echo " requirements - installs all requirements (package + dev + tests + docs)"
@echo
# $(O) is meant as a shortcut for $(SPHINXOPTS).
html:
@python tools/produce-constants-api.py
@$(SPHINXBUILD) -M html "docs/$(SOURCEDIR)" "docs/$(BUILDDIR)" $(SPHINXOPTS) $(O)
clean-html: clean install html
@echo "Done"
html-from-zero: clean install docs-generate-images docs-generate-bl-gallery docs-index html
@echo "Done"
doctest:
@$(SPHINXBUILD) -b doctest "docs/$(SOURCEDIR)" "docs/$(BUILDDIR)" $(SPHINXOPTS) $(O)
clean:
-@rm -r docs/_build
-@rm -r docs/source/api/generated
-@rm -r docs/source/api/crystal/generated
-@rm -r docs/source/api/_autosummary
-@rm -r wulfric.egg-info
-@rm -r build
-@rm -r dist
-@rm -r .env*/lib/python*/site-packages/wulfric*
-@rm -r .env*/bin/wulfric*
-@rm -r .venv*/lib/python*/site-packages/wulfric*
-@rm -r .venv*/bin/wulfric*
-@rm -r docs/source/user-guide/conventions/bravais-lattices
-@rm -r docs/source/user-guide/usage/visualization
install:
@python3 -m pip install .
test:
@pytest -s
test-all: html-from-zero test doctest
@echo "Done"
docs-index:
@python tools/make-index-graphics.py
docs-generate-images:
@python3 tools/plot-repositories.py
@python3 tools/plot-cell-choices.py
@python3 tools/plot-cell-derivatives.py
@python3 tools/plot-niggli-step-4.py
docs-generate-bl-gallery:
-@rm docs/source/user-guide/conventions/sg-source_bravais-lattices/1_hpkot/plot_*.py
@python tools/generate-bl-hpkot-gallery.py
-@rm docs/source/user-guide/conventions/sg-source_bravais-lattices/2_sc/plot_*.py
@python tools/generate-bl-sc-gallery.py
.ONESHELL:
requirements:
@pip install -r requirements.txt --no-cache
@pip install -r requirements-dev.txt --no-cache
@pip install -r docs/requirements.txt --no-cache
@pip install -r tests/requirements.txt --no-cache
release-check:
@python tools/check-release-metadata.py -rd . -v $(VERSION)