-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
146 lines (116 loc) · 4.64 KB
/
Makefile
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#########################################################################
# #
# Project management utilities #
# ---------------------------- #
# #
#########################################################################
define PROJECT_HELP_MSG
Usage:\n
\n
make help\t\t\t show this message\n
\n
-------------------------------------------------------------------------\n
\t\tInstallation and start/stop the server\n
-------------------------------------------------------------------------\n
make\t\t\t\t Install lisacattools in the system (root)\n
make user\t\t\t Install lisacattools for non-root usage\n
\n
-------------------------------------------------------------------------\n
\t\tDevelopment\n
-------------------------------------------------------------------------\n
make prepare-dev\t\t Prepare Development environment\n
make install-dev\t\t Install COTS\n
make data\t\t\t Download data\n
make test\t\t\t Run units and integration tests\n
make quality\t\t\t Run quality tests\n
make tox\t\t\t Tests in several environments\n
\n
make demo\t\t\t Play the demo\n
make doc\t\t\t Generate the documentation\n
make doc-pdf\t\t\t Generate the documentation as PDF\n
make visu-doc-pdf\t\t View the generated PDF\n
make visu-doc\t\t\t View the generated documentation\n
\n
make release\t\t\t Release the package as tar.gz\n
make conda\t\t\t Make conda package from Pypi\n
make release-pypi\t\t Release the package for pypi\n
make upload-test-pypi\t\t Upload the pypi package on the test platform\n
make upload-prod-pypi\t\t Upload the pypi package on the prod platform\n
\n
-------------------------------------------------------------------------\n
\t\tOthers\n
-------------------------------------------------------------------------\n
make licences\t\t\t Display the list of licences
endef
export PROJECT_HELP_MSG
VENV = ".lisacattools-env"
#
# Sotware Installation in the system (need root access)
# -----------------------------------------------------
#
init:
python3 setup.py install
#
# Sotware Installation for user
# -----------------------------
# This scheme is designed to be the most convenient solution for users
# that don’t have write permission to the global site-packages directory or
# don’t want to install into it.
#
user:
python3 setup.py install --user
#Show help
#---------
help:
echo $$PROJECT_HELP_MSG
#
# Development - prepare env
# ----------------------------------
#
prepare-dev:
echo "python3 -m venv lisacattools-env && export PYTHONPATH=." > .lisacattools-env && echo "source \"`pwd`/lisacattools-env/bin/activate\"" >> .lisacattools-env && scripts/install-hooks.bash && echo "\nnow source this file: \033[31msource ${VENV}\033[0m"
install-dev:
pip install -r requirements.txt && pip install -r requirements-dev.txt && pre-commit install && pre-commit autoupdate
data:
pip install -r requirements-data.txt && python scripts/data_download.py
#
# Development - create doc and tests
# ----------------------------------
#
doc:
make test && cp tests/results/*.html docs/source/_static/ && cp -r tests/results/coverage docs/source/_static/ && make html -C docs
doc-pdf:
make doc && make latexpdf -C docs
visu-doc-pdf:
acroread docs/build/latex/lisacattools.pdf
visu-doc:
firefox docs/build/html/index.html
test:
make data && scripts/run-tests.bash
quality:
pre-commit run --all-files
tox:
pyenv local 3.8 3.9 3.10 && tox
#
# Create distribution
# ----------------------------------
#
changelog:
pip install -r requirements-release.txt && gitchangelog > CHANGELOG
clean:
rm -rf dist/ build/ lisacattools.egg-info/ docs/source/examples_* && make clean -C docs && find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
release:
make clean && make changelog && python3 setup.py sdist
conda:
bash scripts/to_conda.bash
release-pypi:
make clean && make changelog && python3 setup.py sdist bdist_wheel && lisacattools-env/bin/twine check dist/*
upload-test-pypi:
lisacattools-env/bin/twine check dist/* && lisacattools-env/bin/twine upload --repository-url https://test.pypi.org/legacy/ dist/*
upload-prod-pypi:
lisacattools-env/bin/twine check dist/* && lisacattools-env/bin/twine upload --repository-url https://pypi.org/legacy/ dist/*
demo:
make data && pip install -r requirements-demo.txt && ./lisacattools-env/bin/jupyter-notebook tutorial/MBHdemo.ipynb
licences:
pip-licenses
.PHONY: help user prepare-dev install-dev doc visu-doc test tox changelog clean release release-pypi upload-test-pypi upload-prod-pypi demo licences conda