From 4c702af44d319944cdc73ace4cd406adab4dd47d Mon Sep 17 00:00:00 2001 From: Thomas Paviot Date: Wed, 31 Dec 2025 08:48:32 +0100 Subject: [PATCH 1/9] Support for python-3.13 --- azure-pipelines.yml | 22 ++++++++++++++++++++++ ci/conda/meta.yaml | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 12541dc0d..ce8027f6f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -75,3 +75,25 @@ jobs: vmImage: 'windows-2022' py_maj: 3 py_min: 12 + +- template: conda-build.yml + parameters: + name: Ubuntu_24_04_python313 + vmImage: 'ubuntu-24.04' + py_maj: 3 + py_min: 13 + +- template: conda-build.yml + parameters: + name: macOS_12_python313 + vmImage: 'macOS-latest' + py_maj: 3 + py_min: 13 + +- template: conda-build.yml + parameters: + name: Windows_VS2022_python313 + vmImage: 'windows-2022' + py_maj: 3 + py_min: 13 + diff --git a/ci/conda/meta.yaml b/ci/conda/meta.yaml index cb272cf1b..ed1000715 100644 --- a/ci/conda/meta.yaml +++ b/ci/conda/meta.yaml @@ -44,7 +44,7 @@ test: - pytest - svgwrite - wxpython >=4 - - pyside6 + - pyside6 # [not osx] about: home: https://github.com/tpaviot/pythonocc-core From 627998f7486bc59d17630c535bed4467d1753750 Mon Sep 17 00:00:00 2001 From: Thomas Paviot Date: Wed, 31 Dec 2025 09:59:10 +0100 Subject: [PATCH 2/9] Remove PySide6 dependency fron py3.13 build --- ci/conda/meta.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/conda/meta.yaml b/ci/conda/meta.yaml index ed1000715..e3fe482b1 100644 --- a/ci/conda/meta.yaml +++ b/ci/conda/meta.yaml @@ -44,7 +44,6 @@ test: - pytest - svgwrite - wxpython >=4 - - pyside6 # [not osx] about: home: https://github.com/tpaviot/pythonocc-core From b198c45635d1c3d194545c9ff85a212b78cbf976 Mon Sep 17 00:00:00 2001 From: Thomas Paviot Date: Wed, 31 Dec 2025 10:19:24 +0100 Subject: [PATCH 3/9] Replace swig_ling_libraries with target_link_libraries in CMakeLists.txt --- CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08bd62772..3cdc201e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -292,7 +292,7 @@ foreach(OCCT_MODULE ${OCCT_TOOLKIT_MODEL}) set(FILE ${SWIG_FILES_PATH}/${OCCT_MODULE}.i) set_source_files_properties(${FILE} PROPERTIES CPLUSPLUS ON) swig_add_library (${OCCT_MODULE} LANGUAGE python SOURCES ${FILE} TYPE MODULE) - swig_link_libraries(${OCCT_MODULE} ${OCCT_MODEL_LIBRARIES} Python3::Module) + target_link_libraries(${OCCT_MODULE} ${OCCT_MODEL_LIBRARIES} Python3::Module) endforeach(OCCT_MODULE) ############### @@ -306,7 +306,7 @@ set(TESSELATOR_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Tesselator/ShapeTesselator.cpp) swig_add_library(Tesselator LANGUAGE python SOURCES ${TESSELATOR_SOURCE_FILES} TYPE MODULE) -swig_link_libraries(Tesselator ${OCCT_MODEL_LIBRARIES} Python3::Module) +target_link_libraries(Tesselator ${OCCT_MODEL_LIBRARIES} Python3::Module) ################# # Visualisation # @@ -322,7 +322,7 @@ if(PYTHONOCC_WRAP_VISU) set(FILE ${SWIG_FILES_PATH}/${OCCT_MODULE}.i) set_source_files_properties(${FILE} PROPERTIES CPLUSPLUS ON) swig_add_library (${OCCT_MODULE} LANGUAGE python SOURCES ${FILE} TYPE MODULE) - swig_link_libraries(${OCCT_MODULE} ${OCCT_MODEL_LIBRARIES} ${OCCT_VISUALIZATION_LIBRARIES} Python3::Module) + target_link_libraries(${OCCT_MODULE} ${OCCT_MODEL_LIBRARIES} ${OCCT_VISUALIZATION_LIBRARIES} Python3::Module) endforeach(OCCT_MODULE) # Build third part modules @@ -335,12 +335,12 @@ if(PYTHONOCC_WRAP_VISU) ${CMAKE_CURRENT_SOURCE_DIR}/src/Visualization/Display3d.cpp) swig_add_library(Visualization LANGUAGE python SOURCES ${VISUALIZATION_SOURCE_FILES} TYPE MODULE) - swig_link_libraries(Visualization ${OCCT_MODEL_LIBRARIES} ${OCCT_VISUALIZATION_LIBRARIES} Python3::Module) + target_link_libraries(Visualization ${OCCT_MODEL_LIBRARIES} ${OCCT_VISUALIZATION_LIBRARIES} Python3::Module) if(APPLE) # on OSX, always add /System/Library/Frameworks/Cocoa.framework, even # if GLX is enabled - swig_link_libraries(Visualization /System/Library/Frameworks/Cocoa.framework) + target_link_libraries(Visualization /System/Library/Frameworks/Cocoa.framework) endif(APPLE) ########################## @@ -355,7 +355,7 @@ if(PYTHONOCC_WRAP_VISU) ${CMAKE_CURRENT_SOURCE_DIR}/src/MeshDataSource/MeshDataSource.cpp) swig_add_library(MeshDS LANGUAGE python SOURCES ${MESHDATASOURCE_SOURCE_FILES} TYPE MODULE) - swig_link_libraries(MeshDS ${OCCT_MODEL_LIBRARIES} ${OCCT_VISUALIZATION_LIBRARIES} Python3::Module) + target_link_libraries(MeshDS ${OCCT_MODEL_LIBRARIES} ${OCCT_VISUALIZATION_LIBRARIES} Python3::Module) endif(PYTHONOCC_WRAP_VISU) @@ -367,7 +367,7 @@ if(PYTHONOCC_WRAP_DATAEXCHANGE) set(FILE ${SWIG_FILES_PATH}/${OCCT_MODULE}.i) set_source_files_properties(${FILE} PROPERTIES CPLUSPLUS ON) swig_add_library(${OCCT_MODULE} LANGUAGE python SOURCES ${FILE} TYPE MODULE) - swig_link_libraries(${OCCT_MODULE} ${OCCT_MODEL_LIBRARIES} ${OCCT_DATAEXCHANGE_LIBRARIES} Python3::Module) + target_link_libraries(${OCCT_MODULE} ${OCCT_MODEL_LIBRARIES} ${OCCT_DATAEXCHANGE_LIBRARIES} Python3::Module) endforeach(OCCT_MODULE) endif(PYTHONOCC_WRAP_DATAEXCHANGE) @@ -379,7 +379,7 @@ if(PYTHONOCC_WRAP_OCAF) set(FILE ${SWIG_FILES_PATH}/${OCCT_MODULE}.i) set_source_files_properties(${FILE} PROPERTIES CPLUSPLUS ON) swig_add_library(${OCCT_MODULE} LANGUAGE python SOURCES ${FILE} TYPE MODULE) - swig_link_libraries(${OCCT_MODULE} ${OCCT_MODEL_LIBRARIES} ${OCCT_OCAF_LIBRARIES} Python3::Module) + target_link_libraries(${OCCT_MODULE} ${OCCT_MODEL_LIBRARIES} ${OCCT_OCAF_LIBRARIES} Python3::Module) endforeach(OCCT_MODULE) endif(PYTHONOCC_WRAP_OCAF) @@ -398,7 +398,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/src/Addons/Font3d.cpp ) swig_add_library(Addons LANGUAGE python SOURCES ${ADDONS_SOURCE_FILES} TYPE MODULE) -swig_link_libraries(Addons ${OCCT_MODEL_LIBRARIES} ${OCCT_VISUALIZATION_LIBRARIES} Python3::Module) +target_link_libraries(Addons ${OCCT_MODEL_LIBRARIES} ${OCCT_VISUALIZATION_LIBRARIES} Python3::Module) ################ # Installation # From 65ec7d341719637b0a92770052172f9901ca1a0f Mon Sep 17 00:00:00 2001 From: Thomas Paviot Date: Wed, 31 Dec 2025 11:10:44 +0100 Subject: [PATCH 4/9] Install GUI dependencies for win only (only windows platform run GUI tests) --- ci/conda/meta.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ci/conda/meta.yaml b/ci/conda/meta.yaml index e3fe482b1..7db7c8b98 100644 --- a/ci/conda/meta.yaml +++ b/ci/conda/meta.yaml @@ -26,12 +26,14 @@ requirements: host: - python {{ python }} + - python_abi * *_cp313 [py==313] - occt ==7.9.3 - numpy >=1.17 run: - occt ==7.9.3 - numpy >=1.17 + - python_abi * *_cp313 [py==313] test: imports: @@ -39,11 +41,12 @@ test: - OCC.Core.BRepPrimAPI - OCC.Core.Tesselator requires: - - pyqt >=5 + - pyqt5-sip # [win] + - pyside6 >=6.10 # [win] + - wxpython >=4.2 # [win] + - svgwrite >=1.4 - mypy - pytest - - svgwrite - - wxpython >=4 about: home: https://github.com/tpaviot/pythonocc-core From cda19c6fcf7af9fc6719cb4ba92d7a9198c2fb39 Mon Sep 17 00:00:00 2001 From: Thomas Paviot Date: Wed, 31 Dec 2025 19:16:40 +0100 Subject: [PATCH 5/9] Fix py3.13 installation directory discovery --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cdc201e7..d26babe1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,7 +196,10 @@ if(NOT DEFINED PYTHONOCC_INSTALL_DIRECTORY) message(STATUS "conda-build running, using $ENV{SP_DIR} as install dir") set(PYTHONOCC_INSTALL_DIRECTORY $ENV{SP_DIR}/OCC CACHE PATH "pythonocc install directory") else(DEFINED ENV{SP_DIR} AND WIN32) - execute_process(COMMAND ${Python3_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; from os.path import relpath; print(relpath(get_python_lib(1,prefix='${CMAKE_INSTALL_PREFIX}'),'${CMAKE_INSTALL_PREFIX}'))" OUTPUT_VARIABLE python_lib OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND ${Python3_EXECUTABLE} -c "import sysconfig, os, sys; print(os.path.relpath(sysconfig.get_path('platlib'), sys.prefix))" + OUTPUT_VARIABLE python_lib + OUTPUT_STRIP_TRAILING_WHITESPACE) set(PYTHONOCC_INSTALL_DIRECTORY ${python_lib}/OCC CACHE PATH "pythonocc install directory") endif(DEFINED ENV{SP_DIR} AND WIN32) endif(NOT DEFINED PYTHONOCC_INSTALL_DIRECTORY) From 425adee17fb414fceeded6bd6517f08f57722099 Mon Sep 17 00:00:00 2001 From: Thomas Paviot Date: Thu, 1 Jan 2026 11:47:38 +0100 Subject: [PATCH 6/9] Fix dylib warnings on OSX 10.13 (used by conda build) --- ci/conda/build.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ci/conda/build.sh b/ci/conda/build.sh index 5a9b913dd..662ef3e55 100644 --- a/ci/conda/build.sh +++ b/ci/conda/build.sh @@ -1,7 +1,11 @@ #!/bin/bash -# make an in source build do to some problems with install # Configure step +EXTRA_CMAKE_ARGS="" +if [ "$(uname)" == "Darwin" ]; then + EXTRA_CMAKE_ARGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13" +fi + cmake -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH=$PREFIX \ @@ -12,17 +16,11 @@ cmake -G Ninja \ -DPython3_FIND_STRATEGY=LOCATION \ -DPython3_FIND_FRAMEWORK=NEVER \ -DSWIG_HIDE_WARNINGS=ON \ - -DPYTHONOCC_MESHDS_NUMPY=ON + -DPYTHONOCC_MESHDS_NUMPY=ON \ + $EXTRA_CMAKE_ARGS # Build step ninja # Install step ninja install - -# fix rpaths -#if [ $(uname) == Darwin ]; then -# for lib in $(ls $SP_DIR/OCC/_*.so); do -# install_name_tool -rpath $PREFIX/lib @loader_path/../../../ $lib -# done -#fi From 632ee71d83eb0e88cbedc55a9fff55e11325b4a8 Mon Sep 17 00:00:00 2001 From: Thomas Paviot Date: Thu, 1 Jan 2026 11:48:26 +0100 Subject: [PATCH 7/9] Add support for py3.14 --- azure-pipelines.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ce8027f6f..5be7ad252 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -97,3 +97,23 @@ jobs: py_maj: 3 py_min: 13 +- template: conda-build.yml + parameters: + name: Ubuntu_24_04_python314 + vmImage: 'ubuntu-24.04' + py_maj: 3 + py_min: 14 + +- template: conda-build.yml + parameters: + name: macOS_12_python314 + vmImage: 'macOS-latest' + py_maj: 3 + py_min: 14 + +- template: conda-build.yml + parameters: + name: Windows_VS2022_python314 + vmImage: 'windows-2022' + py_maj: 3 + py_min: 14 From 5f2478f244f657ec9577d2dcc960dc10990f658c Mon Sep 17 00:00:00 2001 From: Thomas Paviot Date: Fri, 2 Jan 2026 05:47:08 +0100 Subject: [PATCH 8/9] Split env build for build --- conda-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conda-build.yml b/conda-build.yml index 309d09fd3..287a74ad8 100644 --- a/conda-build.yml +++ b/conda-build.yml @@ -44,7 +44,7 @@ jobs: conda info -a && \ conda config --add channels https://conda.anaconda.org/conda-forge displayName: 'Conda config and info' - - bash: conda create --yes --quiet --name build_env conda-build conda-verify libarchive python=${{ parameters.py_maj }}.${{ parameters.py_min }} anaconda-client + - bash: conda create --yes --quiet --name build_env conda-build conda-verify libarchive python=3.12 anaconda-client displayName: 'Create Anaconda environment' - ${{ if eq(parameters.vmImage, 'windows-2022') }}: - script: | @@ -54,7 +54,7 @@ jobs: set CC=cl.exe set CXX=cl.exe call activate build_env - conda-build --no-remove-work-dir --dirty ci/conda + conda-build --python ${{ parameters.py_maj }}.${{ parameters.py_min }} --no-remove-work-dir --dirty ci/conda displayName: 'Set Windows environment and build' env: CXX: "cl.exe" @@ -66,7 +66,7 @@ jobs: - ${{ if not(contains(parameters.vmImage, 'win')) }}: - bash: | source activate build_env && \ - conda-build --no-remove-work-dir --dirty ci/conda + conda-build --python ${{ parameters.py_maj }}.${{ parameters.py_min }} --no-remove-work-dir --dirty ci/conda displayName: 'Run conda build' failOnStderr: false env: From dcea90071292cf08ea25b75a08ca5e3e19d6d6a6 Mon Sep 17 00:00:00 2001 From: Thomas Paviot Date: Fri, 2 Jan 2026 08:00:02 +0100 Subject: [PATCH 9/9] Use regulare py3.14 (the GIL one) --- ci/conda/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/conda/meta.yaml b/ci/conda/meta.yaml index 7db7c8b98..239a273f2 100644 --- a/ci/conda/meta.yaml +++ b/ci/conda/meta.yaml @@ -27,6 +27,7 @@ requirements: host: - python {{ python }} - python_abi * *_cp313 [py==313] + - python_abi * *_cp314 [py==314] - occt ==7.9.3 - numpy >=1.17 @@ -34,6 +35,7 @@ requirements: - occt ==7.9.3 - numpy >=1.17 - python_abi * *_cp313 [py==313] + - python_abi * *_cp314 [py==314] test: imports: