From fb6c451bb714052341de17c70c342e519f3b664b Mon Sep 17 00:00:00 2001 From: Konstantinos Samaras-Tsakiris Date: Tue, 2 Dec 2025 15:57:16 +0100 Subject: [PATCH 1/4] Add ARM64 ocp build Build also an arm64 vtk wheel --- .github/workflows/build-ocp.yml | 58 +++-- .github/workflows/build-vtk.yml | 11 +- cmake/vtk-config-ubuntu-22.04-arm.cmake | 273 ++++++++++++++++++++++++ 3 files changed, 324 insertions(+), 18 deletions(-) create mode 100644 cmake/vtk-config-ubuntu-22.04-arm.cmake diff --git a/.github/workflows/build-ocp.yml b/.github/workflows/build-ocp.yml index 5829b67..146e915 100644 --- a/.github/workflows/build-ocp.yml +++ b/.github/workflows/build-ocp.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["macos-13", "macos-14", "ubuntu-20.04", "windows-2019"] + os: ["macos-13", "macos-14", "ubuntu-20.04", "ubuntu-22.04-arm", "windows-2019"] python-version: ["3.10", "3.11", "3.12", "3.13"] use-vtk: ["vtk", "novtk"] @@ -50,6 +50,13 @@ jobs: sed_i: "sed -i" env: "DUMMY=0" shells: "bash" + - os: "ubuntu-22.04-arm" + vtk_libs: "libvtk*.so" + vtk_suffix: "/vtk-9.3/" + vtk_prefix: "" + sed_i: "sed -i" + env: "DUMMY=0" + shells: "bash" - os: "windows-2019" vtk_libs: "vtk*.dll" vtk_suffix: "/" @@ -142,7 +149,11 @@ jobs: echo "Downloading cadquery_vtk-9.3.1-cp313-cp313-linux_x86_64.whl" curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-9.3.1-cp313-cp313-linux_x86_64.whl - else + elif [[ "${{ matrix.os }}" == "ubuntu-22.04-arm" ]]; then + echo "Downloading cadquery_vtk-9.3.1-cp313-cp313-linux_aarch64.whl" + curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-9.3.1-cp313-cp313-linux_aarch64.whl + + else echo "Downloading cadquery_vtk-9.3.1-cp313-cp313-win_amd64.whl" curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-9.3.1-cp313-cp313-win_amd64.whl @@ -278,7 +289,7 @@ jobs: patch --posix -p1 < ../patches/occt-${{ env.OCCT }}/0017-ChFi3d_Builder-Fix-blend-across-seam.-See-following.patch # see https://tracker.dev.opencascade.org/view.php?id=33576 and https://github.com/FreeCAD/FreeCAD/issues/9760 patch --posix -p1 < ../patches/occt-${{ env.OCCT }}/0018-Fix-0033576-BRepTools_NurbsConvertModification-NewPo.patch - + if [[ "$RUNNER_OS" == "Windows" ]]; then echo vtkCommonTransforms >> src/TKIVtk/EXTERNLIB echo vtkCommonMath >> src/TKIVtk/EXTERNLIB @@ -305,7 +316,7 @@ jobs: fi if [[ "${{ matrix.use-vtk }}" == "vtk" ]]; then - + env ${{ matrix.env }} cmake -S . -B build -G Ninja \ -D CMAKE_INSTALL_PREFIX=$HOME/opt/local/occt-${{ env.OCCT }}-${{ matrix.use-vtk }} \ \ @@ -360,7 +371,7 @@ jobs: if: runner.os == 'Windows' && steps.cache-occt-restore.outputs.cache-hit != 'true' shell: cmd run: | - call C:\Users\runneradmin\micromamba\condabin\micromamba.bat activate build-ocp + call C:\Users\runneradmin\micromamba\condabin\micromamba.bat activate build-ocp cd OCCT call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" @@ -447,7 +458,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["macos-13", "macos-14", "ubuntu-20.04", "windows-2019"] + os: ["macos-13", "macos-14", "ubuntu-20.04", "ubuntu-22.04-arm", "windows-2019"] python-version: ["3.11"] include: @@ -463,6 +474,10 @@ jobs: sed_i: "sed -i" env: "DUMMY=0" shells: "bash" + - os: "ubuntu-22.04-arm" + sed_i: "sed -i" + env: "DUMMY=0" + shells: "bash" - os: "windows-2019" sed_i: "sed -i" shells: "bash cmd.exe" @@ -494,7 +509,7 @@ jobs: run: | micromamba activate build-ocp - cpu_count=$(python -c "import multiprocessing; print(multiprocessing.cpu_count())") + cpu_count=$(python -c "import multiprocessing; print(multiprocessing.cpu_count())") echo "cpu_count=$cpu_count" >> $GITHUB_OUTPUT echo "=> Using $cpu_count CPUs" @@ -640,6 +655,9 @@ jobs: if [[ ${{ matrix.os }} == "macos-13" || ${{ matrix.os }} == "macos-14" ]]; then curl -L -O https://github.com/CadQuery/OCP/releases/download/${{ env.OCP }}/OCP_src_stubs_macOS-latest.zip + elif [[ ${{ matrix.os }} == "ubuntu-22.04-arm" ]]; then + # Use ubuntu-20.04 sources for ARM build (sources are architecture-independent) + curl -L -O https://github.com/CadQuery/OCP/releases/download/${{ env.OCP }}/OCP_src_stubs_ubuntu-20.04.zip else curl -L -O https://github.com/CadQuery/OCP/releases/download/${{ env.OCP }}/OCP_src_stubs_${{ matrix.os }}.zip fi @@ -674,7 +692,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["macos-13", "macos-14", "ubuntu-20.04", "windows-2019"] + os: ["macos-13", "macos-14", "ubuntu-20.04", "ubuntu-22.04-arm", "windows-2019"] python-version: ["3.10", "3.11", "3.12", "3.13"] use-vtk: ["vtk", "novtk"] @@ -701,6 +719,14 @@ jobs: module: "OCP.*.so" env: "DUMMY=0" shells: "bash" + - os: "ubuntu-22.04-arm" + delocate: auditwheel patchelf + plat: manylinux_2_39_aarch64 + sed_i: "sed -i" + compilers: "" + module: "OCP.*.so" + env: "DUMMY=0" + shells: "bash" - os: "windows-2019" delocate: delvewheel plat: win_amd64 @@ -717,7 +743,7 @@ jobs: run: | micromamba activate build-ocp - cpu_count=$(python -c "import multiprocessing; print(multiprocessing.cpu_count())") + cpu_count=$(python -c "import multiprocessing; print(multiprocessing.cpu_count())") echo "cpu_count=$cpu_count" >> $GITHUB_OUTPUT echo "=> Using $cpu_count CPUs" @@ -1006,9 +1032,9 @@ jobs: if [[ "$RUNNER_OS" == "Windows" ]]; then if [[ "${{ matrix.use-vtk }}" == "vtk" ]]; then - python ocp-tree.py occt-${{ env.OCCT }}-vtk vtk-${{ env.VTK }} + python ocp-tree.py occt-${{ env.OCCT }}-vtk vtk-${{ env.VTK }} else - python ocp-tree.py occt-${{ env.OCCT }}-novtk + python ocp-tree.py occt-${{ env.OCCT }}-novtk fi mv *.pyd OCP @@ -1019,7 +1045,7 @@ jobs: ls -l OCP/*.so strip -x OCP/*.so ls -l OCP/*.so - + else LD_LIBRARY_PATH=$HOME/opt/local/vtk-${{ env.VTK }}/lib:$HOME/opt/local/occt-${{ env.OCCT }}-${{ matrix.use-vtk }}/lib \ python ocp-tree.py @@ -1187,7 +1213,11 @@ jobs: echo "Downloading cadquery_vtk-9.3.1-cp313-cp313-linux_x86_64.whl" curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-cp313-cp313-linux_x86_64.whl - else + elif [[ "${{ matrix.os }}" == "ubuntu-22.04-arm" ]]; then + echo "Downloading cadquery_vtk-9.3.1-cp313-cp313-linux_aarch64.whl" + curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-cp313-cp313-linux_aarch64.whl + + else echo "Downloading cadquery_vtk-9.3.1-cp313-cp313-win_amd64.whl" curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-cp313-cp313-win_amd64.whl @@ -1253,7 +1283,7 @@ jobs: micromamba install -y nlopt=2.9 fi - # workaround for pypi opt and casadi throwing a seg fault on exit + # workaround for pypi opt and casadi throwing a seg fault on exit if [[ "$RUNNER_OS" == "Windows" ]]; then micromamba install -y nlopt casadi fi diff --git a/.github/workflows/build-vtk.yml b/.github/workflows/build-vtk.yml index 8e64224..42724f4 100644 --- a/.github/workflows/build-vtk.yml +++ b/.github/workflows/build-vtk.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-20.04", "macos-13", "macos-14", "windows-2019"] + os: ["ubuntu-20.04", "ubuntu-22.04-arm", "macos-13", "macos-14", "windows-2019"] python-version: ["3.13"] include: - os: "macos-13" @@ -27,6 +27,9 @@ jobs: - os: "ubuntu-20.04" sed_i: "sed -i" shells: "bash" + - os: "ubuntu-22.04-arm" + sed_i: "sed -i" + shells: "bash" - os: "windows-2019" sed_i: "sed -i" shells: "bash cmd.exe" @@ -153,10 +156,10 @@ jobs: shell: cmd if: runner.os == 'Windows' && steps.cache-vtk-restore.outputs.cache-hit != 'true' run: | - call C:\Users\runneradmin\micromamba\condabin\micromamba.bat activate build-vtk + call C:\Users\runneradmin\micromamba\condabin\micromamba.bat activate build-vtk call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - cd VTK-${{ env.VTK }}\build + cd VTK-${{ env.VTK }}\build cmake -G Ninja ^ -D VTK_VERSIONED_INSTALL=ON ^ -D VTK_CUSTOM_LIBRARY_SUFFIX="9.3" -DVTK_VERSION_SUFFIX="" ^ @@ -194,7 +197,7 @@ jobs: run: | set -euo pipefail - micromamba activate build-vtk + micromamba activate build-vtk pip install delvewheel cd VTK-${{ env.VTK }}/build diff --git a/cmake/vtk-config-ubuntu-22.04-arm.cmake b/cmake/vtk-config-ubuntu-22.04-arm.cmake new file mode 100644 index 0000000..e88fad4 --- /dev/null +++ b/cmake/vtk-config-ubuntu-22.04-arm.cmake @@ -0,0 +1,273 @@ +# vtk-config.cmake + +# Set VTK version +set(VTK_MAJOR_VERSION 9) +set(VTK_MINOR_VERSION 3) +set(VTK_BUILD_VERSION 1) + +# Set full VTK version +set(VTK_VERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}") + +# Set include and library directories +if(WIN32) + set(HOME_DIR "$ENV{USERPROFILE}") +else() + set(HOME_DIR "$ENV{HOME}") +endif() + +set(VTK_INCLUDE_DIRS "${HOME_DIR}/opt/local/vtk-${VTK_VERSION}/include/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}") +set(VTK_LIBRARY_DIRS "${HOME_DIR}/opt/local/vtk-${VTK_VERSION}/lib") + +# Find Python interpreter and get version +find_package(Python3 REQUIRED COMPONENTS Interpreter) +set(PYTHON_VERSION "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}") + +set(SUFFIX "-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}") + +# Define the components +set(VTK_MODULES_ENABLED + AcceleratorsVTKmCore + AcceleratorsVTKmDataModel + AcceleratorsVTKmFilters + cgns + ChartsCore + CommonColor + CommonComputationalGeometry + CommonCore + CommonDataModel + CommonExecutionModel + CommonMath + CommonMisc + CommonPython + CommonSystem + CommonTransforms + DICOMParser + DomainsChemistry + DomainsChemistryOpenGL2 + doubleconversion + exodusII + expat + FiltersAMR + FiltersCellGrid + FiltersCore + FiltersExtraction + FiltersFlowPaths + FiltersGeneral + FiltersGeneric + FiltersGeometry + FiltersGeometryPreview + FiltersHybrid + FiltersHyperTree + FiltersImaging + FiltersModeling + FiltersParallel + FiltersParallelDIY2 + FiltersParallelImaging + FiltersParallelStatistics + FiltersPoints + FiltersProgrammable + FiltersPython + FiltersReduction + FiltersSelection + FiltersSMP + FiltersSources + FiltersStatistics + FiltersTensor + FiltersTexture + FiltersTopology + FiltersVerdict + fmt + freetype + GeovisCore + gl2ps + glew + h5part + hdf5 + hdf5_hl + ImagingColor + ImagingCore + ImagingFourier + ImagingGeneral + ImagingHybrid + ImagingMath + ImagingMorphological + ImagingOpenGL2 + ImagingSources + ImagingStatistics + ImagingStencil + InfovisCore + InfovisLayout + InteractionImage + InteractionStyle + InteractionWidgets + IOAMR + IOAsynchronous + IOCellGrid + IOCesium3DTiles + IOCGNSReader + IOChemistry + IOCityGML + IOCONVERGECFD + IOCore + IOEnSight + IOExodus + IOExport + IOExportGL2PS + IOExportPDF + IOFLUENTCFF + IOGeoJSON + IOGeometry + IOH5part + IOH5Rage + IOHDF + IOImage + IOImport + IOInfovis + IOIOSS + IOLegacy + IOLSDyna + IOMINC + IOMotionFX + IOMovie + IONetCDF + IOOggTheora + IOOMF + IOParallel + IOParallelExodus + IOParallelLSDyna + IOParallelXML + IOPIO + IOPLY + IOSegY + IOSQL + ioss + IOTecplotTable + IOTRUCHAS + IOVeraOut + IOVideo + IOVPIC + IOXdmf2 + IOXML + IOXMLParser + jpeg + jsoncpp + kissfft + libharu + libproj + libxml2 + loguru + lz4 + lzma + m_cont + m_cont_testing + mdiympi_nompi.so + metaio + m_filter_clean_grid + m_filter_connected_components + m_filter_contour + m_filter_core + m_filter_density_estimate + m_filter_entity_extraction + m_filter_field_conversion + m_filter_field_transform + m_filter_flow + m_filter_geometry_refinement + m_filter_image_processing + m_filter_mesh_info + m_filter_multi_block + m_filter_resampling + m_filter_scalar_topology + m_filter_vector_analysis + m_filter_zfp + m_io + m_source + m_worklet + netcdf + ogg + ParallelCore + ParallelDIY + png + pugixml + PythonContext2D + PythonInterpreter + RenderingAnnotation + RenderingCellGrid + RenderingContext2D + RenderingContextOpenGL2 + RenderingCore + RenderingExternal + RenderingFreeType + RenderingGL2PSOpenGL2 + RenderingHyperTreeGrid + RenderingImage + RenderingLabel + RenderingLICOpenGL2 + RenderingLOD + RenderingMatplotlib + RenderingOpenGL2 + RenderingParallel + RenderingSceneGraph + RenderingUI + RenderingVolume + RenderingVolumeAMR + RenderingVolumeOpenGL2 + RenderingVR + RenderingVtkJS + sqlite + sys + TestingDataModel + TestingGenericBridge + TestingIOSQL + TestingRendering + theora + tiff + UtilitiesBenchmarks + verdict + ViewsContext2D + ViewsCore + ViewsInfovis + vpic + WebCore + WebGLExporter + WrappingPythonCore + WrappingTools + xdmf2 + zfp + zlib +) + +# Create imported targets for each module +foreach(module ${VTK_MODULES_ENABLED}) + if(NOT TARGET VTK::${module}) + add_library(VTK::${module} SHARED IMPORTED) + if(${module} STREQUAL "WrappingPythonCore") + set_target_properties(VTK::${module} PROPERTIES + IMPORTED_LOCATION "${VTK_LIBRARY_DIRS}/libvtkWrappingPythonCore${PYTHON_VERSION}${SUFFIX}.so" + INTERFACE_INCLUDE_DIRECTORIES "${VTK_INCLUDE_DIRS}" + ) + else() + set_target_properties(VTK::${module} PROPERTIES + IMPORTED_LOCATION "${VTK_LIBRARY_DIRS}/libvtk${module}${SUFFIX}.so" + INTERFACE_INCLUDE_DIRECTORIES "${VTK_INCLUDE_DIRS}" + ) + endif() + endif() +endforeach() + +# Set VTK_LIBRARIES +set(VTK_LIBRARIES "") +foreach(module ${VTK_MODULES_ENABLED}) + list(APPEND VTK_LIBRARIES VTK::${module}) +endforeach() + +# Set VTK_FOUND +set(VTK_FOUND TRUE) + +# Set VTK_USE_FILE (for backward compatibility) +set(VTK_USE_FILE "${CMAKE_CURRENT_LIST_DIR}/UseVTK.cmake") + +# Print status +message(STATUS "Found VTK ${VTK_VERSION}") +message(STATUS " Includes: ${VTK_INCLUDE_DIRS}") +message(STATUS " Libraries: ${VTK_LIBRARIES}") +message(STATUS " Python Version: ${Python3_VERSION}") From 6a2a81b19055f857bcaa00cfcde6b3b07e9434be Mon Sep 17 00:00:00 2001 From: Konstantinos Samaras-Tsakiris Date: Tue, 2 Dec 2025 20:19:56 +0100 Subject: [PATCH 2/4] Allow older cmake versions --- .github/workflows/build-ocp.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-ocp.yml b/.github/workflows/build-ocp.yml index 146e915..a83c5b4 100644 --- a/.github/workflows/build-ocp.yml +++ b/.github/workflows/build-ocp.yml @@ -318,6 +318,7 @@ jobs: if [[ "${{ matrix.use-vtk }}" == "vtk" ]]; then env ${{ matrix.env }} cmake -S . -B build -G Ninja \ + -D CMAKE_POLICY_VERSION_MINIMUM=3.5 \ -D CMAKE_INSTALL_PREFIX=$HOME/opt/local/occt-${{ env.OCCT }}-${{ matrix.use-vtk }} \ \ -D USE_VTK=ON \ @@ -346,6 +347,7 @@ jobs: else env ${{ matrix.env }} cmake -S . -B build -G Ninja \ + -D CMAKE_POLICY_VERSION_MINIMUM=3.5 \ -D CMAKE_INSTALL_PREFIX=$HOME/opt/local/occt-${{ env.OCCT }}-${{ matrix.use-vtk }} \ \ -D USE_VTK=OFF \ @@ -380,6 +382,7 @@ jobs: if "${{ matrix.use-vtk }}"=="vtk" ( cmake -S . -B build -G Ninja ^ + -D CMAKE_POLICY_VERSION_MINIMUM=3.5 ^ -D USE_VTK=ON ^ -D USE_TBB=OFF ^ -D USE_FREEIMAGE=ON ^ @@ -406,6 +409,7 @@ jobs: ) else ( cmake -S . -B build -G Ninja ^ + -D CMAKE_POLICY_VERSION_MINIMUM=3.5 ^ -D USE_VTK=OFF ^ -D USE_TBB=OFF ^ -D USE_FREEIMAGE=ON ^ From 06cf40c35756b1900f4b2a755f66498f42d973a6 Mon Sep 17 00:00:00 2001 From: Konstantinos Samaras-Tsakiris Date: Tue, 2 Dec 2025 20:17:19 +0100 Subject: [PATCH 3/4] Build custom VTK wheels for other python versions too --- .github/workflows/build-ocp.yml | 118 +++++++++++--------------------- .github/workflows/build-vtk.yml | 2 +- 2 files changed, 42 insertions(+), 78 deletions(-) diff --git a/.github/workflows/build-ocp.yml b/.github/workflows/build-ocp.yml index a83c5b4..eb879e5 100644 --- a/.github/workflows/build-ocp.yml +++ b/.github/workflows/build-ocp.yml @@ -134,28 +134,31 @@ jobs: # - - - - - - - - - - - - - - - - - - - - - - name: Download wheel artifact - if: matrix.python-version == '3.13' && matrix.use-vtk == 'vtk' && steps.cache-vtk-restore.outputs.cache-hit != 'true' + if: (matrix.python-version == '3.13' || matrix.os == 'ubuntu-22.04-arm') && matrix.use-vtk == 'vtk' && steps.cache-vtk-restore.outputs.cache-hit != 'true' shell: bash -l {0} run: | - if [[ "${{ matrix.os }}" == "macos-14" ]]; then - echo "Downloading cadquery_vtk-${{ env.VTK }}-cp313-cp313-macosx_11_0_arm64.whl" - curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-cp313-cp313-macosx_11_0_arm64.whl + PY_VER=${{ matrix.python-version }} + PY_TAG="cp${PY_VER/./}" + + if [[ "${{ matrix.os }}" == "ubuntu-22.04-arm" ]]; then + echo "Downloading cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-linux_aarch64.whl" + curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-linux_aarch64.whl + + elif [[ "${{ matrix.os }}" == "macos-14" ]]; then + echo "Downloading cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-macosx_11_0_arm64.whl" + curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-macosx_11_0_arm64.whl elif [[ "${{ matrix.os }}" == "macos-13" ]]; then - echo "Downloading cadquery_vtk-9.3.1-cp313-cp313-macosx_11_0_x86_64.whl" - curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-9.3.1-cp313-cp313-macosx_11_0_x86_64.whl + echo "Downloading cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-macosx_11_0_x86_64.whl" + curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-macosx_11_0_x86_64.whl elif [[ "${{ matrix.os }}" == "ubuntu-20.04" ]]; then - echo "Downloading cadquery_vtk-9.3.1-cp313-cp313-linux_x86_64.whl" - curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-9.3.1-cp313-cp313-linux_x86_64.whl - - elif [[ "${{ matrix.os }}" == "ubuntu-22.04-arm" ]]; then - echo "Downloading cadquery_vtk-9.3.1-cp313-cp313-linux_aarch64.whl" - curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-9.3.1-cp313-cp313-linux_aarch64.whl + echo "Downloading cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-linux_x86_64.whl" + curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-linux_x86_64.whl else - echo "Downloading cadquery_vtk-9.3.1-cp313-cp313-win_amd64.whl" - curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-9.3.1-cp313-cp313-win_amd64.whl + echo "Downloading cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-win_amd64.whl" + curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-win_amd64.whl fi ls -l @@ -194,8 +197,8 @@ jobs: micromamba create -y -n vtk-$PY_VER python=$PY_VER micromamba activate vtk-$PY_VER - if [[ $PY_VER == 3.13 ]]; then - pip install cadquery_vtk-9.3.1*.whl + if [[ $PY_VER == 3.13 || "${{ matrix.os }}" == "ubuntu-22.04-arm" ]]; then + pip install cadquery_vtk-*.whl else pip install vtk==${{ env.VTK }} fi @@ -205,7 +208,8 @@ jobs: cp $CONDA_PREFIX/lib/python$PY_VER/site-packages/vtkmodules/${{ matrix.vtk_libs }} $DEST/lib/ cp $CONDA_PREFIX/lib/python$PY_VER/site-packages/vtk.py $DEST - if [[ "$RUNNER_OS" == "Linux" && "$PY_VER" != "3.13" ]]; then + # vtk.libs only exists in official PyPI VTK wheels, not in custom cadquery_vtk wheels + if [[ "$RUNNER_OS" == "Linux" && "$PY_VER" != "3.13" && "${{ matrix.os }}" != "ubuntu-22.04-arm" ]]; then cp $CONDA_PREFIX/lib/python$PY_VER/site-packages/vtk.libs/* $DEST/lib/ fi @@ -462,29 +466,14 @@ jobs: strategy: fail-fast: false matrix: - os: ["macos-13", "macos-14", "ubuntu-20.04", "ubuntu-22.04-arm", "windows-2019"] + os: ["ubuntu-22.04-arm"] python-version: ["3.11"] include: - - os: "macos-13" - sed_i: "gsed -i" - env: "MACOSX_DEPLOYMENT_TARGET=11.1" - shells: "bash" - - os: "macos-14" - sed_i: "gsed -i" - env: "MACOSX_DEPLOYMENT_TARGET=11.1" - shells: "bash" - - os: "ubuntu-20.04" - sed_i: "sed -i" - env: "DUMMY=0" - shells: "bash" - os: "ubuntu-22.04-arm" sed_i: "sed -i" env: "DUMMY=0" shells: "bash" - - os: "windows-2019" - sed_i: "sed -i" - shells: "bash cmd.exe" steps: - uses: actions/checkout@v4 @@ -696,47 +685,19 @@ jobs: strategy: fail-fast: false matrix: - os: ["macos-13", "macos-14", "ubuntu-20.04", "ubuntu-22.04-arm", "windows-2019"] + os: ["ubuntu-22.04-arm"] python-version: ["3.10", "3.11", "3.12", "3.13"] - use-vtk: ["vtk", "novtk"] + use-vtk: ["vtk"] include: - - os: "macos-13" - delocate: delocate - plat: macosx_11_1_x86_64 - sed_i: "gsed -i" - module: "OCP.*.so" - env: "MACOSX_DEPLOYMENT_TARGET=11.1" - shells: "bash" - - os: "macos-14" - delocate: delocate - plat: macosx_11_1_arm64 - sed_i: "gsed -i" - module: "OCP.*.so" - env: "MACOSX_DEPLOYMENT_TARGET=11.1" - shells: "bash" - - os: "ubuntu-20.04" - delocate: auditwheel patchelf - plat: manylinux_2_31_x86_64 - sed_i: "sed -i" - compilers: "" - module: "OCP.*.so" - env: "DUMMY=0" - shells: "bash" - os: "ubuntu-22.04-arm" delocate: auditwheel patchelf - plat: manylinux_2_39_aarch64 + plat: manylinux_2_35_aarch64 sed_i: "sed -i" compilers: "" module: "OCP.*.so" env: "DUMMY=0" shells: "bash" - - os: "windows-2019" - delocate: delvewheel - plat: win_amd64 - sed_i: "sed -i" - shells: "bash cmd.exe" - module: "OCP.*.pyd" steps: - uses: actions/checkout@v4 @@ -1013,7 +974,7 @@ jobs: if [[ "${{ matrix.use-vtk }}" == "vtk" ]]; then PKG_NAME="cadquery_ocp" - if [[ ${{ matrix.python-version }} == 3.13 ]]; then + if [[ ${{ matrix.python-version }} == 3.13 || "${{ matrix.os }}" == "ubuntu-22.04-arm" ]]; then ${{ matrix.sed_i }} '/requires-python/a\dependencies = [ "cadquery_vtk==${{ env.VTK }}" ]' pyproject.toml else ${{ matrix.sed_i }} '/requires-python/a\dependencies = [ "vtk==${{ env.VTK }}" ]' pyproject.toml @@ -1202,28 +1163,31 @@ jobs: pip install pytest docutils ipython - name: Download wheel artifact - if: matrix.python-version == '3.13' && matrix.use-vtk == 'vtk' + if: (matrix.python-version == '3.13' || matrix.os == 'ubuntu-22.04-arm') && matrix.use-vtk == 'vtk' shell: bash -l {0} run: | + PY_TAG="cp${{ matrix.python-version }}" + PY_TAG="${PY_TAG/./}" # Remove dot: cp3.13 -> cp313 + if [[ "${{ matrix.os }}" == "macos-14" ]]; then - echo "Downloading cadquery_vtk-${{ env.VTK }}-cp313-cp313-macosx_11_0_arm64.whl" - curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-cp313-cp313-macosx_11_0_arm64.whl + echo "Downloading cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-macosx_11_0_arm64.whl" + curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-macosx_11_0_arm64.whl elif [[ "${{ matrix.os }}" == "macos-13" ]]; then - echo "Downloading cadquery_vtk-9.3.1-cp313-cp313-macosx_11_0_x86_64.whl" - curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-cp313-cp313-macosx_11_0_x86_64.whl + echo "Downloading cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-macosx_11_0_x86_64.whl" + curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-macosx_11_0_x86_64.whl elif [[ "${{ matrix.os }}" == "ubuntu-20.04" ]]; then - echo "Downloading cadquery_vtk-9.3.1-cp313-cp313-linux_x86_64.whl" - curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-cp313-cp313-linux_x86_64.whl + echo "Downloading cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-linux_x86_64.whl" + curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-linux_x86_64.whl elif [[ "${{ matrix.os }}" == "ubuntu-22.04-arm" ]]; then - echo "Downloading cadquery_vtk-9.3.1-cp313-cp313-linux_aarch64.whl" - curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-cp313-cp313-linux_aarch64.whl + echo "Downloading cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-linux_aarch64.whl" + curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-linux_aarch64.whl else - echo "Downloading cadquery_vtk-9.3.1-cp313-cp313-win_amd64.whl" - curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-cp313-cp313-win_amd64.whl + echo "Downloading cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-win_amd64.whl" + curl -L -O ${{ env.VTK313_URL }}/cadquery_vtk-${{ env.VTK }}-${PY_TAG}-${PY_TAG}-win_amd64.whl fi ls -l @@ -1235,7 +1199,7 @@ jobs: micromamba activate test if [[ "${{ matrix.use-vtk }}" == "vtk" ]]; then - if [[ ${{ matrix.python-version }} == 3.13 ]]; then + if [[ ${{ matrix.python-version }} == 3.13 || "${{ matrix.os }}" == "ubuntu-22.04-arm" ]]; then pip install ./cadquery_vtk*.whl else pip install vtk==${{ env.VTK }} diff --git a/.github/workflows/build-vtk.yml b/.github/workflows/build-vtk.yml index 42724f4..ecdb1ba 100644 --- a/.github/workflows/build-vtk.yml +++ b/.github/workflows/build-vtk.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-20.04", "ubuntu-22.04-arm", "macos-13", "macos-14", "windows-2019"] - python-version: ["3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13"] include: - os: "macos-13" sed_i: "sed -i '.bak'" From abb62cbd0edb280ae68651851ce1810f6c07ecdd Mon Sep 17 00:00:00 2001 From: Konstantinos Samaras-Tsakiris Date: Tue, 2 Dec 2025 21:46:51 +0100 Subject: [PATCH 4/4] Add back removed matrix entries --- .github/workflows/build-ocp.yml | 50 +++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ocp.yml b/.github/workflows/build-ocp.yml index eb879e5..15eabe9 100644 --- a/.github/workflows/build-ocp.yml +++ b/.github/workflows/build-ocp.yml @@ -466,14 +466,29 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-22.04-arm"] + os: ["macos-13", "macos-14", "ubuntu-20.04", "ubuntu-22.04-arm", "windows-2019"] python-version: ["3.11"] include: + - os: "macos-13" + sed_i: "gsed -i" + env: "MACOSX_DEPLOYMENT_TARGET=11.1" + shells: "bash" + - os: "macos-14" + sed_i: "gsed -i" + env: "MACOSX_DEPLOYMENT_TARGET=11.1" + shells: "bash" + - os: "ubuntu-20.04" + sed_i: "sed -i" + env: "DUMMY=0" + shells: "bash" - os: "ubuntu-22.04-arm" sed_i: "sed -i" env: "DUMMY=0" shells: "bash" + - os: "windows-2019" + sed_i: "sed -i" + shells: "bash cmd.exe" steps: - uses: actions/checkout@v4 @@ -685,11 +700,34 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-22.04-arm"] + os: ["macos-13", "macos-14", "ubuntu-20.04", "ubuntu-22.04-arm", "windows-2019"] + python-version: ["3.10", "3.11", "3.12", "3.13"] - use-vtk: ["vtk"] + use-vtk: ["vtk", "novtk"] include: + - os: "macos-13" + delocate: delocate + plat: macosx_11_1_x86_64 + sed_i: "gsed -i" + module: "OCP.*.so" + env: "MACOSX_DEPLOYMENT_TARGET=11.1" + shells: "bash" + - os: "macos-14" + delocate: delocate + plat: macosx_11_1_arm64 + sed_i: "gsed -i" + module: "OCP.*.so" + env: "MACOSX_DEPLOYMENT_TARGET=11.1" + shells: "bash" + - os: "ubuntu-20.04" + delocate: auditwheel patchelf + plat: manylinux_2_31_x86_64 + sed_i: "sed -i" + compilers: "" + module: "OCP.*.so" + env: "DUMMY=0" + shells: "bash" - os: "ubuntu-22.04-arm" delocate: auditwheel patchelf plat: manylinux_2_35_aarch64 @@ -698,6 +736,12 @@ jobs: module: "OCP.*.so" env: "DUMMY=0" shells: "bash" + - os: "windows-2019" + delocate: delvewheel + plat: win_amd64 + sed_i: "sed -i" + shells: "bash cmd.exe" + module: "OCP.*.pyd" steps: - uses: actions/checkout@v4