From 9458725adcd0d73506f32fc09b3694786ee2d749 Mon Sep 17 00:00:00 2001 From: Ravnoor Gill Date: Tue, 10 Oct 2023 22:08:08 -0400 Subject: [PATCH 01/15] update base docker images --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 58aaebcd..1fba5480 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # Note: QEMU emulated ppc64le build might take ~6 hours # Use conda to resolve dependencies cross-platform -FROM continuumio/miniconda3:22.11.1 as builder +FROM continuumio/miniconda3:23.5.2-0 as builder # install libpng to system for cross-architecture support # https://github.com/ANTsX/ANTs/issues/1069#issuecomment-681131938 @@ -24,13 +24,13 @@ RUN conda env update -n base COPY . . # number of parallel make jobs -ARG j=2 +ARG j=20 RUN pip --no-cache-dir -v install . # run tests RUN bash tests/run_tests.sh # optimize layers -FROM debian:bullseye-20230109-slim +FROM debian:bullseye-20230919-slim COPY --from=builder /opt/conda /opt/conda ENV PATH=/opt/conda/bin:$PATH \ No newline at end of file From fcb0c25e76782a198ed7d64fad53c29894b56f56 Mon Sep 17 00:00:00 2001 From: Ravnoor Gill Date: Tue, 10 Oct 2023 22:08:37 -0400 Subject: [PATCH 02/15] bump `cibuildwheel` version --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index ea544c00..2a1c2284 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -13,7 +13,7 @@ env: build_and_store_wheels: &BUILD_AND_STORE_WHEELS install_cibuildwheel_pipx_script: - - python -m pip install cibuildwheel==2.12.0 pipx jq + - python -m pip install cibuildwheel==2.16.2 pipx jq - python -m pipx ensurepath run_cibuildwheel_script: - cibuildwheel From 9272adb665bc1752cdc1f0c82d24937291c85dc3 Mon Sep 17 00:00:00 2001 From: Ravnoor Gill Date: Tue, 10 Oct 2023 22:19:45 -0400 Subject: [PATCH 03/15] add py312 support --- .cirrus.yml | 2 ++ .github/workflows/wheels.yml | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index 2a1c2284..3f2c14bc 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -75,6 +75,7 @@ linux_aarch64_task: - CIBW_BUILD: "cp39-manylinux*" - CIBW_BUILD: "cp310-manylinux*" - CIBW_BUILD: "cp311-manylinux*" + - CIBW_BUILD: "cp312-manylinux*" CIBW_ARCHS_LINUX: "auto" CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 CIBW_BEFORE_ALL_LINUX: > @@ -114,6 +115,7 @@ macos_arm64_task: - CIBW_BUILD: cp39-macosx_arm64 - CIBW_BUILD: cp310-macosx_arm64 - CIBW_BUILD: cp311-macosx_arm64 + - CIBW_BUILD: cp312-macosx_arm64 CIBW_ARCHS_MACOS: arm64 CIBW_BEFORE_ALL_MACOS: > python -m ensurepip --upgrade && diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index accc23b5..dacce64d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -43,6 +43,10 @@ jobs: python: '3.11' cibw_python: 311 platform_id: win_amd64 + - os: windows-latest + python: '3.12' + cibw_python: 312 + platform_id: win_amd64 # Linux 64-bit - os: ubuntu-latest @@ -65,6 +69,10 @@ jobs: python: '3.11' cibw_python: 311 platform_id: manylinux_x86_64 + - os: ubuntu-latest + python: '3.12' + cibw_python: 312 + platform_id: manylinux_x86_64 # macOS on Intel 64-bit - os: macos-latest @@ -92,6 +100,11 @@ jobs: cibw_python: 311 arch: x86_64 platform_id: macosx_x86_64 + - os: macos-latest + python: '3.12' + cibw_python: 312 + arch: x86_64 + platform_id: macosx_x86_64 # macOS on Apple M1 64-bit # - os: macos-latest From 85c9a9c759278c2aa01b1fe44ce6a5d08ca56d18 Mon Sep 17 00:00:00 2001 From: Ravnoor Gill Date: Tue, 10 Oct 2023 22:20:24 -0400 Subject: [PATCH 04/15] remove py36 and py37 - EOL --- .cirrus.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 3f2c14bc..668c27c3 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -69,8 +69,6 @@ linux_aarch64_task: # only_if: ${CIRRUS_BRANCH} == 'master' || ${CIRRUS_PR} != '' env: matrix: - - CIBW_BUILD: "cp36-manylinux*" - - CIBW_BUILD: "cp37-manylinux*" - CIBW_BUILD: "cp38-manylinux*" - CIBW_BUILD: "cp39-manylinux*" - CIBW_BUILD: "cp310-manylinux*" From dfa8dc82028c02073df3c711ee921fe58568c2de Mon Sep 17 00:00:00 2001 From: Ravnoor Gill Date: Tue, 10 Oct 2023 22:37:55 -0400 Subject: [PATCH 05/15] bump macos version --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 668c27c3..14ac949c 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -106,7 +106,7 @@ macos_arm64_task: name: build_macos_arm64_wheels # only_if: ${CIRRUS_BRANCH} == 'master' || ${CIRRUS_PR} != '' macos_instance: - image: ghcr.io/cirruslabs/macos-monterey-xcode + image: ghcr.io/cirruslabs/macos-ventura-xcode:latest env: matrix: - CIBW_BUILD: cp38-macosx_arm64 From fbe52fade9967443a83cb2369730e1f31e970b8f Mon Sep 17 00:00:00 2001 From: Ravnoor Gill Date: Tue, 10 Oct 2023 22:39:12 -0400 Subject: [PATCH 06/15] pin xcode version to 15 --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 14ac949c..97d91814 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -106,7 +106,7 @@ macos_arm64_task: name: build_macos_arm64_wheels # only_if: ${CIRRUS_BRANCH} == 'master' || ${CIRRUS_PR} != '' macos_instance: - image: ghcr.io/cirruslabs/macos-ventura-xcode:latest + image: ghcr.io/cirruslabs/macos-ventura-xcode:15 env: matrix: - CIBW_BUILD: cp38-macosx_arm64 From 1a3fd5086716a158db35fd0380947cd0661cf9e2 Mon Sep 17 00:00:00 2001 From: Ravnoor Gill Date: Wed, 11 Oct 2023 09:53:52 -0400 Subject: [PATCH 07/15] bump debian to bookworm 12.x --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1fba5480..cb3c76e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,6 +31,6 @@ RUN pip --no-cache-dir -v install . RUN bash tests/run_tests.sh # optimize layers -FROM debian:bullseye-20230919-slim +FROM debian:bookworm-20230919-slim COPY --from=builder /opt/conda /opt/conda ENV PATH=/opt/conda/bin:$PATH \ No newline at end of file From 3b75eae7f10e2a55bf0ab81b77d190eaede52a3f Mon Sep 17 00:00:00 2001 From: Ravnoor Gill Date: Wed, 11 Oct 2023 11:28:50 -0400 Subject: [PATCH 08/15] bump cibuildwheel version --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index dacce64d..f3e44034 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -144,7 +144,7 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.12.1 + run: python -m pip install cibuildwheel==2.16.2 - name: Get package name and version (Linux / Mac) if: ${{ ! startsWith(matrix.os, 'windows-') }} From fd35d7802850f7928b1de812149a84210626ac7b Mon Sep 17 00:00:00 2001 From: Ravnoor Gill Date: Wed, 20 Dec 2023 09:16:20 -0500 Subject: [PATCH 09/15] refactor Dockerfile - based on bookworm-slim image - uses latest `Miniconda3-py310_23.11.0-1` --- Dockerfile | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index cb3c76e3..220ceb8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # Note: QEMU emulated ppc64le build might take ~6 hours # Use conda to resolve dependencies cross-platform -FROM continuumio/miniconda3:23.5.2-0 as builder +FROM debian:bookworm-slim as builder # install libpng to system for cross-architecture support # https://github.com/ANTsX/ANTs/issues/1069#issuecomment-681131938 @@ -11,12 +11,21 @@ RUN apt-get update && \ apt-transport-https \ bash \ build-essential \ + ca-certificates \ git \ - libpng-dev + libpng-dev \ + wget + +# install miniconda3 +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py310_23.11.0-1-Linux-x86_64.sh \ + && /bin/bash Miniconda3-py310_23.11.0-1-Linux-x86_64.sh -b -p /opt/conda \ + && rm Miniconda3-py310_23.11.0-1-Linux-x86_64.sh +ENV PATH=/opt/conda/bin:$PATH # install cmake binary using conda for multi-arch support # apt install fails because libssl1.0.0 is not available for newer Debian -RUN conda install -c anaconda cmake +RUN conda update -c defaults conda +RUN conda install -c conda-forge cmake WORKDIR /usr/local/src COPY environment.yml . @@ -24,13 +33,13 @@ RUN conda env update -n base COPY . . # number of parallel make jobs -ARG j=20 +ARG j=2 RUN pip --no-cache-dir -v install . # run tests RUN bash tests/run_tests.sh # optimize layers -FROM debian:bookworm-20230919-slim +FROM debian:bookworm-slim COPY --from=builder /opt/conda /opt/conda ENV PATH=/opt/conda/bin:$PATH \ No newline at end of file From c3e88409fde2288774614ad9c2cc6a91b9602af8 Mon Sep 17 00:00:00 2001 From: Ravnoor Gill Date: Wed, 20 Dec 2023 09:19:51 -0500 Subject: [PATCH 10/15] deprecate EOL py37 --- .github/workflows/wheels.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index f3e44034..77f2ac7b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -23,10 +23,6 @@ jobs: # Need to quote decimal versions as string to avoid the "Norway problem" # Windows 64-bit - - os: windows-latest - python: '3.7' - cibw_python: 37 - platform_id: win_amd64 - os: windows-latest python: '3.8' cibw_python: 38 @@ -49,10 +45,6 @@ jobs: platform_id: win_amd64 # Linux 64-bit - - os: ubuntu-latest - python: '3.7' - cibw_python: 37 - platform_id: manylinux_x86_64 - os: ubuntu-latest python: '3.8' cibw_python: 38 @@ -75,11 +67,6 @@ jobs: platform_id: manylinux_x86_64 # macOS on Intel 64-bit - - os: macos-latest - python: '3.7' - cibw_python: 37 - arch: x86_64 - platform_id: macosx_x86_64 - os: macos-latest python: '3.8' cibw_python: 38 From 8bc8f85e71c69ca5fec4bae9320ccb4505c97690 Mon Sep 17 00:00:00 2001 From: Ravnoor Gill Date: Wed, 20 Dec 2023 09:24:26 -0500 Subject: [PATCH 11/15] bump GHA workflow versions --- .github/workflows/wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 77f2ac7b..0c1cb980 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -116,11 +116,11 @@ jobs: # platform_id: macosx_arm64 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 name: Install Python host for cibuildwheel with: python-version: ${{ matrix.python }} From 518b6dd259db0d7a7846d2c1aa6413802adfdd69 Mon Sep 17 00:00:00 2001 From: Ravnoor Gill Date: Wed, 20 Dec 2023 09:56:36 -0500 Subject: [PATCH 12/15] dynamically set image architecture --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 220ceb8c..c5cf5613 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,9 +17,9 @@ RUN apt-get update && \ wget # install miniconda3 -RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py310_23.11.0-1-Linux-x86_64.sh \ - && /bin/bash Miniconda3-py310_23.11.0-1-Linux-x86_64.sh -b -p /opt/conda \ - && rm Miniconda3-py310_23.11.0-1-Linux-x86_64.sh +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py310_23.11.0-1-Linux-$(uname -m).sh \ + && /bin/bash Miniconda3-py310_23.11.0-1-Linux-$(uname -m).sh -b -p /opt/conda \ + && rm Miniconda3-py310_23.11.0-1-Linux-$(uname -m).sh ENV PATH=/opt/conda/bin:$PATH # install cmake binary using conda for multi-arch support From 5dbf9326600c988bd9483a98055ea9232dd47f33 Mon Sep 17 00:00:00 2001 From: Ravnoor Gill Date: Wed, 20 Dec 2023 12:25:37 -0500 Subject: [PATCH 13/15] remove `distutils` - deprecated in py312 --- setup.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 72ed3667..f5387085 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,6 @@ import subprocess import sys import time -from distutils.version import LooseVersion from functools import cmp_to_key import setuptools @@ -106,9 +105,7 @@ def run(self): + ", ".join(e.name for e in self.extensions) ) - cmake_version = LooseVersion( - re.search(r"version\s*([\d.]+)", out.decode()).group(1) - ) + cmake_version = re.search(r"version\s*([\d.]+)", out.decode()).group(1) if cmake_version < "3.10.0": raise RuntimeError("CMake >= 3.10.0 is required") From 912c29903b1354b621cac1852e8c15144fa0ac6c Mon Sep 17 00:00:00 2001 From: Ravnoor Gill Date: Wed, 20 Dec 2023 12:37:01 -0500 Subject: [PATCH 14/15] consistent use of pip (as a python module) --- .github/workflows/wheels.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0c1cb980..69efdc82 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -159,14 +159,14 @@ jobs: CIBW_BEFORE_ALL_LINUX: | yum install -y gcc-c++ libpng-devel libpng - pip install cmake ninja + python -m pip install cmake ninja CIBW_BEFORE_ALL_WINDOWS: | - pip install cmake ninja + python -m pip install cmake ninja CIBW_ARCHS_MACOS: ${{ matrix.arch }} CIBW_BEFORE_ALL_MACOS: | - pip install cmake ninja + python -m pip install cmake ninja CIBW_ENVIRONMENT_MACOS: | CMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} @@ -176,7 +176,7 @@ jobs: - name: Install and test (Linux / Mac) if: ${{ ! startsWith(matrix.os, 'windows-') }} run: | - pip install wheelhouse/cp${{ matrix.cibw_python }}-${{matrix.platform_id }}/*.whl + python -m pip install wheelhouse/cp${{ matrix.cibw_python }}-${{matrix.platform_id }}/*.whl tests/run_tests.sh - name: Install and test (Windows) From 4dea23e788e4db0cdb38b57502f2eb1c8909fc98 Mon Sep 17 00:00:00 2001 From: Ravnoor Gill Date: Wed, 20 Dec 2023 14:30:47 -0500 Subject: [PATCH 15/15] add setuptools for py312 - no longer available by default --- .cirrus.yml | 6 +++--- .github/workflows/wheels.yml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 97d91814..568a806e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -13,7 +13,7 @@ env: build_and_store_wheels: &BUILD_AND_STORE_WHEELS install_cibuildwheel_pipx_script: - - python -m pip install cibuildwheel==2.16.2 pipx jq + - python -m pip install cibuildwheel==2.16.2 jq pipx setuptools - python -m pipx ensurepath run_cibuildwheel_script: - cibuildwheel @@ -78,7 +78,7 @@ linux_aarch64_task: CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 CIBW_BEFORE_ALL_LINUX: > yum install -y gcc-c++ libpng-devel libpng && - python -m pip install cmake ninja + python -m pip install cmake ninja setuptools CIBW_BEFORE_TEST: | python -m pip install --find-links=wheelhouse/ -r requirements.txt CIBW_TEST_COMMAND: bash {project}/tests/run_tests.sh @@ -117,7 +117,7 @@ macos_arm64_task: CIBW_ARCHS_MACOS: arm64 CIBW_BEFORE_ALL_MACOS: > python -m ensurepip --upgrade && - conda install cmake ninja libpng + conda install cmake ninja libpng setuptools CIBW_BEFORE_TEST: | python -m pip install --find-links=wheelhouse/ -r requirements.txt CIBW_TEST_COMMAND: bash {project}/tests/run_tests.sh diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 69efdc82..922c2eaa 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -131,7 +131,7 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.16.2 + run: python -m pip install cibuildwheel==2.16.2 setuptools - name: Get package name and version (Linux / Mac) if: ${{ ! startsWith(matrix.os, 'windows-') }} @@ -159,14 +159,14 @@ jobs: CIBW_BEFORE_ALL_LINUX: | yum install -y gcc-c++ libpng-devel libpng - python -m pip install cmake ninja + python -m pip install cmake ninja setuptools CIBW_BEFORE_ALL_WINDOWS: | - python -m pip install cmake ninja + python -m pip install cmake ninja setuptools CIBW_ARCHS_MACOS: ${{ matrix.arch }} CIBW_BEFORE_ALL_MACOS: | - python -m pip install cmake ninja + python -m pip install cmake ninja setuptools CIBW_ENVIRONMENT_MACOS: | CMAKE_OSX_ARCHITECTURES=${{ matrix.arch }}