diff --git a/.cirrus.yml b/.cirrus.yml index ea544c00..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.12.0 pipx jq + - python -m pip install cibuildwheel==2.16.2 jq pipx setuptools - python -m pipx ensurepath run_cibuildwheel_script: - cibuildwheel @@ -69,17 +69,16 @@ 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*" - CIBW_BUILD: "cp311-manylinux*" + - CIBW_BUILD: "cp312-manylinux*" CIBW_ARCHS_LINUX: "auto" 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 @@ -107,17 +106,18 @@ 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:15 env: matrix: - CIBW_BUILD: cp38-macosx_arm64 - 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 && - 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 accc23b5..922c2eaa 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 @@ -43,12 +39,12 @@ 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 - python: '3.7' - cibw_python: 37 - platform_id: manylinux_x86_64 - os: ubuntu-latest python: '3.8' cibw_python: 38 @@ -65,13 +61,12 @@ 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 - python: '3.7' - cibw_python: 37 - arch: x86_64 - platform_id: macosx_x86_64 - os: macos-latest python: '3.8' cibw_python: 38 @@ -92,6 +87,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 @@ -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 }} @@ -131,7 +131,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 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 - pip install cmake ninja + python -m pip install cmake ninja setuptools CIBW_BEFORE_ALL_WINDOWS: | - pip install cmake ninja + python -m pip install cmake ninja setuptools CIBW_ARCHS_MACOS: ${{ matrix.arch }} CIBW_BEFORE_ALL_MACOS: | - pip install cmake ninja + python -m pip install cmake ninja setuptools 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) diff --git a/Dockerfile b/Dockerfile index 58aaebcd..c5cf5613 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 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-$(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 # 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 . @@ -31,6 +40,6 @@ RUN pip --no-cache-dir -v install . RUN bash tests/run_tests.sh # optimize layers -FROM debian:bullseye-20230109-slim +FROM debian:bookworm-slim COPY --from=builder /opt/conda /opt/conda ENV PATH=/opt/conda/bin:$PATH \ No newline at end of file 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")