Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Unit tests

on:
push:
branches: [ master ]
branches: [ master, dev ]
pull_request:
branches: [ master ]

Expand All @@ -20,7 +20,7 @@ jobs:
- ubuntu-latest
- macos-latest
- windows-latest
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: true

steps:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ __pycache__/
dist/
build/
_build/
poetry.lock
uv.lock

# anything hidden should be manually added
.*
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ In addition, string typing is sometimes problematic. Non-ascii characters should

## Installation

Python >= 3.5 is required. **RWA-python** may still work with Python 2.7 but support has been dropped.
Python >= 3.6 is required. **RWA-python** may still work with Python 2.7 and 3.5 but support has been dropped.

Windows users should favor Conda for installing **RWA-python**, as Conda will seamlessly install the HDF5 standard library which is a required dependency.

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ In addition, string typing is sometimes problematic. Non-ascii characters should
Installation
------------

Python >= 3.5 is required. **RWA-python** may still work with Python 2.7 but support has been dropped.
Python >= 3.6 is required. **RWA-python** may still work with Python 2.7 and 3.5 but support has been dropped.

Windows users should favor Conda for installing **RWA-python**, as Conda will seamlessly install the HDF5 standard library which is a required dependency.

Expand Down
124 changes: 124 additions & 0 deletions containers/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
FROM ubuntu:22.04

COPY . /root/RWA-python

ENV PYENV_ROOT=/root/.pyenv \
CC=mpicc \
HDF5_MPI="ON" \
HDF5_LIB=/usr/lib/x86_64-linux-gnu \
LC_ALL=C

RUN cd /root/RWA-python \
&& rm -rf .git .github .pytest_cache .venv containers dist doc tests .gitignore .readthedocs.yml meta.yaml poetry.lock pyproject.toml uv.lock rwa/__pycache__ \
&& ls -a

COPY <<"EOT" /bin/entrypoint
#!/bin/bash
python="python3"
if [ -n "$1" ]; then
if [ "$1" = "-2" -o "$1" = "-27" ]; then
python="python2.7"
shift
elif [ "$1" = "-35" ]; then
python="/root/python3.5"
shift
elif [ "$1" = "-36" ]; then
python="/root/python3.6"
shift
elif [ "$1" = "-37" ]; then
python="python3.7"
shift
elif [ "$1" = "-38" ]; then
python="python3.8"
shift
elif [ "$1" = "-39" ]; then
python="python3.9"
shift
elif [ "$1" = "-3" -o "$1" = "-310" ]; then
python="python3.10"
shift
elif [ "$1" = "-311" ]; then
python="python3.11"
shift
elif [ "$1" = "-312" ]; then
python="python3.12"
shift
elif [ "$1" = "-313" ]; then
python="python3.13"
shift
elif [ "$1" = "-314" ]; then
python="python3.14"
shift
fi
fi
# echo "running: $python $@" >&2
exec $python "$@"
EOT

RUN chmod +x /bin/entrypoint \
&& ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends locales \
&& locale-gen \
&& apt-get install -y --no-install-recommends libhdf5-openmpi-dev \
build-essential git software-properties-common pkg-config \
gpg-agent wget curl libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev libncursesw5-dev xz-utils \
tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
&& curl -fsSL https://pyenv.run | bash \
&& for ver in 3.5 3.6; do \
/root/.pyenv/bin/pyenv install $ver \
&& echo -e "#!/bin/bash\nPYTHON=\$(ls /root/.pyenv/versions/$ver*/bin/python)\neval \"\$PYTHON \$@\"" >/root/python$ver \
&& chmod +x /root/python$ver; \
done; \
add-apt-repository -y ppa:deadsnakes/ppa \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
python3.7 python3.7-dev python3.7-distutils \
python3.8 python3.8-dev python3.8-venv \
python3.9 python3.9-dev python3.9-distutils \
python3.10-dev python3.10-venv \
python3.11 python3.11-dev python3.11-venv \
python3.12 python3.12-dev python3.12-venv \
python3.13 python3.13-dev python3.13-venv \
python3.14 python3.14-dev python3.14-venv \
&& for old in 3.7 3.8; do \
(command -v python$old >/dev/null \
&& ([ -f /root/get-pip$old.py ] \
|| wget -O /root/get-pip$old.py "https://bootstrap.pypa.io/pip/$old/get-pip.py") \
&& python$old /root/get-pip$old.py --root-user-action=ignore); \
done; \
([ -f /root/get-pip.py ] \
|| wget -P /root/ -- 'https://bootstrap.pypa.io/get-pip.py') \
&& for VER in 3.9 3.10 3.11 3.12 3.13 3.14; do \
python$VER /root/get-pip.py --root-user-action=ignore; \
done; \
(curr=`pwd`; cd "$HDF5_LIB"; ln -s libhdf5_openmpi.so libhdf5.so; cd "$curr") \
&& cd /root/RWA-python \
&& for version in 2.7 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13 3.14; do \
python="python$version"; \
if [ "$version" = "2.7" ] || [ "$version" = "3.5" ] || [ "$version" = "3.6" ]; then \
python="/root/$python"; \
if [ ! -f "$python" ]; then continue; fi \
elif ! command -v $python >/dev/null; then continue; fi; \
pip="$python -m pip"; \
pip_install="$pip install --root-user-action=ignore -U"; \
if [ "$version" = "3.6" ] || [ "$version" = "3.7" ] || [ "$version" = "3.8" ] || [ "$version" = "3.9" ] || \
[ "$version" = "3.10" ] || [ "$version" = "3.11" ] || [ "$version" = "3.12" ] || [ "$version" = "3.13" ] || \
[ "$version" = "3.14" ]; then \
$pip_install --force-reinstall setuptools; \
$pip_install pytest; \
fi; \
if [ "$version" = "3.8" ] || [ "$version" = "3.9" ] || [ "$version" = "3.10" ] || [ "$version" = "3.11" ] || \
[ "$version" = "3.12" ] || [ "$version" = "3.13" ] || [ "$version" = "3.14" ]; then \
$pip_install mpi4py; \
fi; \
$pip_install . -r requirements.txt; \
for pkg in scipy pandas; do \
if [ -z "$($pip show $pkg)" ]; then \
$pip_install $pkg; \
fi; \
done; \
done

ENTRYPOINT ["/bin/entrypoint"]
121 changes: 121 additions & 0 deletions containers/Containerfile-legacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
FROM ubuntu:18.04

COPY . /root/RWA-python

ENV PYENV_ROOT=/root/.pyenv \
CC=mpicc \
HDF5_MPI="ON" \
HDF5_LIB=/usr/lib/x86_64-linux-gnu \
LC_ALL=C

RUN cd /root/RWA-python \
&& rm -rf .git .github .pytest_cache .venv containers dist doc tests .gitignore .readthedocs.yml meta.yaml poetry.lock pyproject.toml uv.lock rwa/__pycache__ \
&& ls -a

COPY <<"EOT" /bin/entrypoint
#!/bin/bash
python="python3"
if [ -n "$1" ]; then
if [ "$1" = "-2" -o "$1" = "-27" ]; then
python="python2.7"
shift
elif [ "$1" = "-35" ]; then
python="python3.5"
shift
elif [ "$1" = "-36" ]; then
python="python3.6"
shift
elif [ "$1" = "-37" ]; then
python="python3.7"
shift
elif [ "$1" = "-3" -o "$1" = "-38" ]; then
python="python3.8"
shift
elif [ "$1" = "-39" ]; then
python="python3.9"
shift
elif [ "$1" = "-310" ]; then
python="python3.10"
shift
elif [ "$1" = "-311" ]; then
python="python3.11"
shift
elif [ "$1" = "-312" ]; then
python="python3.12"
shift
elif [ "$1" = "-313" ]; then
python="python3.13"
shift
elif [ "$1" = "-314" ]; then
python="python3.14"
shift
fi
fi
# echo "running: $python $@" >&2
exec $python "$@"
EOT

RUN chmod +x /bin/entrypoint \
&& ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends locales \
&& locale-gen \
&& apt-get install -y --no-install-recommends libhdf5-openmpi-dev \
build-essential git software-properties-common pkg-config \
gpg-agent wget curl libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev libncursesw5-dev xz-utils \
tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
&& add-apt-repository -y ppa:deadsnakes/ppa \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
python2.7 python2.7-dev \
python3.6 python3.6-dev python3.6-distutils \
python3.7 python3.7-dev python3.7-distutils \
python3.8 python3.8-dev python3.8-venv \
&& for very_old in 2.7 3.5 3.6; do \
(command -v python$very_old >/dev/null \
&& ([ -f /root/get-pip$very_old.py ] \
|| wget -O /root/get-pip$very_old.py "https://bootstrap.pypa.io/pip/$very_old/get-pip.py") \
&& python$very_old /root/get-pip$very_old.py); \
done; \
for old in 3.7 3.8; do \
(command -v python$old >/dev/null \
&& ([ -f /root/get-pip$old.py ] \
|| wget -O /root/get-pip$old.py "https://bootstrap.pypa.io/pip/$old/get-pip.py") \
&& python$old /root/get-pip$old.py --root-user-action=ignore); \
done; \
([ -f /root/get-pip.py ] \
|| wget -P /root/ -- 'https://bootstrap.pypa.io/get-pip.py') \
&& for VER in 3.9 3.10 3.11 3.12 3.13 3.14; do \
(command -v python$VER >/dev/null && python$VER /root/get-pip.py --root-user-action=ignore); \
done; \
(curr=`pwd`; cd "$HDF5_LIB"; ln -s libhdf5_openmpi.so libhdf5.so; cd "$curr") \
&& cd /root/RWA-python \
&& for version in 2.7 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13 3.14; do \
python="python$version"; \
if ! command -v $python >/dev/null; then continue; fi; \
pip="$python -m pip"; \
if [ "$version" = "2.7" ] || [ "$version" = "3.6" ]; then \
pip_install="$pip install -U"; \
else \
pip_install="$pip install --root-user-action=ignore -U"; \
fi; \
if [ "$version" = "3.6" ] || [ "$version" = "3.7" ] || [ "$version" = "3.8" ] || [ "$version" = "3.9" ] || \
[ "$version" = "3.10" ] || [ "$version" = "3.11" ] || [ "$version" = "3.12" ] || [ "$version" = "3.13" ] || \
[ "$version" = "3.14" ]; then \
$pip_install --force-reinstall setuptools; \
$pip_install pytest; \
fi; \
if [ "$version" = "3.8" ] || [ "$version" = "3.9" ] || [ "$version" = "3.10" ] || [ "$version" = "3.11" ] || \
[ "$version" = "3.12" ] || [ "$version" = "3.13" ] || [ "$version" = "3.14" ]; then \
$pip_install mpi4py; \
fi; \
$pip_install . -r requirements.txt; \
for pkg in scipy pandas; do \
if [ -z "$($pip show $pkg)" ]; then \
$pip_install $pkg; \
fi; \
done; \
done

ENTRYPOINT ["/bin/entrypoint"]
1 change: 0 additions & 1 deletion containers/rwa-focal

This file was deleted.

Loading