forked from sentinel-hub/eo-learn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
176 lines (140 loc) · 3.87 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# Makefile for creating a new release of the package and uploading it to PyPI
PYTHON = python3
PACKAGES = core coregistration features geometry io mask ml_tools visualization
PYLINT = pylint
.PHONY: $(PACKAGES:test)
.SILENT: pylint pylint-fast
help:
@echo "Use 'make upload-<package>' to upload the package to PyPi"
@echo "Use 'make pylint' to run pylint on the code of all subpackages"
pylint:
# Runs pylint on all subpackages consecutively and makes sure any error status code gets propagated.
export PYLINT_STATUS=0
for package in $(PACKAGES) ; do \
$(PYLINT) $$package/eolearn/$$package || export PYLINT_STATUS=$$?; \
done;
exit $$PYLINT_STATUS
pylint-fast:
# Runs pylint on all subpackages in parallel. Because of that output verdicts are not in the order of package
# names and this process cannot be interrupted.
for package in $(PACKAGES) ; do \
$(PYLINT) $$package/eolearn/$$package & \
done;
wait
.ONESHELL:
build-core:
cd core
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE
.ONESHELL:
build-coregistration:
cd coregistration
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE
.ONESHELL:
build-features:
cd features
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE
.ONESHELL:
build-geometry:
cd geometry
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE
.ONESHELL:
build-io:
cd io
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE
.ONESHELL:
build-mask:
cd mask
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE
.ONESHELL:
build-ml-tools:
cd ml_tools
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE
.ONESHELL:
build-visualization:
cd visualization
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE
.ONESHELL:
build-abstract-package:
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
upload-core: build-core
twine upload core/dist/*
upload-coregistration: build-coregistration
twine upload coregistration/dist/*
upload-features: build-features
twine upload features/dist/*
upload-geometry: build-geometry
twine upload geometry/dist/*
upload-io: build-io
twine upload io/dist/*
upload-mask: build-mask
twine upload mask/dist/*
upload-ml-tools: build-ml-tools
twine upload ml_tools/dist/*
upload-visualization: build-visualization
twine upload visualization/dist/*
upload-abstract-package: build-abstract-package
twine upload dist/*
upload-all: \
upload-core \
upload-coregistration \
upload-features \
upload-geometry \
upload-io \
upload-mask \
upload-ml-tools \
upload-visualization \
upload-abstract-package
# For testing:
test-upload-core: build-core
twine upload --repository testpypi core/dist/*
test-upload-coregistration: build-coregistration
twine upload --repository testpypi coregistration/dist/*
test-upload-features: build-features
twine upload --repository testpypi features/dist/*
test-upload-geometry: build-geometry
twine upload --repository testpypi geometry/dist/*
test-upload-io: build-io
twine upload --repository testpypi io/dist/*
test-upload-mask: build-mask
twine upload --repository testpypi mask/dist/*
test-upload-ml-tools: build-ml-tools
twine upload --repository testpypi ml_tools/dist/*
test-upload-visualization: build-visualization
twine upload --repository testpypi visualization/dist/*
test-upload-abstract-package: build-abstract-package
twine upload --repository testpypi dist/*
test-upload-all: \
test-upload-core \
test-upload-coregistration \
test-upload-features \
test-upload-geometry \
test-upload-io \
test-upload-mask \
test-upload-ml-tools \
test-upload-visualization \
test-upload-abstract-package