63
63
key : build-v1-{{ .Branch }}-{{ epoch }}
64
64
paths :
65
65
- /tmp/docker
66
+ - run :
67
+ name : Check version packaged in Docker image
68
+ command : |
69
+ THISVERSION=$(python3 setup.py --version)
70
+ THISVERSION=${CIRCLE_TAG:-$THISVERSION}
71
+ INSTALLED_VERSION=$(\
72
+ docker run -it --rm --entrypoint=python nitransforms \
73
+ -c 'import nitransforms as nit; print(nit.__version__)')
74
+ INSTALLED_VERSION=${INSTALLED_VERSION%$'\r'}
75
+ echo "VERSION: \"$THISVERSION\""
76
+ echo "INSTALLED: \"$INSTALLED_VERSION\""
77
+ test "$INSTALLED_VERSION" = "$THISVERSION"
78
+
66
79
- run :
67
80
name : Store FreeSurfer license file
68
81
command : |
@@ -125,16 +138,81 @@ jobs:
125
138
- store_test_results :
126
139
path : /tmp/tests/summaries/
127
140
128
- test_packaging_and_deploy :
129
- machine :
130
- image : circleci/classic:201808-01
141
+ test_package :
142
+ docker :
143
+ - image : circleci/python:3.7.4
144
+ working_directory : /tmp/src/nitransforms
145
+ steps :
146
+ - checkout
147
+ - run :
148
+ name : Setup Python environment with virtualenvs
149
+ command : |
150
+ python -m pip install --user --upgrade virtualenv pip
151
+ - run :
152
+ name : Prepare build environment
153
+ command : |
154
+ virtualenv --python=python3 /tmp/build
155
+ source /tmp/build/bin/activate
156
+ python3 -m pip install "setuptools ~= 42.0" "setuptools_scm[toml] >= 3.4" "pip>=10.0.1" \
157
+ twine docutils
158
+ - run :
159
+ name : Build NiTransforms in build environment
160
+ command : |
161
+ source /tmp/build/bin/activate
162
+ python setup.py sdist bdist_wheel
163
+ - run :
164
+ name : Check sdist package in build environment
165
+ command : |
166
+ source /tmp/build/bin/activate
167
+ twine check dist/nitransforms*
168
+ - store_artifacts :
169
+ path : /tmp/src/nitransforms/dist
170
+ - run :
171
+ name : Prepare sdist install environment
172
+ command : |
173
+ virtualenv --python=python3 /tmp/install_sdist
174
+ source /tmp/install_sdist/bin/activate
175
+ python3 -m pip install "setuptools ~= 42.0" "setuptools_scm[toml] >= 3.4" "pip>=10.0.1"
176
+ - run :
177
+ name : Install sdist package into install environment and check version
178
+ command : |
179
+ source /tmp/install_sdist/bin/activate
180
+ THISVERSION=$( python setup.py --version )
181
+ THISVERSION=${CIRCLE_TAG:-$THISVERSION}
182
+ pip install dist/nitransforms*.tar.gz
183
+ INSTALLED_VERSION=$(python -c 'import nitransforms as nit; print(nit.__version__)')
184
+ INSTALLED_VERSION=${INSTALLED_VERSION%$'\r'}
185
+ echo "VERSION: \"$THISVERSION\""
186
+ echo "INSTALLED: \"$INSTALLED_VERSION\""
187
+ test "$INSTALLED_VERSION" = "$THISVERSION"
188
+ - run :
189
+ name : Prepare wheel install environment
190
+ command : |
191
+ virtualenv --python=python3 /tmp/install_wheel
192
+ source /tmp/install_wheel/bin/activate
193
+ python3 -m pip install "setuptools ~= 42.0" "setuptools_scm[toml] >= 3.4" "pip>=10.0.1"
194
+ - run :
195
+ name : Install wheel into install environment and check version
196
+ command : |
197
+ source /tmp/install_wheel/bin/activate
198
+ THISVERSION=$( python setup.py --version )
199
+ THISVERSION=${CIRCLE_TAG:-$THISVERSION}
200
+ pip install dist/nitransforms*.whl
201
+ INSTALLED_VERSION=$(python -c 'import nitransforms as nit; print(nit.__version__)')
202
+ INSTALLED_VERSION=${INSTALLED_VERSION%$'\r'}
203
+ echo "VERSION: \"$THISVERSION\""
204
+ echo "INSTALLED: \"$INSTALLED_VERSION\""
205
+ test "$INSTALLED_VERSION" = "$THISVERSION"
206
+
207
+ deploy_pypi :
208
+ docker :
209
+ - image : circleci/python:3.7.4
131
210
working_directory : /tmp/src/nitransforms
132
211
steps :
133
212
- checkout
134
- - run : pyenv local 3.7.0
135
213
- run :
136
214
name : Install build depends
137
- command : python3 -m pip install "setuptools>=30.4.0 " "pip>=10.0.1" "twine<2.0" docutils
215
+ command : python3 -m pip install "setuptools ~= 42.0" "setuptools_scm[toml] >= 3.4 " "pip>=10.0.1" "twine<2.0" docutils
138
216
- run :
139
217
name : Build and check
140
218
command : |
@@ -144,7 +222,7 @@ jobs:
144
222
- run :
145
223
name : Validate version
146
224
command : |
147
- THISVERSION=$( python3 get_version .py )
225
+ THISVERSION=$( python setup .py --version )
148
226
python3 -m pip install dist/*.tar.gz
149
227
mkdir empty
150
228
cd empty
@@ -167,9 +245,18 @@ workflows:
167
245
tags :
168
246
only : /.*/
169
247
170
- - test_packaging_and_deploy :
248
+ - test_package :
249
+ filters :
250
+ branches :
251
+ ignore :
252
+ - /docs?\/.*/
253
+ tags :
254
+ only : /.*/
255
+
256
+ - deploy_pypi :
171
257
requires :
172
258
- build_pytest
259
+ - test_package
173
260
filters :
174
261
branches :
175
262
ignore : /.*/
0 commit comments