-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
108 lines (78 loc) · 2.27 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
# Build, package, test, and clean
PROJECT=polartoolkit
VERSION := $(shell grep -m 1 'version =' pyproject.toml | tr -s ' ' | tr -d '"' | tr -d "'" | cut -d' ' -f3)
print-% : ; @echo $* = $($*)
####
####
# install commands
####
####
create:
mamba env create --file environment.yml
install:
pip install --no-deps -e .
remove:
mamba env remove --name $(PROJECT) --yes
pip_install:
pip install $(PROJECT)[all]==$(VERSION)
conda_install:
mamba create --name $(PROJECT) --yes --force --channel conda-forge $(PROJECT)=$(VERSION) pytest pytest-cov deepdiff ipykernel
conda_export:
mamba env export --name $(PROJECT) --channel conda-forge --file env/environment.yml
####
####
# test commands
####
####
test:
pytest -m "not earthdata and not issue and not fetch"
test_fetch:
pytest -s -m fetch #-rp
####
####
# style commands
####
####
check:
pre-commit run --all-files
pylint:
pylint $(PROJECT)
style: check pylint
mypy:
mypy src/$(PROJECT)
####
####
# chore commands
####
####
release_check:
semantic-release --noop version
changelog:
semantic-release changelog
license-add:
python tools/license_notice.py
license-check:
python tools/license_notice.py --check
####
####
# doc commands
####
####
clear_datasets:
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace docs/datasets/**/*.ipynb
run_datasets: clear_datasets
jupyter nbconvert --ExecutePreprocessor.allow_errors=True --execute --inplace docs/datasets/**/*.ipynb
clear_tutorial:
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace docs/tutorial/*.ipynb
run_tutorial: clear_tutorial
jupyter nbconvert --ExecutePreprocessor.allow_errors=True --execute --inplace docs/tutorial/*.ipynb
clear_how_to:
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace docs/how_to/*.ipynb
run_how_to: clear_how_to
jupyter nbconvert --ExecutePreprocessor.allow_errors=True --execute --inplace docs/how_to/*.ipynb
clear_docs:
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace docs/*.ipynb
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace docs/**/*.ipynb
run_docs: clear_docs
jupyter nbconvert --ExecutePreprocessor.allow_errors=True --execute --inplace docs/*.ipynb
jupyter nbconvert --ExecutePreprocessor.allow_errors=True --execute --inplace docs/**/*.ipynb