Skip to content

Commit 5b20166

Browse files
authored
Merge pull request #265 from mgxd/mnt/flit-scm
MAINT: Drop versioneer for hatch backend, fully embrace pyproject.toml
2 parents 957b2b8 + 44eee95 commit 5b20166

33 files changed

+531
-3342
lines changed

.circleci/config.yml

Lines changed: 109 additions & 89 deletions
Large diffs are not rendered by default.

.dockerignore

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,9 @@ nibabies.egg-info
1313
.eggs/**/*
1414
.eggs
1515

16-
# housekeeping tools
17-
get_version.py
18-
update_changes.sh
19-
tox.ini
20-
21-
# pip installs
22-
src/**/*
23-
src/
24-
25-
# git
26-
.gitignore
27-
.git/**/*
28-
.git
29-
3016
# other
3117
testdata/
3218
work/**/*
3319
work
3420
out/**/*
3521
out/
36-
37-
# CI, etc.
38-
.circleci
39-
.circleci/**/*
40-
.zenodo.json
41-
.travis.yml
42-
.readthedocs.yml
43-
CONTRIBUTING.md

.git_archival.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4+
ref-names: $Format:%D$

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nibabies/_version.py export-subst
1+
.git_archival.txt export-subst

.github/workflows/style.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
python-version: ${{ matrix.python-version }}
3333
- name: Install dependencies
3434
run: |
35-
pip install $(grep -e "black" -e "isort" setup.cfg | sed "s/ //g" | tr "\n" " ")
35+
pip install black isort
3636
- name: black code formatting check
3737
run: |
3838
black --check nibabies/

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,5 @@ ENV/
9898
work/
9999
testdata/
100100
.vscode/
101+
102+
_version.py

.readthedocs.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
version: 2
22

3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.10"
7+
jobs:
8+
post_checkout:
9+
- git fetch --unshallow
10+
311
python:
4-
version: 3.8
512
install:
613
- requirements: docs/requirements.txt
714
- method: pip

Dockerfile

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
# Build wheel separately
2+
FROM python:slim AS src
3+
RUN pip install build
4+
RUN apt-get update && \
5+
apt-get install -y --no-install-recommends git
6+
COPY . /src/nibabies
7+
RUN python -m build /src/nibabies
8+
19
# Ubuntu 20.04 LTS
2-
FROM ubuntu:focal-20210827
10+
FROM ubuntu:focal-20221130
311
ENV DEBIAN_FRONTEND="noninteractive" \
412
LANG="en_US.UTF-8" \
513
LC_ALL="en_US.UTF-8"
614

7-
# Pre-cache neurodebian key
8-
COPY docker/files/neurodebian.gpg /usr/local/etc/neurodebian.gpg
9-
1015
# Prepare environment
1116
RUN apt-get update && \
1217
apt-get install -y --no-install-recommends \
@@ -24,22 +29,14 @@ RUN apt-get update && \
2429
pandoc \
2530
pandoc-citeproc \
2631
pkg-config \
32+
unzip \
2733
xvfb && \
2834
curl -sSL https://deb.nodesource.com/setup_14.x | bash - && \
2935
apt-get install -y --no-install-recommends \
3036
nodejs && \
3137
locale-gen en_US.UTF-8 && \
3238
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
3339

34-
# Installing Neurodebian packages (workbench, git-annex)
35-
RUN curl -sSL "http://neuro.debian.net/lists/$( lsb_release -c | cut -f2 ).us-ca.full" >> /etc/apt/sources.list.d/neurodebian.sources.list && \
36-
apt-key add /usr/local/etc/neurodebian.gpg && \
37-
(apt-key adv --refresh-keys --keyserver hkp://ha.pool.sks-keyservers.net 0xA5D32F012649A5A9 || true)
38-
RUN apt-get update && \
39-
apt-get install -y --no-install-recommends \
40-
connectome-workbench=1.5.0-1~nd20.04+1 && \
41-
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
42-
4340
# Installing ANTs 2.3.4 (NeuroDocker build)
4441
ENV ANTSPATH="/usr/lib/ants" \
4542
PATH="/usr/lib/ants:$PATH"
@@ -221,8 +218,19 @@ ENV PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
221218
MNI_PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
222219
PATH="$FREESURFER_HOME/bin:$FREESURFER_HOME/tktools:$MINC_BIN_DIR:$PATH"
223220

221+
# Workbench
222+
WORKDIR /opt
223+
RUN curl -sSLO https://www.humanconnectome.org/storage/app/media/workbench/workbench-linux64-v1.5.0.zip && \
224+
unzip workbench-linux64-v1.5.0.zip && \
225+
rm workbench-linux64-v1.5.0.zip && \
226+
rm -rf /opt/workbench/libs_linux64_software_opengl /opt/workbench/plugins_linux64 && \
227+
strip --remove-section=.note.ABI-tag /opt/workbench/libs_linux64/libQt5Core.so.5
228+
# ABI tags can interfere when running on Singularity/Apptainer
229+
ENV PATH="/opt/workbench/bin_linux64:$PATH" \
230+
LD_LIBRARY_PATH="/opt/workbench/lib_linux64:$LD_LIBRARY_PATH"
231+
224232
# Installing SVGO and bids-validator
225-
RUN npm install -g svgo@^2.3 [email protected].0 \
233+
RUN npm install -g svgo@^2.3 [email protected].9 \
226234
&& rm -rf ~/.npm ~/.empty /root/.npm
227235

228236
# ICA AROMA
@@ -238,8 +246,8 @@ RUN useradd -m -s /bin/bash -G users nibabies
238246
WORKDIR /home/nibabies
239247
ENV HOME="/home/nibabies"
240248

241-
# py39_0525.0
242-
COPY --from=nipreps/miniconda@sha256:40fffd37963502dcd8549773559fc21182f52460e59e0ad6398a84faf6055641 /opt/conda /opt/conda
249+
# py39_2209.01
250+
COPY --from=nipreps/miniconda@sha256:8894ca17e3c8ba963812a6876093463eab6b88871bcfe23f71ebc84cf38451db /opt/conda /opt/conda
243251

244252
RUN ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
245253
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
@@ -255,32 +263,26 @@ ENV PATH="/opt/conda/bin:$PATH" \
255263
CONDA_PYTHON="/opt/conda/bin/python"
256264

257265
# Precaching atlases
258-
COPY setup.cfg nibabies-setup.cfg
259266
COPY scripts/fetch_templates.py fetch_templates.py
260-
RUN ${CONDA_PYTHON} -m pip install --no-cache-dir "$( grep templateflow nibabies-setup.cfg | xargs )" && \
267+
RUN ${CONDA_PYTHON} -m pip install --no-cache-dir templateflow && \
261268
${CONDA_PYTHON} fetch_templates.py && \
262-
rm nibabies-setup.cfg fetch_templates.py && \
269+
rm fetch_templates.py && \
263270
find $HOME/.cache/templateflow -type d -exec chmod go=u {} + && \
264271
find $HOME/.cache/templateflow -type f -exec chmod go=u {} +
265272

266-
COPY . /src/nibabies
267-
# Force static versioning within container
268-
ARG VERSION
269-
RUN echo "${VERSION}" > /src/nibabies/nibabies/VERSION && \
270-
echo "include nibabies/VERSION" >> /src/nibabies/MANIFEST.in && \
271-
${CONDA_PYTHON} -m pip install --no-cache-dir "/src/nibabies[all]"
272-
273-
# ABI tags can interfere when running on Singularity/Apptainer
274-
RUN strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
273+
# Install pre-built wheel
274+
COPY --from=src /src/nibabies/dist/*.whl .
275+
RUN ${CONDA_PYTHON} -m pip install --no-cache-dir $( ls *.whl )[all]
275276

276277
# Final settings
277278
RUN ldconfig
278279
WORKDIR /tmp
279280
ARG BUILD_DATE
280281
ARG VCS_REF
282+
ARG VERSION
281283
LABEL org.label-schema.build-date=$BUILD_DATE \
282284
org.label-schema.name="nibabies" \
283-
org.label-schema.description="nibabies - NeuroImaging tools for babies" \
285+
org.label-schema.description="NiBabies - NeuroImaging tools for babies" \
284286
org.label-schema.url="https://github.com/nipreps/nibabies" \
285287
org.label-schema.vcs-ref=$VCS_REF \
286288
org.label-schema.vcs-url="https://github.com/nipreps/nibabies" \

MANIFEST.in

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

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ docker-build:
1414
docker build --rm -t $(tag) \
1515
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
1616
--build-arg VCS_REF=`git rev-parse --short HEAD` \
17-
--build-arg VERSION=`python get_version.py` .
17+
--build-arg VERSION=`python -m hatch version` .

0 commit comments

Comments
 (0)