diff --git a/.github/workflows/actions_build/action.yml b/.github/workflows/actions_build/action.yml index 86f6d55c2..db3d4cea1 100755 --- a/.github/workflows/actions_build/action.yml +++ b/.github/workflows/actions_build/action.yml @@ -8,10 +8,10 @@ inputs: runs: using: "composite" steps: - - name: Set up Python ${{ inputs.python-version }} + - name: Set up Python 3.14 uses: actions/setup-python@v6 with: - python-version: ${{ inputs.python-version }} + python-version: '3.14' - name: Get OS version id: get-os-version shell: bash -l {0} @@ -45,22 +45,31 @@ runs: fi - name: Cache modules id: cache_opengate_core_dependencies - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ~/software key: ${{ runner.os }}-${{ steps.get-os-version.outputs.release }}_geant4_${{ env.GEANT4_VERSION }}_itk_${{ env.ITK_VERSION }}_build restore-keys: ${{ runner.os }}-${{ steps.get-os-version.outputs.release }}_geant4_${{ env.GEANT4_VERSION }}_itk_${{ env.ITK_VERSION }}_build - - uses: conda-incubator/setup-miniconda@v3 - if: (inputs.os == 'macos-15') || (inputs.os == 'macos-15-intel') || (inputs.os == 'windows-2025') || (inputs.os == 'windows-11-arm') + - name: Miniconda setup Macos and windows + if: (inputs.os == 'macos-15') || (inputs.os == 'windows-2025') + uses: conda-incubator/setup-miniconda@v4 with: miniconda-version: "latest" auto-update-conda: true activate-environment: opengate_core - python-version: ${{ inputs.python-version }} + python-version: '3.14' + - name: Miniconda setup Macos intel and windows arm + if: (inputs.os == 'macos-15-intel') + uses: conda-incubator/setup-miniconda@v4 + with: + miniconda-version: "latest" + auto-update-conda: true + activate-environment: opengate_core + python-version: '3.13' - name: Set up Homebrew if: (inputs.os == 'macos-15') || (inputs.os == 'macos-15-intel') id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main - name: Create opengate_core Wheel Linux if: (inputs.os == 'ubuntu-24.04') || (inputs.os == 'ubuntu-24.04-arm') env: @@ -85,6 +94,7 @@ runs: env: MATRIX_CACHE: ${{ steps.cache_opengate_core_dependencies.outputs.cache-hit }} MATRIX_PYTHON_VERSION: ${{ inputs.python-version }} + MATRIX_OS: ${{ inputs.os }} shell: bash -l {0} run: | export > $GITHUB_WORKSPACE\\env_dump.txt diff --git a/.github/workflows/actions_build/ci_build_wheel_macos.sh b/.github/workflows/actions_build/ci_build_wheel_macos.sh index f911c9705..b30b3c3a9 100755 --- a/.github/workflows/actions_build/ci_build_wheel_macos.sh +++ b/.github/workflows/actions_build/ci_build_wheel_macos.sh @@ -2,34 +2,35 @@ set -e source $GITHUB_WORKSPACE/env_dump.txt -brew install python@${MATRIX_PYTHON_VERSION} || true -brew link --overwrite python@${MATRIX_PYTHON_VERSION} -#brew update -#rm -rf /usr/local/bin/python3.1*-config /usr/local/bin/2to3-3.1* /usr/local/bin/idle3.1* /usr/local/bin/pydoc3.1* /usr/local/bin/python3.1* -#rm -rf /usr/local/bin/python3-config /usr/local/bin/2to3 /usr/local/bin/idle3 /usr/local/bin/pydoc3 /usr/local/bin/python3 + brew install --force --verbose --overwrite \ - ccache \ - fftw \ - libomp \ - xquartz \ - xerces-c \ - wget || true + ccache \ + fftw \ + libomp \ + xerces-c || true + brew uninstall --ignore-dependencies libxext brew uninstall --ignore-dependencies libx11 + export LDFLAGS="-L/usr/local/opt/llvm/lib" export CPPFLAGS="-I/usr/local/opt/llvm/include -fopenmp" conda info conda list -which python -python --version -export PATH="/usr/local/miniconda/envs/opengate_core/bin/:$PATH" -pip install wget colored setuptools -pip install wheel delocate +export PATH="/Users/runner/miniconda3/envs/opengate_core/bin/:$PATH" + if [[ ${MATRIX_OS} == "macos-15-intel" ]]; then conda install conda-forge::qt6-main conda-forge::qt6-3d + export QT_PLUGIN_DIR="/Users/runner/miniconda3/envs/opengate_core/lib/qt6/plugins" else brew install qt + export QT_PLUGIN_DIR=$(qtpaths6 --plugin-dir) fi + +echo "QT_PLUGIN_DIR is $QT_PLUGIN_DIR" +pip install wget colored setuptools +# install cibuildwheel +pip install cibuildwheel[uv]==3.4.0 + mkdir -p $HOME/software if [ "${MATRIX_CACHE}" != 'true' ]; then cd $HOME/software @@ -66,29 +67,40 @@ fi cd $GITHUB_WORKSPACE source $HOME/software/geant4/bin/geant4make.sh export CMAKE_PREFIX_PATH=$HOME/software/geant4/bin:$HOME/software/itk/bin/:${CMAKE_PREFIX_PATH} +cp VERSION core/VERSION cd core + mkdir opengate_core/plugins -if [[ ${MATRIX_OS} == "macos-15-intel" ]]; then - cp -r /Users/runner/miniconda3/envs/opengate_core/lib/qt6/plugins/platforms/* opengate_core/plugins/ - cp -r /Users/runner/miniconda3/envs/opengate_core/lib/qt6/plugins/imageformats opengate_core/plugins/ -else - cp -r /opt/homebrew/share/qt/plugins/platforms/* opengate_core/plugins/ - cp -r /opt/homebrew/share/qt/plugins/imageformats/* opengate_core/plugins/ -fi -python3 setup.py sdist bdist_wheel -ls dist +cp -r $QT_PLUGIN_DIR/platforms/* opengate_core/plugins/ +cp -r $QT_PLUGIN_DIR/imageformats/* opengate_core/plugins/ + +export CIBW_BUILD_FRONTEND="build[uv]" +export CIBW_PLATFORM="macos" +export CIBW_SKIP="*t*" +export MACOSX_DEPLOYMENT_TARGET=15.0 +export CIBW_BEFORE_BUILD="uv pip install colored" + if [[ ${MATRIX_OS} == "macos-15-intel" ]]; then export DYLD_LIBRARY_PATH=$HOME/software/geant4/bin/BuildProducts/lib:/Users/runner/miniconda3/envs/opengate_core/lib/qt6/plugins/platforms:/opt/X11/lib/:$DYLD_LIBRARY_PATH:/Users/runner/miniconda3/envs/opengate_core/lib + export CIBW_ARCHS_MACOS="x86_64" else export DYLD_LIBRARY_PATH=$HOME/software/geant4/bin/BuildProducts/lib:/opt/homebrew/share/qt/plugins/platforms/:/opt/X11/lib/:$DYLD_LIBRARY_PATH:/opt/homebrew/lib + export CIBW_ARCHS_MACOS="arm64" python -c "import os,delocate; print(os.path.join(os.path.dirname(delocate.__file__), 'tools.py'));quit()" | xargs -I{} sed -i."" "s/first, /input.pop('i386',None); first, /g" {} fi -delocate-listdeps --all dist/*.whl -delocate-wheel -w fixed_wheels -v dist/*.whl -rm -rf dist -ls fixed_wheels -delocate-listdeps --all fixed_wheels/*.whl -mv fixed_wheels dist +if [[ ${MATRIX_PYTHON_VERSION} == "3.10" ]]; then + export CIBW_BUILD="cp310-*" +elif [[ ${MATRIX_PYTHON_VERSION} == "3.11" ]]; then + export CIBW_BUILD="cp311-*" +elif [[ ${MATRIX_PYTHON_VERSION} == "3.12" ]]; then + export CIBW_BUILD="cp312-*" +elif [[ ${MATRIX_PYTHON_VERSION} == "3.13" ]]; then + export CIBW_BUILD="cp313-*" +elif [[ ${MATRIX_PYTHON_VERSION} == "3.14" ]]; then + export CIBW_BUILD="cp314-*" +fi + +python -m cibuildwheel --output-dir dist cd dist if [[ ${MATRIX_OS} == "macos-15-intel" ]]; then find . -name '*whl' -exec bash -c ' mv $0 ${0/macosx_15_0/macosx_10_9}' {} \; diff --git a/.github/workflows/actions_build/ci_build_wheel_ubuntu.sh b/.github/workflows/actions_build/ci_build_wheel_ubuntu.sh index 51bc33fbb..9bdd773ed 100755 --- a/.github/workflows/actions_build/ci_build_wheel_ubuntu.sh +++ b/.github/workflows/actions_build/ci_build_wheel_ubuntu.sh @@ -2,23 +2,54 @@ set -e source $GITHUB_WORKSPACE/env_dump.txt -if [ ${MATRIX_PYTHON_VERSION} == "3.10" ]; then - export PYTHONFOLDER="cp310-cp310" -elif [ ${MATRIX_PYTHON_VERSION} == "3.11" ]; then - export PYTHONFOLDER="cp311-cp311" -elif [ ${MATRIX_PYTHON_VERSION} == "3.12" ]; then - export PYTHONFOLDER="cp312-cp312" -elif [ ${MATRIX_PYTHON_VERSION} == "3.13" ]; then - export PYTHONFOLDER="cp313-cp313" -elif [ ${MATRIX_PYTHON_VERSION} == "3.14" ]; then - export PYTHONFOLDER="cp314-cp314" -fi -mkdir -p $HOME/software + +pip install wget colored setuptools +pip install cibuildwheel[uv]==3.4.0 + +# Setup the environment for the build if [ ${MATRIX_OS} == "ubuntu-24.04-arm" ]; then export ARMDOCKER="_arm64" + export CIBW_ARCHS="aarch64" + export CIBW_MANYLINUX_AARCH64_IMAGE=tbaudier/opengate_core:${GEANT4_VERSION}$ARMDOCKER +else + export CIBW_ARCHS="x86_64" + export CIBW_MANYLINUX_X86_64_IMAGE=tbaudier/opengate_core:${GEANT4_VERSION} fi -docker run --rm -e "PYTHONFOLDER=${PYTHONFOLDER}" -v $GITHUB_WORKSPACE:/home tbaudier/opengate_core:${GEANT4_VERSION}$ARMDOCKER /home/.github/workflows/createWheelLinux.sh -ls wheelhouse -rm -rf dist -mv wheelhouse dist -sudo chown -R runner:docker dist \ No newline at end of file +if [[ ${MATRIX_PYTHON_VERSION} == "3.10" ]]; then + export CIBW_BUILD="cp310-*" +elif [[ ${MATRIX_PYTHON_VERSION} == "3.11" ]]; then + export CIBW_BUILD="cp311-*" +elif [[ ${MATRIX_PYTHON_VERSION} == "3.12" ]]; then + export CIBW_BUILD="cp312-*" +elif [[ ${MATRIX_PYTHON_VERSION} == "3.13" ]]; then + export CIBW_BUILD="cp313-*" +elif [[ ${MATRIX_PYTHON_VERSION} == "3.14" ]]; then + export CIBW_BUILD="cp314-*" +fi +export CIBW_PLATFORM="linux" +export CIBW_BUILD_FRONTEND="build[uv]" +export CIBW_SKIP="*-musllinux_* *t*" +export CIBW_BEFORE_BUILD=' +pip install colored && +mkdir -p opengate_core/plugins && +export QT_PLUGIN_DIR=$(qtpaths6 --plugin-dir) && +cp -r -n $QT_PLUGIN_DIR/platforms/* opengate_core/plugins/ && +cp -r -n $QT_PLUGIN_DIR/imageformats opengate_core/plugins/ && +source /software/geant4/bin/geant4make.sh && +. /opt/rh/gcc-toolset-14/enable +' + +# expose external libraries to build environment +export CIBW_ENVIRONMENT=' +CMAKE_PREFIX_PATH=/software/geant4/bin:/software/itk/bin/ +Geant4_DIR=/software/geant4/lib/cmake/Geant4 +ITK_DIR=/software/itk/lib/cmake/ITK +LD_LIBRARY_PATH=/software/geant4/lib:/software/itk/lib +' + +# Run the build in custom docker +cp VERSION core/VERSION +cd core +python -m cibuildwheel --output-dir dist +mkdir -p $GITHUB_WORKSPACE/dist +mv dist/*.whl $GITHUB_WORKSPACE/dist/ \ No newline at end of file diff --git a/.github/workflows/actions_build/ci_build_wheel_windows.sh b/.github/workflows/actions_build/ci_build_wheel_windows.sh index e22949d20..c61d0e16c 100755 --- a/.github/workflows/actions_build/ci_build_wheel_windows.sh +++ b/.github/workflows/actions_build/ci_build_wheel_windows.sh @@ -6,14 +6,13 @@ source $CONDA/Scripts/activate opengate_core conda info conda install cmake==3.31.2 cmake --version -conda install openssl==3.0.19 conda list which python python --version export PATH="/usr/local/miniconda/envs/opengate_core/bin/:$PATH" -pip install wheel wget colored +pip install wget colored delvewheel -pip install cibuildwheel==3.4.0 +pip install cibuildwheel[uv]==3.4.0 # For windows 2025, Need to add the certifi CA bundle to avoid SSL errors when downloading dependencies during the build. This is a workaround for cibuildwheel which does not handle this properly on Windows. python - << 'EOF' @@ -53,26 +52,40 @@ fi cd $GITHUB_WORKSPACE source $HOME/software/geant4/bin/geant4make.sh export CMAKE_PREFIX_PATH=$HOME/software/geant4/bin:$HOME/software/itk/bin/:${CMAKE_PREFIX_PATH} +cp VERSION core/VERSION cd core if [[ ${MATRIX_PYTHON_VERSION} == "3.10" ]]; then - export CIBW_BUILD="cp310-win_amd64" + export CIBW_BUILD="cp310-*" elif [[ ${MATRIX_PYTHON_VERSION} == "3.11" ]]; then - export CIBW_BUILD="cp311-win_amd64" + export CIBW_BUILD="cp311-*" elif [[ ${MATRIX_PYTHON_VERSION} == "3.12" ]]; then - export CIBW_BUILD="cp312-win_amd64" + export CIBW_BUILD="cp312-*" elif [[ ${MATRIX_PYTHON_VERSION} == "3.13" ]]; then - export CIBW_BUILD="cp313-win_amd64" + export CIBW_BUILD="cp313-*" elif [[ ${MATRIX_PYTHON_VERSION} == "3.14" ]]; then - export CIBW_BUILD="cp314-win_amd64" + export CIBW_BUILD="cp314-*" fi +echo ${MATRIX_OS} +if [[ ${MATRIX_OS} == "windows-11-arm" ]]; then + export CIBW_ARCHS="ARM64" +else + export CIBW_ARCHS="AMD64" +fi +export CIBW_BUILD_FRONTEND="build[uv]" +export CIBW_SKIP="*t*" +export CIBW_PLATFORM="windows" find $HOME/software/geant4/bin/ -iname "*.dll" ls $HOME/software/geant4/bin/BuildProducts/Release/bin ls $HOME/software/geant4/bin/BuildProducts/Release/lib/ -export CIBW_BEFORE_BUILD="python -m pip install colored" + +# use delvewheel on windows +export CIBW_BEFORE_BUILD_WINDOWS="uv pip install colored" +export CIBW_REPAIR_WHEEL_COMMAND_WINDOWS='' python -m cibuildwheel --output-dir dist + cd .. mkdir core/dist2 -pip install pefile machomachomangler -ls core/dist -python $GITHUB_WORKSPACE\\.github\\workflows\\delocateWindows.py core\\dist -w core\\dist2 -d C:\\Users\\runneradmin\\software\\geant4\\bin\\BuildProducts\\Release\\bin +delvewheel repair -w core/dist2 core/dist/*.whl --add-path $HOME/software/geant4/bin/BuildProducts/Release/bin -vv + +ls core/dist2 mv core/dist2 dist diff --git a/.github/workflows/createWheelLinux.sh b/.github/workflows/createWheelLinux.sh deleted file mode 100755 index 0363fb9be..000000000 --- a/.github/workflows/createWheelLinux.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -e -x -echo ${PYTHONFOLDER} -cd /home/core/ -export PATH=/software/cmake/cmake/bin/:${PATH} -source /software/geant4/bin/geant4make.sh -export CMAKE_PREFIX_PATH=/software/geant4/bin:/software/itk/bin/:${CMAKE_PREFIX_PATH} -. /opt/rh/gcc-toolset-14/enable -mkdir opengate_core/plugins -cp -r /lib64/qt6/plugins/platforms/* opengate_core/plugins/ -cp -r /lib64/qt6/plugins/imageformats opengate_core/plugins/ -/opt/python/${PYTHONFOLDER}/bin/pip install wget colored setuptools -export PYBIND11_FINDPYTHON=OLD -/opt/python/${PYTHONFOLDER}/bin/python setup.py sdist bdist_wheel -archi=`uname -m` -if [ "$(uname -m)" = "aarch64" ]; then - auditwheel repair /home/core/dist/*.whl -w /software/wheelhouse/ --plat "manylinux_2_34_aarch64" -else - auditwheel repair /home/core/dist/*.whl -w /software/wheelhouse/ --plat "manylinux_2_34_x86_64" -fi -cp -r /software/wheelhouse /home/ -#/opt/python/${PYTHONFOLDER}/bin/pip install twine -#/opt/python/${PYTHONFOLDER}/bin/twine upload --repository-url https://test.pypi.org/legacy/ wheelhouse/*manylinux2014*.whl diff --git a/.github/workflows/delocateWindows.py b/.github/workflows/delocateWindows.py deleted file mode 100644 index 3991c1089..000000000 --- a/.github/workflows/delocateWindows.py +++ /dev/null @@ -1,171 +0,0 @@ -#!/usr/bin/env python - -print("------------ Delocate for Windows ----------") - -import os -import glob -import shutil -import pathlib -import hashlib -import zipfile -import argparse -import tempfile -from datetime import datetime - -now = datetime.now() -print(now.strftime("%H:%M:%S")) - -import pefile -from machomachomangler.pe import redll - -# From https://github.com/duburcqa/jiminy/blob/dev/build_tools/wheel_repair_win.py - -WHITE_LIST_DEPS = ("boost_python",) # "boost_numpy", "eigenpy", "hpp-fcl", "pinocchio") - -global_dll_deps = {} - - -def hash_filename(filepath, blocksize=65536): - # Split original filename from extension - root, ext = os.path.splitext(filepath) - filename = os.path.basename(root) - - # Do NOT hash filename to make it unique in the particular case of boost - # python modules. It is necessary for cross-module interoperability. - if any(pattern in filepath for pattern in WHITE_LIST_DEPS): - return f"{filename}{ext}" - - # Compute unique hash based on file's content - hasher = hashlib.sha256() - with open(filepath, "rb") as afile: - buf = afile.read(blocksize) - while len(buf) > 0: - hasher.update(buf) - buf = afile.read(blocksize) - - return f"{filename}-{hasher.hexdigest()[:8]}{ext}" - - -def find_dll_dependencies(dll_filepath, lib_dir): - print(dll_filepath) - if dll_filepath in global_dll_deps: - return global_dll_deps[dll_filepath] - else: - dll_deps = {} - entries = pefile.PE(dll_filepath).DIRECTORY_ENTRY_IMPORT - for entry in entries: - entry_name = entry.dll.decode("utf-8") - print(entry_name) - if entry_name in os.listdir(lib_dir): - dll_deps.setdefault(os.path.basename(dll_filepath), set()).add( - entry_name - ) - nested_dll_deps = find_dll_dependencies( - os.path.join(lib_dir, entry_name), lib_dir - ) - dll_deps.update(nested_dll_deps) - global_dll_deps[dll_filepath] = dll_deps - return global_dll_deps[dll_filepath] - - -def mangle_filename(old_filename, new_filename, mapping): - with open(old_filename, "rb") as f: - buf = f.read() - new_buf = redll(buf, mapping) - with open(new_filename, "wb") as f: - f.write(new_buf) - - -parser = argparse.ArgumentParser( - description="Vendor in external shared library dependencies of a wheel." -) - -parser.add_argument("WHEEL_FILE", type=str, help="Path to wheel file") -parser.add_argument( - "-d", "--dll-dir", dest="DLL_DIR", type=str, help="Directory to find the DLLs" -) -parser.add_argument( - "-w", - "--wheel-dir", - dest="WHEEL_DIR", - type=str, - help=('Directory to store delocated wheels (default: "wheelhouse/")'), - default="wheelhouse/", -) - -args = parser.parse_args() - -wheel_name = args.WHEEL_FILE -print(wheel_name) -print(os.path.join(wheel_name, "opengate_core-*-win_amd64.whl")) -wheel_name = glob.glob(os.path.join(wheel_name, "opengate_core-*-win_amd64.whl"))[0] -print(wheel_name) -repaired_wheel = os.path.join( - os.path.abspath(args.WHEEL_DIR), os.path.basename(wheel_name) -) - -old_wheel_dir = tempfile.mkdtemp() -new_wheel_dir = tempfile.mkdtemp() -package_name = os.path.basename(wheel_name).split("-")[0] -bundle_name = package_name + ".libs" -bundle_path = os.path.join(new_wheel_dir, bundle_name) -os.makedirs(bundle_path) - -with zipfile.ZipFile(wheel_name, "r") as wheel: - wheel.extractall(old_wheel_dir) - wheel.extractall(new_wheel_dir) - pyd_rel_paths = [ - os.path.normpath(path) for path in wheel.namelist() if path.endswith(".pyd") - ] - -dll_dependencies = {} -for rel_path in pyd_rel_paths: - abs_path = os.path.join(old_wheel_dir, rel_path) - print(rel_path) - dll_dependencies.update(find_dll_dependencies(abs_path, args.DLL_DIR)) - -for dll, dependencies in dll_dependencies.items(): - mapping = {} - - print(dll) - print(dependencies) - - if dll.endswith(".pyd"): - rel_path = next(path for path in pyd_rel_paths if path.endswith(dll)) - - for dep in dependencies: - src_path = os.path.join(args.DLL_DIR, dep) - hashed_name = hash_filename(src_path) # already basename - new_path = os.path.join(bundle_path, hashed_name) - if dll.endswith(".pyd"): - bundle_rel_path = os.path.join( - "..\\" * rel_path.count(os.path.sep), bundle_name - ) - mapping[dep.encode("ascii")] = os.path.join( - bundle_rel_path, hashed_name - ).encode("ascii") - else: - mapping[dep.encode("ascii")] = hashed_name.encode("ascii") - if not os.path.exists(new_path): - shutil.copy2(src_path, new_path) - - if dll.endswith(".pyd"): - old_name = os.path.join(old_wheel_dir, rel_path) - new_name = os.path.join(new_wheel_dir, rel_path) - else: - old_name = os.path.join(args.DLL_DIR, dll) - hashed_name = hash_filename(old_name) # already basename - new_name = os.path.join(bundle_path, hashed_name) - - mangle_filename(old_name, new_name, mapping) - -pathlib.Path(os.path.dirname(repaired_wheel)).mkdir(parents=True, exist_ok=True) -with zipfile.ZipFile(repaired_wheel, "w", zipfile.ZIP_DEFLATED) as new_wheel: - for root, dirs, files in os.walk(new_wheel_dir): - new_root = os.path.relpath(root, new_wheel_dir) - for file in files: - new_wheel.write(os.path.join(root, file), os.path.join(new_root, file)) - -now = datetime.now() -print(now.strftime("%H:%M:%S")) -print("------------ End Delocate for Windows ----------") diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9404ca9dc..278d57d22 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-24.04] - python-version: ['3.10'] + python-version: ['3.14'] steps: - name: Checkout github repo uses: actions/checkout@v6 @@ -63,11 +63,6 @@ jobs: matrix: os: [ubuntu-24.04, macos-15, windows-2025] python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] - exclude: - - os: macos-15 - python-version: '3.10' - - os: windows-2025 - python-version: '3.10' steps: - name: Checkout github repo uses: actions/checkout@v6 @@ -91,7 +86,6 @@ jobs: path: dist/ build_opengate_core_wheel_ci_or_tag: - if: (github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')) || (github.event_name == 'schedule') runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -99,10 +93,6 @@ jobs: os: [ubuntu-24.04-arm, macos-15-intel] python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] exclude: - - os: macos-15 - python-version: '3.10' - - os: windows-2025 - python-version: '3.10' - os: macos-15-intel python-version: '3.14' steps: @@ -128,7 +118,6 @@ jobs: path: dist/ build_opengate_core_novis_wheel: - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -159,7 +148,7 @@ jobs: echo "release=${varOS}" >> $GITHUB_OUTPUT - name: Cache modules id: cache_opengate_core_dependencies - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ~/software key: ${{ runner.os }}-${{ steps.get-os-version.outputs.release }}_geant4_${{ env.GEANT4_VERSION }}_itk_${{ env.ITK_VERSION }}_build @@ -259,7 +248,7 @@ jobs: # echo "release=${varOS:1}" >> $GITHUB_OUTPUT # - name: Cache modules # id: cache_opengate_core_dependencies -# uses: actions/cache@v4 +# uses: actions/cache@v5 # with: # path: ~/software # key: ${{ runner.os }}-${{ steps.get-os-version.outputs.release }}_geant4_${{ env.GEANT4_VERSION }}_itk_${{ env.ITK_VERSION }}_build @@ -287,11 +276,6 @@ jobs: matrix: os: [ubuntu-24.04, macos-15, windows-2025] python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] - exclude: - - os: macos-15 - python-version: '3.10' - - os: windows-2025 - python-version: '3.10' steps: - name: Checkout github repo uses: actions/checkout@v6 @@ -314,7 +298,7 @@ jobs: miniconda-version: "latest" auto-update-conda: true activate-environment: vega-altair - python-version: '3.10' + python-version: '3.14' - name: Merge the results shell: bash -el {0} run: | diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 923994e2a..b48d8dfb6 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -5,7 +5,7 @@ # See LICENSE.md for further details # -------------------------------------------------- -cmake_minimum_required(VERSION 3.5.0) +cmake_minimum_required(VERSION 3.10.0) # remove warning about project version cmake_policy(SET CMP0048 NEW) diff --git a/core/setup.py b/core/setup.py index 81565cced..3d1628cf7 100755 --- a/core/setup.py +++ b/core/setup.py @@ -27,8 +27,14 @@ def get_base_dir() -> Path: return Path(__file__).parent.parent.resolve() -with open("../VERSION", "r") as fh: - version = fh.read()[:-1] +try: + # For CI builds + with open("VERSION", "r") as fh: + version = fh.read()[:-1] +except IOError: + # For local builds + with open("../VERSION", "r") as fh: + version = fh.read()[:-1] from distutils.version import LooseVersion