Skip to content

Commit

Permalink
RF: Drop get_version.py for hatch version
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Jan 6, 2023
1 parent c493474 commit e3d3c36
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 31 deletions.
25 changes: 13 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ jobs:
export PY3=$(pyenv versions | grep '3\.' |
sed -e 's/.* 3\./3./' -e 's/ .*//')
pyenv local $PY3
pip install hatch
# Get version, update files.
THISVERSION=$( python3 get_version.py )
THISVERSION=$( hatch version )
if [[ ${THISVERSION:0:1} == "0" ]] ; then
echo "WARNING: latest git tag could not be found"
echo "Please, make sure you fetch all tags from upstream with"
Expand All @@ -184,7 +185,7 @@ jobs:
sed -e 's/.* 3\./3./' -e 's/ .*//')
pyenv local $PY3
# Get version, update files.
THISVERSION=$( python3 get_version.py )
THISVERSION=$( hatch version )
BUILT_VERSION=$( docker run --rm nipreps/fmriprep:latest --version )
BUILT_VERSION=${BUILT_VERSION%$'\r'}
BUILT_VERSION=${BUILT_VERSION#*"fMRIPrep v"}
Expand Down Expand Up @@ -911,7 +912,7 @@ jobs:
- checkout
- run:
name: Update build tools
command: python -m pip install --user pip build twine
command: pip install --upgrade pip build twine hatch
- run:
name: Build fMRIPrep
command: python -m build
Expand All @@ -920,8 +921,8 @@ jobs:
- run:
name: Check sdist distribution
command: |
THISVERSION=$( python get_version.py )
THISVERSION=${THISVERSION%.dirty*}
THISVERSION=$( hatch version )
THISVERSION=${THISVERSION%.d*}
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
python -m twine check dist/fmriprep*.tar.gz
virtualenv --python=python sdist
Expand All @@ -938,8 +939,8 @@ jobs:
- run:
name: Check wheel distribution
command: |
THISVERSION=$( python get_version.py )
THISVERSION=${THISVERSION%.dirty*}
THISVERSION=$( hatch version )
THISVERSION=${THISVERSION%.d*}
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
python -m twine check dist/fmriprep*.whl
virtualenv --python=python wheel
Expand All @@ -955,8 +956,8 @@ jobs:
- run:
name: Build fmriprep-docker
command: |
THISVERSION=$( python get_version.py )
THISVERSION=${THISVERSION%.dirty*}
THISVERSION=$( hatch version )
THISVERSION=${THISVERSION%.d*}
sed -i -E "s/(__version__ = )'[A-Za-z0-9.-]+'/\1'${CIRCLE_TAG:-$THISVERSION}'/" wrapper/fmriprep_docker.py
python -m build wrapper/
- store_artifacts:
Expand All @@ -968,15 +969,15 @@ jobs:
- checkout
- run:
name: Update build tools
command: python -m pip install --user build twine
command: pip install --upgrade pip build twine hatch
- run:
name: Build fMRIPrep
command: python -m build
- run:
name: Build fmriprep-docker
command: |
THISVERSION=$( python get_version.py )
THISVERSION=${THISVERSION%.dirty*}
THISVERSION=$( hatch version )
THISVERSION=${THISVERSION%.d*}
sed -i -E "s/(__version__ = )'[A-Za-z0-9.-]+'/\1'${CIRCLE_TAG:-$THISVERSION}'/" wrapper/fmriprep_docker.py
python -m build wrapper/
- run:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ docker-build:
docker build --rm -t $(tag) \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VERSION=`python get_version.py` .
--build-arg VERSION=`hatch version` .
18 changes: 0 additions & 18 deletions get_version.py

This file was deleted.

0 comments on commit e3d3c36

Please sign in to comment.