Skip to content

Try python 3.13 #286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
"master"
],
"python-version": [
"3.8",
"3.9",
"3.10",
"3.11",
"3.12"
"3.13"
],
"os": [
"ubuntu-latest",
"macos-15",
"macos-latest",
"macos-13",
"windows-2025",
"windows-latest"
],
"exclude": [
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: Upgrade pip
run: |
python3 -m pip install --upgrade pip
python -m pip install --upgrade pip

- name: Create Source Distribution
run: |
Expand All @@ -54,7 +54,12 @@ jobs:
CGAL_SWIG_BINDINGS_VERSION=$(git show --no-patch --format='format:%ad' --date=format:'%Y%m%d%H%M')
CGAL_PYTHON_MODULE_VERSION=$CGAL_VERSION-$CGAL_SWIG_BINDINGS_VERSION
export CGAL_PYTHON_MODULE_VERSION
python3 setup.py sdist
python setup.py sdist

- name: Test Source Distribution
run: |
pip install dist/*.tar.gz
python -c "import CGAL; print(CGAL.__version__)"

- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -143,6 +148,10 @@ jobs:
[ -f $HOME/.local/lib/liblas.dylib ] && install_name_tool -id '@rpath/liblas.dylib' $HOME/.local/lib/liblas.dylib
popd

- name: Upgrade pip
run: |
python -m pip install --upgrade pip

- name: Build local wheel
shell: bash -l {0}
run: |
Expand Down Expand Up @@ -179,7 +188,7 @@ jobs:
export DYLD_LIBRARY_PATH
CXXFLAGS=-faligned-allocation
export CXXFLAGS
CGAL_DIR=$HOME/.local python -m pip wheel -v .
CGAL_DIR=$HOME/.local python -m pip wheel twine -v .
delocate-listdeps --all cgal-*.whl
delocate-wheel -v -w fixed_wheel cgal-*.whl
delocate-listdeps --all fixed_wheel/*.whl
Expand All @@ -193,7 +202,7 @@ jobs:
export CXXFLAGS
export LIB
export CGAL_DIR
python -m pip wheel -v .
python -m pip wheel twine -v .
;;
esac
unzip -l cgal-*whl
Expand Down Expand Up @@ -271,7 +280,7 @@ jobs:
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
run: |
pip install twine
python3 -m twine upload --verbose --repository testpypi dist/*
python -m twine upload --verbose --repository testpypi dist/*

- name: upload to PyPI
if: github.event_name == 'push' && github.ref_name == 'main'
Expand All @@ -280,4 +289,4 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install twine
python3 -m twine upload --verbose dist/*
python -m twine upload --verbose dist/*
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ _deps
cgal.egg-info/
*.whl
examples/java/error.txt
dist/

# CMake - commonly used build place
build*/

# Visual Studio Code
.vscode/

1 change: 1 addition & 0 deletions .integration/conda-env-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ dependencies:
- swig
- tbb
- tbb-devel
- pip
- wheel
- bzip2
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ project(CGAL-bindings)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/SWIG_CGAL_Macros.cmake)

find_package(CGAL REQUIRED OPTIONAL_COMPONENTS ImageIO)
message(STATUS "CGAL version: ${CGAL_VERSION_PUBLIC_RELEASE_VERSION}")
if(GET_CGAL_VERSION)
return()
endif()
find_package(SWIG REQUIRED)
option( BUILD_PYTHON "Build Python bindings" ON )
option( BUILD_JAVA "Build Java bindings" ON )
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include CMakeLists.txt
recursive-include SWIG_CGAL *
recursive-include cmake *
3 changes: 3 additions & 0 deletions SWIG_CGAL/Common/Output_iterator_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class Generic_output_iterator
#include <CGAL/value_type_traits.h>

namespace CGAL{

template <class T> struct value_type_traits;

template <class Cpp_wrapper, class Cpp_base>
struct value_type_traits<
boost::function_output_iterator< Container_writer<Cpp_wrapper, Cpp_base> >
Expand Down
7 changes: 6 additions & 1 deletion SWIG_CGAL/Triangulation_2/Constrained_triangulation_plus_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@
#include <SWIG_CGAL/Triangulation_2/triangulation_handles.h>
template <class Triangulation,class Point>
struct Iterator_helper<std::pair<SWIG_Triangulation_2::CGAL_Vertex_handle<Triangulation,Point>,SWIG_Triangulation_2::CGAL_Vertex_handle<Triangulation,Point> > >{
typedef SWIG_Triangulation_2::CGAL_Vertex_handle<Triangulation,Point> Vertex_handle;
using Vertex_handle = SWIG_Triangulation_2::CGAL_Vertex_handle<Triangulation,Point>;
using Tr_vh = typename Triangulation::Vertex_handle;

template <class T1, class T2>
static std::pair<Vertex_handle,Vertex_handle> convert(const std::pair<T1,T2>& i){
return std::pair<Vertex_handle,Vertex_handle>(Vertex_handle(i.first.first),Vertex_handle(i.first.second));
}

static auto convert(const std::pair<Tr_vh ,Tr_vh>& pair){
return std::pair<Vertex_handle,Vertex_handle>(Vertex_handle(pair.first),Vertex_handle(pair.second));
}

static std::pair<Vertex_handle,Vertex_handle> convert(const typename Triangulation::Constraint_id& i){
return std::pair<Vertex_handle,Vertex_handle>(Vertex_handle(i.second->front().vertex()),
Vertex_handle(i.second->back().vertex()));
Expand Down
34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "cgal"
dynamic = ["version"]
authors = [
{ name = "CGAL Project" }
]
description = "CGAL bindings, allowing to use some of the CGAL library in Python."
readme = "README.md"
requires-python = ">=3.9"
license = "GPL-3.0-or-later"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: Unix",
"Programming Language :: C++",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Software Development :: Libraries"
]

[project.urls]
Homepage = "https://github.com/CGAL/cgal-swig-bindings"

[project.optional-dependencies]
main = ["numpy"]
Loading
Loading