-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
136 lines (110 loc) · 4.37 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
.DEFAULT_GOAL := init
.PHONY: prepare-dev install-dev help lint tests coverage upload-prod-pypi upload-test-pypi update_req update_req_dev pyclean doc doc-pdf visu-doc-pdf visu-doc tox licences
VENV = ".pds_crawler"
define PROJECT_HELP_MSG
Usage:\n
\n
make help\t\t\t show this message\n
\n
-------------------------------------------------------------------------\n
\t\tInstallation\n
-------------------------------------------------------------------------\n
make\t\t\t\t Install pds_crawler in the system (root)\n
make user\t\t\t Install pds_crawler 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 and pds_crawler for development purpose\n
make tests\t\t\t Run units and integration tests\n
\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 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
make update_req\t\t Update the version of the packages in requirements.txt\n
make update_req_dev\t\t Update the version of the packages in requirements_dev.txt\n
\n
make pyclean\t\t\t Clean .pyc files and __pycache__ directories\n
\n
-------------------------------------------------------------------------\n
\t\tOthers\n
-------------------------------------------------------------------------\n
make licences\t\t\t Display the list of licences\n
make version\t\t\t Display the version\n
make coverage\t\t\t Coverage\n
make lint\t\t\t Lint\n
make tox\t\t\t Run all tests\n
endef
export PROJECT_HELP_MSG
#Show help
#---------
help:
echo $$PROJECT_HELP_MSG
#
# Sotware Installation in the system (need root access)
# -----------------------------------------------------
#
init:
python3 setup.py install && pip install git+https://github.com/pdssp/pymarsseason.git && pip install git+https://github.com/J-Christophe/pystac.git
#
# 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 && pip install git+https://github.com/pdssp/pymarsseason.git
prepare-dev:
cp .pypirc ~${USER} && git init && echo "python3 -m venv pds_crawler-env && export PYTHONPATH=. && export PATH=`pwd`/pds_crawler-env/bin:"${PATH}"" > ${VENV} && echo "source \"`pwd`/pds_crawler-env/bin/activate\"" >> ${VENV} && scripts/install-hooks.bash && echo "\nnow source this file: \033[31msource ${VENV}\033[0m"
install-dev:
pip install --upgrade pip && pip install -r requirements.txt && pip install -r requirements_dev.txt && pre-commit install && pre-commit autoupdate && python3 setup.py develop
coverage: ## Run tests with coverage
coverage erase
coverage run --include=pds_crawler/* -m pytest -ra
coverage report -m
lint: ## Lint and static-check
flake8 --ignore=E203,E266,E501,W503,F403,F401 --max-line-length=79 --max-complexity=18 --select=B,C,E,F,W,T4,B9 pds_crawler
pylint pds_crawler
mypy pds_crawler
tests: ## Run tests
pytest -ra
tox:
tox -e py37
doc: # make html -C docs
make licences > third_party.txt
rm -rf docs/source/_static/coverage
pytest -ra --html=docs/source/_static/report.html
make coverage
coverage html -d docs/source/_static/coverage
sphinx-multiversion docs/source docs/build/html
cp docs/source/_static/index.html docs/build/html/index.html
doc-pdf:
make doc && make latexpdf -C docs
visu-doc-pdf:
acroread docs/build/latex/pds_crawler.pdf
visu-doc:
firefox docs/build/html/index.html
release:
python3 setup.py sdist
version:
python3 setup.py --version
upload-test-pypi:
flit publish --repository pypitest
upload-prod-pypi:
flit publish
licences:
pip-licenses
update_req:
pur -r requirements.txt
update_req_dev:
pur -r requirements_dev.txt
pyclean:
find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete