-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
98 lines (80 loc) · 2.3 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
# Python makefile https://krzysztofzuraw.com/blog/2016/makefiles-in-python-projects.html
# Delcare all non-file targets as phony
.PHONY: clean clean-build clean-data data isort lint test
TEST_PATH=./
help:
@echo " clean-pyc"
@echo " Remove python artifacts."
@echo " clean-build"
@echo " Remove build artifacts."
@echo " clean-data"
@echo " Remove test data."
@echo " atmos"
@echo " Prepare atmosphere model data."
@echo " isort"
@echo " Sort import statements."
@echo " lint"
@echo " Check style with flake8."
@echo " test"
@echo " Run py.test"
@echo " init"
@echo " Initialise by installing requirements"
@echo " init-dev"
@echo " Initialise by installing normal and dev requirements"
@echo " cov"
@echo " Produce coverage report"
@echo " mypy"
@echo " Run type checking with mypy"
@echo " pdf"
@echo " Make pdf from paper.md"
@echo " publish_setup"
@echo " Update the tools for distribution."
@echo " build_dist"
@echo " Build the distribution of eniric."
@echo " pypi_test"
@echo " Publish eniric to Test PyPi."
@echo " pypi_publish"
@echo " Publish eniric to PyPi."
clean-pyc:
find . -name '*.pyc' -exec rm --force {} +
find . -name '*.pyo' -exec rm --force {} +
find . -name '*~' -exec rm --force {} +
clean-data:
rm --force --recursive data/
rm --force --recursive tests/data/phoenix-raw
rm --force --recursive tests/data/btsettl-raw
atmos:
split_atmmodel.py -b ALL
barycenter_broaden_atmmodel.py -b ALL
clean-build:
rm --force --recursive build/
rm --force --recursive dist/
rm --force --recursive *.egg-info
isort:
sh -c "isort --recursive . "
lint:
flake8 --exclude=.tox
test: clean-pyc
py.test --color=yes $(TEST_PATH)
init:
pip install -r requirements.txt
init-dev:
pip install -r requirements.txt
pip install -r requirements_dev.txt
cov: $(module)/*
py.test --cov=$(module)
coverage html
mypy:
# py.test --mypy
mypy --ignore-missing-imports .
pdf:
pip install pandoc>=1.0.2
(cd paper && pandoc --filter pandoc-citeproc --bibliography=paper.bib --variable classoption=onecolumn --variable papersize=a4paper -s paper.md -o paper.pdf)
publish_setup:
pip install --upgrade twine setuptools wheel
build_dist:
python setup.py sdist bdist_wheel
pypi_test:
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
pypi_publish:
twine upload dist/*