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
14 changes: 10 additions & 4 deletions .github/workflows/dockercentos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ jobs:
fail-fast: false
matrix:
cfg:
- { img: 'lebarsfa/manylinux_2_28_x86_64-for-codac' , os: ubuntu-latest , shell: bash, arch: x86_64 , bitness: 64, runtime: manylinux_2_28, desc: 'CentOS manylinux_2_28 x86_64' }
- { img: 'lebarsfa/manylinux_2_28_aarch64-for-codac', os: ubuntu-24.04-arm , shell: bash, arch: aarch64, bitness: 64, runtime: manylinux_2_28, docker_flags: '--platform linux/arm64', desc: 'CentOS manylinux_2_28 aarch64' }
- { img: 'lebarsfa/manylinux_2_28_x86_64-for-codac' , os: ubuntu-latest , shell: bash, arch: x86_64 , bitness: 64, runtime: manylinux_2_28, min_python: '3.14', max_python: ' ', desc: 'CentOS manylinux_2_28 x86_64 Python >=3.14' }
- { img: 'lebarsfa/manylinux_2_28_x86_64-for-codac' , os: ubuntu-latest , shell: bash, arch: x86_64 , bitness: 64, runtime: manylinux_2_28, min_python: '3.13', max_python: '3.13', desc: 'CentOS manylinux_2_28 x86_64 Python 3.13' }
- { img: 'lebarsfa/manylinux_2_28_x86_64-for-codac' , os: ubuntu-latest , shell: bash, arch: x86_64 , bitness: 64, runtime: manylinux_2_28, min_python: '3.11', max_python: '3.12', desc: 'CentOS manylinux_2_28 x86_64 Python 3.11-3.12' }
- { img: 'lebarsfa/manylinux_2_28_x86_64-for-codac' , os: ubuntu-latest , shell: bash, arch: x86_64 , bitness: 64, runtime: manylinux_2_28, min_python: ' ', max_python: '3.10', desc: 'CentOS manylinux_2_28 x86_64 Python <=3.10' }
- { img: 'lebarsfa/manylinux_2_28_aarch64-for-codac', os: ubuntu-24.04-arm , shell: bash, arch: aarch64, bitness: 64, runtime: manylinux_2_28, min_python: '3.14', max_python: ' ', docker_flags: '--platform linux/arm64', desc: 'CentOS manylinux_2_28 aarch64 Python >=3.14' }
- { img: 'lebarsfa/manylinux_2_28_aarch64-for-codac', os: ubuntu-24.04-arm , shell: bash, arch: aarch64, bitness: 64, runtime: manylinux_2_28, min_python: '3.13', max_python: '3.13', docker_flags: '--platform linux/arm64', desc: 'CentOS manylinux_2_28 aarch64 Python 3.13' }
- { img: 'lebarsfa/manylinux_2_28_aarch64-for-codac', os: ubuntu-24.04-arm , shell: bash, arch: aarch64, bitness: 64, runtime: manylinux_2_28, min_python: '3.11', max_python: '3.12', docker_flags: '--platform linux/arm64', desc: 'CentOS manylinux_2_28 aarch64 Python 3.11-3.12' }
- { img: 'lebarsfa/manylinux_2_28_aarch64-for-codac', os: ubuntu-24.04-arm , shell: bash, arch: aarch64, bitness: 64, runtime: manylinux_2_28, min_python: ' ', max_python: '3.10', docker_flags: '--platform linux/arm64', desc: 'CentOS manylinux_2_28 aarch64 Python <=3.10' }
name: ${{ matrix.cfg.desc }}
steps:
- uses: actions/checkout@v7
Expand All @@ -34,8 +40,8 @@ jobs:
# if: (matrix.cfg.arch!='x86_64')&&(matrix.cfg.arch!='i386')
- run: |
chmod a+x scripts/docker/*.sh
if [ ${{ github.ref_name }} = 'codac2_codac4matlab' ] || [ ${{ github.event.pull_request.base.ref }} = 'codac2_codac4matlab' ]; then docker run ${{ matrix.cfg.docker_flags }} --rm -v `pwd`:/io ${{ matrix.cfg.img }} /io/scripts/docker/build_pybinding_codac4matlab.sh
else docker run ${{ matrix.cfg.docker_flags }} --rm -v `pwd`:/io ${{ matrix.cfg.img }} /io/scripts/docker/build_pybinding.sh
if [ ${{ github.ref_name }} = 'codac2_codac4matlab' ] || [ ${{ github.event.pull_request.base.ref }} = 'codac2_codac4matlab' ]; then docker run ${{ matrix.cfg.docker_flags }} --rm -v `pwd`:/io -e MIN_PYTHON=${{ matrix.cfg.min_python }} -e MAX_PYTHON=${{ matrix.cfg.max_python }} ${{ matrix.cfg.img }} /io/scripts/docker/build_pybinding_codac4matlab.sh
else docker run ${{ matrix.cfg.docker_flags }} --rm -v `pwd`:/io -e MIN_PYTHON=${{ matrix.cfg.min_python }} -e MAX_PYTHON=${{ matrix.cfg.max_python }} ${{ matrix.cfg.img }} /io/scripts/docker/build_pybinding.sh
fi
ls wheelhouse
- uses: xresloader/upload-to-github-release@v1
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/unixmatrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,14 @@ jobs:
if: matrix.cfg.deb==true
- run: |
choco install -y -r --no-progress checksum wget zip
rem Workaround to try solve some random package download failures...
wget https://webperso.ensta.fr/packages/choco/winflexbison.2.4.9.20170215.nupkg --no-check-certificate -nv
wget https://webperso.ensta.fr/packages/choco/patch.2.5.9.nupkg --no-check-certificate -nv
choco install -y -r --no-progress -s . winflexbison patch ${{ matrix.cfg.choco_flags }}
del /f /q winflexbison.2.4.9.20170215.nupkg patch.2.5.9.nupkg
wget http://webperso.ensta.fr/lebars/Share/cmake_extra_tools.zip --no-check-certificate -nv
rem choco install -y -r --no-progress checksum wget zip make
rem rem Workaround to try to solve some random package download failures, try to go easy with the download server...
rem wget https://lebarsfa.github.io/cache/patch.2.5.9.nupkg --no-check-certificate -nv
rem choco install -y -r --no-progress -s . patch ${{ matrix.cfg.choco_flags }}
rem wget https://lebarsfa.github.io/cache/winflexbison.2.4.9.20170215.nupkg --no-check-certificate -nv
rem choco install -y -r --no-progress -s . winflexbison ${{ matrix.cfg.choco_flags }}
rem del /f /q patch.2.5.9.nupkg winflexbison.2.4.9.20170215.nupkg
wget https://lebarsfa.github.io/cache/cmake_extra_tools.zip --no-check-certificate -nv
7z x cmake_extra_tools.zip -o"%SystemDrive%" -y
del /f /q cmake_extra_tools.zip
wget https://gist.github.com/lebarsfa/237841f9e5dad55ef192713b3b1b2f16/raw/04d77ced3457346c55f183ca12a10dbcb850e6d5/refreshenv.bashrc --no-check-certificate -nv
Expand Down
67 changes: 67 additions & 0 deletions scripts/docker/build_pybinding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,79 @@ sudo cp -Rf ibex/* /usr/local/

git config --global --add safe.directory /io
cd /io

# Read optional constraints from environment
# MIN_PYTHON and MAX_PYTHON expected as strings like "3.8" or "3.10"
MIN_PYTHON="${MIN_PYTHON:-}"
MAX_PYTHON="${MAX_PYTHON:-}"

# helper function: returns 0 if version is within [min,max], 1 otherwise
# uses Python for robust parsing/comparison
is_version_allowed() {
local ver="$1" # e.g. "3.9"
local min="$2" # e.g. "3.8" or empty
local max="$3" # e.g. "3.12" or empty

# If neither bound provided, allow
if [ -z "$min" ] && [ -z "$max" ]; then
return 0
fi

# Use Python to compare versions (handles multi-digit minors)
"${PYBIN}/python" - <<PYCODE
import sys
from packaging.version import Version, InvalidVersion

ver = Version("$ver")
try:
if "$min":
minv = Version("$min")
else:
minv = None
if "$max":
maxv = Version("$max")
else:
maxv = None
except InvalidVersion:
sys.exit(1)

if minv and ver < minv:
sys.exit(2)
if maxv and ver > maxv:
sys.exit(3)
sys.exit(0)
PYCODE

rc=$?
if [ $rc -eq 0 ]; then
return 0
else
return 1
fi
}

for PYBIN in /opt/python/cp3*/bin; do

if [ "${PYBIN}" = "/opt/python/cp36-cp36m/bin" ] || [ "${PYBIN}" = "/opt/python/cp37-cp37m/bin" ]; then
continue
fi

# get the interpreter's major.minor (e.g. "3.9")
if [ ! -x "${PYBIN}/python" ]; then
echo "Skipping ${PYBIN} (no python executable)"
continue
fi

PY_VER=$("${PYBIN}/python" -c 'import sys; print("{}.{}".format(sys.version_info[0], sys.version_info[1]))')

# If MIN_PYTHON or MAX_PYTHON set, check allowed range
if [ -n "${MIN_PYTHON}" ] || [ -n "${MAX_PYTHON}" ]; then
if ! is_version_allowed "${PY_VER}" "${MIN_PYTHON}" "${MAX_PYTHON}"; then
echo "Skipping ${PYBIN} (python ${PY_VER} outside allowed range ${MIN_PYTHON}-${MAX_PYTHON})"
continue
fi
fi

"${PYBIN}/python" -m pip install --upgrade pip
"${PYBIN}/python" -m pip install --upgrade wheel setuptools
mkdir -p build_dir && cd build_dir
Expand Down
67 changes: 67 additions & 0 deletions scripts/docker/build_pybinding_codac4matlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,79 @@ sudo cp -Rf ibex/* /usr/local/

git config --global --add safe.directory /io
cd /io

# Read optional constraints from environment
# MIN_PYTHON and MAX_PYTHON expected as strings like "3.8" or "3.10"
MIN_PYTHON="${MIN_PYTHON:-}"
MAX_PYTHON="${MAX_PYTHON:-}"

# helper function: returns 0 if version is within [min,max], 1 otherwise
# uses Python for robust parsing/comparison
is_version_allowed() {
local ver="$1" # e.g. "3.9"
local min="$2" # e.g. "3.8" or empty
local max="$3" # e.g. "3.12" or empty

# If neither bound provided, allow
if [ -z "$min" ] && [ -z "$max" ]; then
return 0
fi

# Use Python to compare versions (handles multi-digit minors)
"${PYBIN}/python" - <<PYCODE
import sys
from packaging.version import Version, InvalidVersion

ver = Version("$ver")
try:
if "$min":
minv = Version("$min")
else:
minv = None
if "$max":
maxv = Version("$max")
else:
maxv = None
except InvalidVersion:
sys.exit(1)

if minv and ver < minv:
sys.exit(2)
if maxv and ver > maxv:
sys.exit(3)
sys.exit(0)
PYCODE

rc=$?
if [ $rc -eq 0 ]; then
return 0
else
return 1
fi
}

for PYBIN in /opt/python/cp3*/bin; do

if [ "${PYBIN}" = "/opt/python/cp36-cp36m/bin" ] || [ "${PYBIN}" = "/opt/python/cp37-cp37m/bin" ]; then
continue
fi

# get the interpreter's major.minor (e.g. "3.9")
if [ ! -x "${PYBIN}/python" ]; then
echo "Skipping ${PYBIN} (no python executable)"
continue
fi

PY_VER=$("${PYBIN}/python" -c 'import sys; print("{}.{}".format(sys.version_info[0], sys.version_info[1]))')

# If MIN_PYTHON or MAX_PYTHON set, check allowed range
if [ -n "${MIN_PYTHON}" ] || [ -n "${MAX_PYTHON}" ]; then
if ! is_version_allowed "${PY_VER}" "${MIN_PYTHON}" "${MAX_PYTHON}"; then
echo "Skipping ${PYBIN} (python ${PY_VER} outside allowed range ${MIN_PYTHON}-${MAX_PYTHON})"
continue
fi
fi

"${PYBIN}/python" -m pip install --upgrade pip
"${PYBIN}/python" -m pip install --upgrade wheel setuptools
mkdir -p build_dir && cd build_dir
Expand Down
Loading