Skip to content

Commit 278cc49

Browse files
committed
Use versioningit; eliminate bump2version
1 parent b4c4e77 commit 278cc49

File tree

12 files changed

+49
-30
lines changed

12 files changed

+49
-30
lines changed

.autorc

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,5 @@
33
"baseBranch": "master",
44
"author": "auto <auto@nil>",
55
"noVersionPrefix": false,
6-
"plugins": [
7-
"git-tag",
8-
[
9-
"exec",
10-
{
11-
"afterChangelog": "bump2version \"$(printf '%s\n' \"$ARG_0\" | jq -r .bump)\"",
12-
"afterRelease": "python -m build && twine upload dist/*"
13-
}
14-
]
15-
]
6+
"plugins": ["git-tag"]
167
}

.bumpversion.cfg

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,20 @@ jobs:
4040

4141
- name: Install Python dependencies
4242
if: steps.auto-version.outputs.version != ''
43-
run: python -m pip install build bump2version twine
43+
run: python -m pip install build twine
4444

4545
- name: Create release
4646
if: steps.auto-version.outputs.version != ''
4747
run: ~/auto shipit
4848
env:
4949
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Build & upload to PyPI
52+
if: steps.auto-version.outputs.version != ''
53+
run: |
54+
python -m build
55+
twine upload dist/*
56+
env:
5057
TWINE_USERNAME: __token__
5158
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
5259

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
venvs/
77
_build/
88
build/
9+
dist/
910
.vscode/
10-

.readthedocs.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
formats: all
3+
python:
4+
install:
5+
- requirements: docs/requirements.txt
6+
- method: pip
7+
path: .
8+
build:
9+
os: ubuntu-20.04
10+
tools:
11+
python: "3"
12+
sphinx:
13+
configuration: docs/conf.py
14+
fail_on_warning: true

docs/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@
1919

2020
# -- Project information -----------------------------------------------------
2121

22+
from heudiconv import __version__
23+
2224
project = 'heudiconv'
2325
copyright = '2019, Heudiconv team'
2426
author = 'Heudiconv team'
2527

2628
# The short X.Y version
2729
version = ''
2830
# The full version, including alpha/beta/rc tags
29-
release = '0.10.0'
31+
release = __version__
3032

3133

3234
# -- General configuration ---------------------------------------------------

docs/installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ If `Docker <https://docs.docker.com/install/>`_ is available on your system, you
2626
can visit `our page on Docker Hub <https://hub.docker.com/r/nipy/heudiconv/tags>`_
2727
to view available releases. To pull the latest release, run::
2828

29-
$ docker pull nipy/heudiconv:0.10.0
29+
$ docker pull nipy/heudiconv:latest
3030

3131

3232
Singularity
@@ -35,4 +35,4 @@ If `Singularity <https://www.sylabs.io/singularity/>`_ is available on your syst
3535
you can use it to pull and convert our Docker images! For example, to pull and
3636
build the latest release, you can run::
3737

38-
$ singularity pull docker://nipy/heudiconv:0.10.0
38+
$ singularity pull docker://nipy/heudiconv:latest

docs/usage.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The second script processes a DICOM directory with ``heudiconv`` using the built
8282
DCMDIR=${DCMDIRS[${SLURM_ARRAY_TASK_ID}]}
8383
echo Submitted directory: ${DCMDIR}
8484
85-
IMG="/singularity-images/heudiconv-0.10.0-dev.sif"
85+
IMG="/singularity-images/heudiconv-latest-dev.sif"
8686
CMD="singularity run -B ${DCMDIR}:/dicoms:ro -B ${OUTDIR}:/output -e ${IMG} --files /dicoms/ -o /output -f reproin -c dcm2niix -b notop --minmeta -l ."
8787
8888
printf "Command:\n${CMD}\n"
@@ -97,7 +97,7 @@ This script creates the top-level bids files (e.g.,
9797
set -eu
9898

9999
OUTDIR=${1}
100-
IMG="/singularity-images/heudiconv-0.10.0-dev.sif"
100+
IMG="/singularity-images/heudiconv-latest-dev.sif"
101101
CMD="singularity run -B ${OUTDIR}:/output -e ${IMG} --files /output -f reproin --command populate-templates"
102102

103103
printf "Command:\n${CMD}\n"

heudiconv/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# set logger handler
22
import logging
33
import os
4-
from .info import (__version__, __packagename__)
4+
from .info import __packagename__
5+
6+
try:
7+
from importlib.metadata import version
8+
except ImportError:
9+
from importlib_metadata import version
10+
11+
__version__ = version(__name__)
512

613
# Rudimentary logging support.
714
lgr = logging.getLogger(__name__)

heudiconv/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
__version__ = "0.10.0"
21
__author__ = "HeuDiConv team and contributors"
32
__url__ = "https://github.com/nipy/heudiconv"
43
__packagename__ = 'heudiconv'
@@ -29,6 +28,7 @@
2928
'dcmstack>=0.8',
3029
'etelemetry',
3130
'filelock>=3.0.12',
31+
'importlib-metadata; python_version < "3.8"',
3232
]
3333

3434
TESTS_REQUIRES = [

0 commit comments

Comments
 (0)