@@ -2,7 +2,7 @@ version: 2
22jobs :
33 build_pytest :
44 machine :
5- image : ubuntu-2004:202107-02
5+ image : default
66 working_directory : /tmp/src/nitransforms
77 environment :
88 TZ : " /usr/share/zoneinfo/America/Los_Angeles"
1212 - checkout
1313 - restore_cache :
1414 keys :
15- - env-v3 -{{ .Branch }}-
16- - env-v3 -master-
17- - env-v3 -
15+ - env-v6 -{{ .Branch }}-
16+ - env-v6 -master-
17+ - env-v6 -
1818 - run :
1919 name : Setup git-annex
2020 command : |
@@ -29,17 +29,14 @@ jobs:
2929 - run :
3030 name : Setup DataLad
3131 command : |
32- export PY3=$(pyenv versions | grep '3\.' |
33- sed -e 's/.* 3\./3./' -e 's/ .*//')
34- pyenv local $PY3
35- python -m pip install --no-cache-dir -U pip "setuptools >= 45.0" "setuptools_scm[toml] >= 3.4"
36- python -m pip install --no-cache-dir -U datalad datalad-osf
32+ python3 -m pip install --no-cache-dir -U pip "setuptools >= 45.0" "setuptools_scm[toml] >= 6.2"
33+ python3 -m pip install --no-cache-dir -U datalad datalad-osf
3734
3835 - save_cache :
39- key : env-v3 -{{ .Branch }}-{{ .BuildNum }}
36+ key : env-v6 -{{ .Branch }}-{{ .BuildNum }}
4037 paths :
4138 - /opt/circleci/git-annex.linux
42- - /opt/circleci/.pyenv/versions/3.9.4
39+ - /opt/circleci/.pyenv/versions
4340
4441 - restore_cache :
4542 keys :
4946 - run :
5047 name : Install test data from GIN
5148 command : |
52- export PY3=$(pyenv versions | grep '3\.' |
53- sed -e 's/.* 3\./3./' -e 's/ .*//')
54- pyenv local $PY3
5549 export PATH=/opt/circleci/git-annex.linux:$PATH
50+ pyenv local 3
51+ eval "$(pyenv init --path)"
5652 mkdir -p /tmp/data
5753 cd /tmp/data
5854 datalad install -r https://gin.g-node.org/oesteban/nitransforms-tests
@@ -98,15 +94,12 @@ jobs:
9894 name : Build Docker image & push to registry
9995 no_output_timeout : 60m
10096 command : |
101- export PY3=$(pyenv versions | grep '3\.' |
102- sed -e 's/.* 3\./3./' -e 's/ .*//')
103- pyenv local $PY3
10497 e=1 && for i in {1..5}; do
10598 docker build --rm --cache-from=nitransforms:latest \
10699 -t nitransforms:latest \
107100 --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
108101 --build-arg VCS_REF=`git rev-parse --short HEAD` \
109- --build-arg VERSION=$( python3 setup.py --version ) . \
102+ --build-arg VERSION=$( python3 -m setuptools_scm ) . \
110103 && e=0 && break || sleep 15
111104 done && [ "$e" -eq "0" ]
112105 docker tag nitransforms:latest localhost:5000/nitransforms
@@ -123,10 +116,7 @@ jobs:
123116 - run :
124117 name : Check version packaged in Docker image
125118 command : |
126- export PY3=$(pyenv versions | grep '3\.' |
127- sed -e 's/.* 3\./3./' -e 's/ .*//')
128- pyenv local $PY3
129- THISVERSION=${CIRCLE_TAG:-$(python3 setup.py --version)}
119+ THISVERSION=${CIRCLE_TAG:-$(python3 -m setuptools_scm)}
130120 INSTALLED_VERSION=$(\
131121 docker run -it --rm --entrypoint=python nitransforms \
132122 -c 'import nitransforms as nit; print(nit.__version__, end="")' )
@@ -141,13 +131,14 @@ jobs:
141131 echo "cHJpbnRmICJrcnp5c3p0b2YuZ29yZ29sZXdza2lAZ21haWwuY29tXG41MTcyXG4gKkN2dW12RVYzelRmZ1xuRlM1Si8yYzFhZ2c0RVxuIiA+IGxpY2Vuc2UudHh0Cg==" | base64 -d | sh
142132 - run :
143133 name : Get codecov
144- command : python -m pip install codecov
134+ command : python3 -m pip install codecov
145135 - run :
146136 name : Run unit tests
147137 no_output_timeout : 2h
148138 command : |
149139 mkdir -p /tmp/tests/{artifacts,summaries}
150- docker run -u $( id -u ) -it --rm -w /src/nitransforms \
140+ docker run -u $( id -u ) -it --rm \
141+ -w /src/nitransforms -v $PWD:/src/nitransforms \
151142 -v /tmp/data/nitransforms-tests:/data -e TEST_DATA_HOME=/data \
152143 -e COVERAGE_FILE=/tmp/summaries/.pytest.coverage \
153144 -v /tmp/fslicense/license.txt:/opt/freesurfer/license.txt:ro \
@@ -159,7 +150,7 @@ jobs:
159150 name : Submit unit test coverage
160151 command : |
161152 cd /tmp/src/nitransforms
162- python -m codecov --file /tmp/tests/summaries/unittests.xml \
153+ python3 -m codecov --file /tmp/tests/summaries/unittests.xml \
163154 --flags unittests -e CIRCLE_JOB
164155 - run :
165156 name : Clean up tests directory
@@ -186,9 +177,9 @@ jobs:
186177 command : |
187178 python3 -m venv /tmp/buildenv
188179 source /tmp/buildenv/bin/activate
189- python3 -m pip install "setuptools >= 45.0" wheel "setuptools_scm[toml] >= 3.4 " \
180+ python3 -m pip install "setuptools >= 45.0" build wheel "setuptools_scm[toml] >= 6.2 " \
190181 "pip>=10.0.1" twine docutils
191- python setup.py sdist bdist_wheel
182+ python3 -m build
192183 twine check dist/nitransforms*
193184 - store_artifacts :
194185 path : /tmp/src/nitransforms/dist
@@ -200,9 +191,9 @@ jobs:
200191 command : |
201192 python3 -m venv /tmp/install_sdist
202193 source /tmp/install_sdist/bin/activate
203- python3 -m pip install "setuptools >= 45.0" "pip>=10.0.1"
194+ python3 -m pip install "setuptools >= 45.0" "pip>=10.0.1" "setuptools_scm[toml] >= 6.2"
204195
205- THISVERSION=$( python3 setup.py --version )
196+ THISVERSION=$( python3 -m setuptools_scm )
206197 THISVERSION=${CIRCLE_TAG:-$THISVERSION}
207198 python3 -m pip install dist/nitransforms*.tar.gz
208199 INSTALLED_VERSION=$(python3 -c 'import nitransforms as nit; print(nit.__version__, end="")')
@@ -214,9 +205,9 @@ jobs:
214205 command : |
215206 python3 -m venv /tmp/install_wheel
216207 source /tmp/install_wheel/bin/activate
217- python3 -m pip install "setuptools >= 45.0" "pip>=10.0.1"
208+ python3 -m pip install "setuptools >= 45.0" "pip>=10.0.1" "setuptools_scm[toml] >= 6.2"
218209
219- THISVERSION=$( python3 setup.py --version )
210+ THISVERSION=$( python3 -m setuptools_scm )
220211 THISVERSION=${CIRCLE_TAG:-$THISVERSION}
221212 python3 -m pip install dist/nitransforms*.whl
222213 INSTALLED_VERSION=$(python3 -c 'import nitransforms as nit; print(nit.__version__, end="")')
0 commit comments