Skip to content

Commit

Permalink
Drop support for Qt5
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelzwiers committed Sep 25, 2024
1 parent 27be13d commit f35c7c5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 40 deletions.
21 changes: 7 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10-slim AS builder
FROM python:3-slim AS builder

# Install the latest dcm2niix from sources
# Or install the latest dcm2niix release from the base repository (= typically outdated)
Expand Down Expand Up @@ -26,27 +26,20 @@ RUN mkdir -p /opt/miniconda3; \
conda install -c conda-forge conda-pack; \
conda pack -n fsl; \
mkdir /opt/fsl && tar -xzf fsl.tar.gz -C /opt/fsl; \
/opt/fsl/bin/conda-unpack; \
\
# Clone bidscoin and switch to the qt5 branch \
git clone https://github.com/Donders-Institute/bidscoin.git /opt/bidscoin; \
cd /opt/bidscoin; \
git checkout v4.3.3+qt5; \
rm -rf docs tests .git
/opt/fsl/bin/conda-unpack


FROM python:3.10-slim
FROM python:3-slim

# Install the dcm2niix build. NB: Obsolete with the new `pip install bidscoin[dcm2niix2bids]` extras option
COPY --from=builder /opt/bidscoin /opt/bidscoin
COPY --from=builder /usr/local/bin/dcm2niix /usr/local/bin/dcm2niix
COPY --from=builder /opt/fsl /opt/fsl

ENV FSLDIR=/opt/fsl FSLOUTPUTTYPE=NIFTI_GZ \
PATH=$PATH:/opt/fsl/bin \
PIP_NO_CACHE_DIR=off

# First install pyqt5 as Debian package to solve dependencies issues occurring when installed with pip
# Then install the latest stable BIDScoin release from the local qt5 branch (install the normal Qt6 branch from PyPi when using recent base images such as Ubuntu)
RUN apt update && apt -y --no-install-recommends install pigz curl python3-pyqt5 && apt clean; \
pip install /opt/bidscoin[spec2nii2bids,deface]
# First install pyqt as Debian package to solve dependencies issues occurring when installed with pip
# Then install the latest stable BIDScoin release (add build-essential for newer python:3-slim base images (pip needs gcc))
RUN apt update && apt -y --no-install-recommends install pigz curl python3-pyqt6 build-essential libgl1 libxcb-cursor-dev && apt clean; \
pip install bidscoin[spec2nii2bids,deface]
22 changes: 8 additions & 14 deletions apptainer.def
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Bootstrap: docker
From: python:3.10-slim
From: python:3-slim
Stage: builder

%post
Expand Down Expand Up @@ -33,22 +33,16 @@ Stage: builder
mkdir /opt/fsl && tar -xzf fsl.tar.gz -C /opt/fsl
/opt/fsl/bin/conda-unpack

# Clone bidscoin and switch to the qt5 branch
git clone https://github.com/Donders-Institute/bidscoin.git /opt/bidscoin
cd /opt/bidscoin
git checkout v4.3.3+qt5
rm -rf docs tests .git


Bootstrap: docker
From: python:3.10-slim
From: python:3-slim
Stage: final

%help
This BIDScoin Apptainer image includes:

* Debian stable,
* The latest stable release of BIDScoin (v4.3.3+qt5)
* The latest stable release of BIDScoin (v4.4.0)
* The latest versions of dcm2niix, pydeface, spec2nii and some FSL tools

The general form to run BIDScoin commands is:
Expand All @@ -64,7 +58,6 @@ Stage: final
3) The current image does not include the Freesurfer/synthstrip software (needed for `skullstrip`)

%files from builder
/opt/bidscoin /opt/bidscoin
/usr/local/bin/dcm2niix /usr/local/bin/dcm2niix
/opt/fsl /opt/fsl

Expand All @@ -77,13 +70,14 @@ Stage: final
# Install curl (sometimes needed by dcm2niix) and pigz (to speed up dcm2niix)
apt update && apt -y --no-install-recommends install pigz curl

# Install the latest stable BIDScoin release from the local qt5 branch (install the normal Qt6 branch from PyPi when using recent base images such as Ubuntu)
# NOTE: PyQt5 is installed as Debian package to solve dependencies issues occurring when installed with pip
apt -y --no-install-recommends install python3-pyqt5 && apt clean # Add build-essential for newer python:3-slim base images (pip needs gcc)
pip install /opt/bidscoin[spec2nii2bids,deface]
# Install the latest stable BIDScoin release
# NOTE: PyQt is installed as Debian package to solve dependencies issues occurring when installed with pip
apt -y --no-install-recommends install python3-pyqt6 build-essential libgl1 libxcb-cursor-dev && apt clean # Add build-essential for newer python:3-slim base images (pip needs gcc)
pip install bidscoin[spec2nii2bids,deface]

# Uncomment the line below if you get errors like: ImportError: libQt5Core.so.5: cannot open shared object file: No such file or directory
# strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
# strip --remove-section=.note.ABI-tag libQt6Core.so.6

# Finally, create the necessary links and cache to the most recent shared libraries (= best practise)
ldconfig
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

### Changed
- BIDScoin's main API, which now includes new classes to separate the logic from the data and make the code cleaner, better organized and maintainable
- Dropped support for Qt5

## [4.3.3] - 2024-07-12

Expand Down
6 changes: 3 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ If you do not have git (or any other version control system) installed you can `
$ pip install ./bidscoin[dcm2niix2bids]
If you are installing BIDScoin on an older system and you are getting Qt6 errors, you can try to install a ``+qt5`` build, e.g. for version 4.3.3:
If you are installing BIDScoin on an older system and you are getting Qt6 errors, you can try to install an older ``+qt5`` build, e.g. for version 4.3.3 (the last Qt5 build):

.. code-block:: console
Expand Down Expand Up @@ -94,7 +94,7 @@ An alternative for installing Python, BIDScoin and it's dependencies yourself is
The current Apptainer image includes:

* Debian stable,
* The latest stable release (v4.3.3+qt5) of BIDScoin
* The latest stable release of BIDScoin
* The latest versions of dcm2niix, pydeface, spec2nii

This image does not include FreeSurfer/synthstrip (needed for ``skullstrip``)
Expand Down Expand Up @@ -150,7 +150,7 @@ If the Apptainer container is not working for you, it is also possible to use a
The current Docker image includes the same as the Apptainer image:

* Debian stable,
* The latest stable release of BIDScoin (v4.3.3+qt5)
* The latest stable release of BIDScoin
* The latest versions of dcm2niix, pydeface, spec2nii and some FSL tools

Likewise, the current image does not include FreeSurfer/synthstrip (needed for ``skullstrip``)
Expand Down
12 changes: 3 additions & 9 deletions release_procedure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ This document describes how to prepare a new BIDScoin release from within the DC
3. Inspect the git history and update the CHANGELOG (including the links)
4. Update the version string everywhere (i.e. search without word matching), COPYRIGHT and cli help texts
5. Add a git version tag
6. Backport to PyQt5 in a v4.#.#+qt5 branch
7. Build & test the containers in a Linux VM::
6. Build & test the containers in a Linux VM::

VERSION="4.4.0"
rm -rf ~/.bidscoin/$VERSION
Expand All @@ -21,13 +20,11 @@ This document describes how to prepare a new BIDScoin release from within the DC
apptainer exec --cleanenv --env DISPLAY=:0 bidscoin.sif pngappend
apptainer cache clean

8. Run tox@DCCN::
7. Run tox@DCCN::

VERSION="4.4.0"
cd ~/python/bidscoin
git pull
git checkout v${VERSION}+qt5
git pull
module load bidscoin/dev
source activate tox
rm -rf ~/.bidscoin/$VERSION
Expand All @@ -36,16 +33,13 @@ This document describes how to prepare a new BIDScoin release from within the DC
source activate /opt/bidscoin
~/python/bidscoin/bidscoin/bcoin.py -t

9. Push the qt5-branch

DCCN deployment
---------------

1. Copy the dev folder, checkout the Qt5 branch, update the bidsmaps and module::
1. Copy the dev folder, update the bidsmaps and module::

cp -r /opt/bidscoin/dev /opt/bidscoin/$VERSION
cd /opt/bidscoin/$VERSION
git checkout v${VERSION}+qt5 -f
for TEMPLATE in bidscoin/heuristics/*.yaml; do
sed -i 's/command: dcm2niix/command: module add dcm2niix; dcm2niix/' $TEMPLATE
done
Expand Down

0 comments on commit f35c7c5

Please sign in to comment.