Skip to content

Commit caeac77

Browse files
authored
Python3.sif: fix broken ipython magic (#321)
* `Python3.sif`: broken ipython magic, updated Python env to 3.12 Fixes #320
1 parent 0a5271e commit caeac77

File tree

5 files changed

+79
-54
lines changed

5 files changed

+79
-54
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ Removed features goes here
3737

3838
Miscellaneous goes here
3939

40+
## 1.14.0 - 2025-12-05
41+
42+
### Updated
43+
44+
* Using Miniforge3 installer (was Mambaforge)
45+
* Updated Python (3.10.6 -> 3.12.12) and installed packages in `python3.sif` container.
46+
47+
### Fixed
48+
49+
* Fixed issue with %matplotlib inline magic with IPython/Jupyter in `python3.sif` container.
50+
4051
## 1.13.1 - 2025-11-27
4152

4253
###

docker/dockerfiles/python3/Dockerfile

Lines changed: 52 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,74 +11,79 @@ RUN bash apt_get_essential.sh && \
1111
rm apt_get_essential.sh
1212

1313
WORKDIR /tmp
14-
COPY /scripts/install_mambaforge.sh .
15-
RUN bash install_mambaforge.sh && \
16-
rm install_mambaforge.sh
14+
COPY /scripts/install_miniforge.sh .
15+
RUN bash install_miniforge.sh && \
16+
rm install_miniforge.sh
17+
18+
RUN conda install mamba -n base -c conda-forge && \
19+
conda clean -a -y
1720

1821
# set up python env.
1922
# keep the list of packages sorted alphabetically
2023
# https://www.online-utility.org/text/sort.jsp
21-
RUN mamba install python=3.10.6 \
22-
configparser=7.0.0 \
23-
dask=2023.3.0 \
24+
RUN mamba install python=3.12.12 \
25+
configparser=7.2.0 \
26+
dask=2025.11.0 \
2427
fastparquet=2024.11.0 \
25-
graphviz=12.2.1 \
26-
"h5py=3.7.0=nompi*" \
27-
jupyterlab=3.4.8 \
28-
lightgbm=4.5.0 \
29-
lifelines=0.27.0 \
30-
imbalanced-learn=0.12.3 \
28+
graphviz=14.0.5 \
29+
"h5py=3.15.1=nompi*" \
30+
jupyterlab=4.5.0 \
31+
lightgbm=4.6.0 \
32+
lifelines=0.30.0 \
33+
imbalanced-learn=0.14.0 \
3134
intervaltree=3.1.0 \
32-
matplotlib-venn=0.11.5 \
33-
matplotlib=3.6.0 \
34-
miniwdl=1.12.1 \
35-
miniwdl-slurm=0.2.0 \
36-
more-itertools=9.0.0 \
37-
networkx=3.4 \
38-
numdifftools=0.9.39 \
39-
numba=0.60.0 \
40-
numpy=1.23.3 \
35+
matplotlib-venn=1.1.2 \
36+
matplotlib=3.10.8 \
37+
miniwdl=1.13.1 \
38+
miniwdl-slurm=0.4.0 \
39+
more-itertools=10.8.0 \
40+
networkx=3.6 \
41+
numdifftools=0.9.41 \
42+
numba=0.62.1 \
43+
numpy=2.3.5 \
4144
openpyxl=3.1.5 \
42-
pandas=2.2.3 \
43-
pandas-plink=2.2.9 \
45+
pandas=2.3.3 \
46+
pandas-plink=2.3.2 \
4447
paramiko=4.0.0 \
45-
psutil=5.9.3 \
46-
pyarrow=19.0.1 \
47-
pydot=3.0.4 \
48-
pyreadstat=1.2.7 \
49-
pytables=3.7.0 \
50-
python-graphviz=0.20.3 \
51-
pyyaml=6.0 \
52-
scikit-learn=1.5.2 \
53-
scikit-survival=0.23.0 \
54-
scipy=1.9.1 \
48+
psutil=7.1.3 \
49+
pyarrow=22.0.0 \
50+
pydot=4.0.1 \
51+
pyreadstat=1.3.2 \
52+
pytables=3.10.2 \
53+
python-graphviz=0.21 \
54+
pyyaml=6.0.3 \
55+
scikit-learn=1.7.2 \
56+
scikit-survival=0.25.0 \
57+
scipy=1.16.3 \
5558
seaborn=0.13.2 \
5659
semantic_version=2.10.0 \
57-
shap=0.46.0 \
58-
statsmodels=0.13.2 \
59-
xgboost=2.1.4 \
60-
xlrd=2.0.1 \
61-
xmltodict=0.13.0 \
60+
shap=0.48.0 \
61+
statsmodels=0.14.5 \
62+
xgboost=3.1.2 \
63+
xlrd=2.0.2 \
64+
xmltodict=1.0.2 \
6265
--yes && \
6366
mamba clean -a -y
6467

6568
# pip install stuff in env.
66-
RUN pip install --no-cache-dir --no-deps cbgen==1.0.2 \
67-
bgen-reader==4.0.8 \
68-
bed-reader==0.2.24 \
69-
dxpy==0.383.1 \
70-
fastlmm==0.6.3 \
69+
RUN pip install --no-cache-dir --no-deps \
70+
bed-reader==1.0.6 \
71+
bgen-reader==4.0.9 \
72+
cbgen==1.0.6 \
73+
crc32c==2.8 \
74+
dxpy==0.400.1 \
75+
fastlmm==0.6.12 \
7176
hdf5storage==0.2.2 \
7277
LDpred==1.0.11 \
7378
Pgenlib==0.93.0 \
7479
plinkio==0.9.8 \
7580
plinkliftover==0.5.2 \
7681
poetry==2.2.1 \
7782
pooch==1.8.2 \
78-
pycap==2.1.0 \
83+
pycap==2.7.0 \
7984
pyliftover==0.4.1 \
80-
pysnptools==0.5.7 && \
81-
pip cache purge
85+
pysnptools==0.5.14 && \
86+
pip cache purge
8287

8388
# Plink (as python_convert depends on plink)
8489
WORKDIR /tmp/plink
@@ -112,4 +117,4 @@ WORKDIR /tools
112117

113118
# https://github.com/comorment/containers/issues/267:
114119
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
115-
120+
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/sh
22
set -euo pipefail
33

4-
version=25.3.1-0
5-
curl -sSL https://github.com/conda-forge/miniforge/releases/download/$version/Miniforge3-$version-$(uname)-$(uname -m).sh -o /tmp/mambaforge.sh \
6-
&& mkdir /root/.conda \
7-
&& bash /tmp/mambaforge.sh -bfp /usr/local \
8-
&& rm -rf /tmp/mambaforge.sh
4+
version=25.11.0-1
5+
curl -sSL https://github.com/conda-forge/miniforge/releases/download/$version/Miniforge3-$version-$(uname)-$(uname -m).sh -o /tmp/miniforge.sh
6+
mkdir /root/.conda
7+
bash /tmp/miniforge.sh -bfp /usr/local
8+
rm -rf /tmp/miniforge.sh
99

1010
export PATH=$PATH:/opt/conda/bin

tests/test_python3.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
subprocess.run('apptainer', check=False)
2222
PREFIX = f'apptainer run {pth}'
2323
PREFIX_MOUNT = f'apptainer run --home={cwd}:/home/ {pth}'
24+
IPYTHON = f'{PREFIX} ipython'
2425
PYTHON = f'{PREFIX} python'
2526
PYTHON_MOUNT = f'{PREFIX_MOUNT} python'
2627
PLINK = f'{PREFIX} plink'
@@ -37,6 +38,7 @@
3738
f'--mount type=bind,source={cwd},target={cwd} ' +
3839
'--platform linux/amd64 ' +
3940
'ghcr.io/comorment/python3')
41+
IPYTHON = f'{PREFIX} ipython'
4042
PYTHON = f'{PREFIX} python'
4143
PYTHON_MOUNT = f'{PREFIX_MOUNT} python'
4244
PLINK = f'{PREFIX} plink'
@@ -46,6 +48,7 @@
4648
except FileNotFoundError:
4749
# neither apptainer nor docker found, fall back to plain python
4850
# presumably because we are running on the client
51+
IPYTHON = 'ipython'
4952
PYTHON = 'python'
5053
PYTHON_MOUNT = 'python'
5154
PLINK = 'plink'
@@ -104,6 +107,7 @@ def test_python3_miniwdl():
104107
def test_python3_packages():
105108
packages = [
106109
'configparser',
110+
'crc32c',
107111
'dask',
108112
'fastparquet',
109113
'dxpy',
@@ -151,3 +155,8 @@ def test_python3_import_pandas_scipy_stats():
151155
call = f'{PYTHON_MOUNT} -c "import pandas as pd; from scipy import *"'
152156
out = subprocess.run(call, shell=True, check=False)
153157
assert out.returncode == 0
158+
159+
def test_python3_ipython_magic():
160+
call = f'{IPYTHON} -c "get_ipython().run_line_magic(\'matplotlib\', \'inline\')"'
161+
out = subprocess.run(call, shell=True, check=False)
162+
assert out.returncode == 0

version/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
_MAJOR = "1"
2-
_MINOR = "13"
2+
_MINOR = "14"
33
# On main and in a nightly release the patch should be one ahead of the last
44
# released build.
5-
_PATCH = "1"
5+
_PATCH = "0"
66
# This is mainly for nightly builds which have the suffix ".dev$DATE". See
77
# https://semver.org/#is-v123-a-semantic-version for the semantics.
88
_SUFFIX = ""

0 commit comments

Comments
 (0)