Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4843ad8
Removal of redundant submodules
luktug-ltd Dec 26, 2024
d13880f
Removal of redundant pyclipr stub .pyi structures
luktug-ltd Dec 26, 2024
321ac57
Removal of setuptools build infrastructure
luktug-ltd Dec 26, 2024
640a017
Bump to version 0.1.9
luktug-ltd Dec 26, 2024
ffb9fa3
Migration to hatch and scikit-build
luktug-ltd Dec 26, 2024
af5c1c0
Update to CMakeLists.txt
luktug-ltd Dec 26, 2024
f5841f9
Update to CMakeLists.txt
luktug-ltd Dec 26, 2024
71dfbd3
Fix: Update polyTreeToPaths
luktug-ltd Dec 26, 2024
8eff9a6
Added public method path2EigenVec2d
luktug-ltd Dec 26, 2024
bad84d8
Update orientation function
luktug-ltd Dec 26, 2024
96e1333
Miscellaneous fixes
luktug-ltd Dec 26, 2024
d78547e
Added pyclir::createPaths method
luktug-ltd Dec 26, 2024
a0aa2e1
Fixed: pyclipr::simplifyPath and pyclipr::simplifyPaths
luktug-ltd Dec 26, 2024
d0be09d
Fix: Scalefactors are protected and positive real values
luktug-ltd Dec 26, 2024
81f65f4
Changed: ClipperOffset attributes are accessible
luktug-ltd Dec 26, 2024
4425497
Fix: Paths are cast to py::object
luktug-ltd Dec 27, 2024
9274b10
Update to python bindings - Documentation
luktug-ltd Dec 27, 2024
5012fbb
Update to python bindings to resolve enumerations
luktug-ltd Dec 27, 2024
560cfc5
Merge branch 'main' into development
luktug-ltd Dec 27, 2024
f3b30c8
Update pythonpublish.yml
luktug-ltd Aug 17, 2025
d088450
Added Github CD Runner
luktug-ltd Aug 17, 2025
9a90aec
Update cd.yml
luktug-ltd Aug 17, 2025
df9f31a
Fix .gitignore
drlukeparry Feb 1, 2026
a517cb5
Update to CD to include Python 3.13, 3.14
luktug-ltd Feb 1, 2026
327d5ac
Update of external sources
luktug-ltd Feb 1, 2026
6c15c31
Update to external dependencies
luktug-ltd Feb 1, 2026
e4124f5
Fixes for Simplification Functions
luktug-ltd Feb 1, 2026
a78b4ea
Update CHANGELOG.md
luktug-ltd Feb 1, 2026
c226a88
Update README.rst
luktug-ltd Feb 1, 2026
f8bddcb
Update README.rst
luktug-ltd Feb 1, 2026
dc45d27
Update README.rst
luktug-ltd Feb 1, 2026
1f5a65d
Update cd.yml
luktug-ltd Feb 1, 2026
c6b3be2
Update cd.yml
luktug-ltd Feb 1, 2026
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
136 changes: 136 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Github Actions script to produce binary wheels.
#
# * One build to create all wheels (cross-platform universal wheel).
# * One build (with matrix) test the wheels on a selection of platforms.
# * One build to publish the wheels on GitHub and Pypi.

name: CD

on:
workflow_dispatch:
push:
tags:
- 'v*'
pull_request:
branches:
- main

jobs:
build-source:
name: Build all wheels
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-tags: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Display Python version
run: python3 -c "import sys; print(sys.version)"
- name: Install dev dependencies
run: |
python -m pip install --upgrade pip
pip install -U setuptools flit build twine hatchling wheel
pip install -U numpy==1.26 scikit-build-core hatch-build-scripts pybind11_stubgen scikit-build
- name: Install APT On Linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update -qq -y
sudo apt-get install -qq -y libglu1-mesa build-essential ninja-build libeigen3-dev
- name: Build wheel
run: |
python -m build -n -s
- name: Twine check
run: |
twine check dist/*
- name: Upload source distributions
uses: actions/upload-artifact@v4
with:
path: dist
name: all_wheels
build-wheels:
name: Build all wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.9, '3.10', '3.11', '3.12', '3.13', '3.14']
os: [ubuntu-latest, macos-14, macos-15, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-tags: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version}}
- name: Display Python version
run: python3 -c "import sys; print(sys.version)"
- name: Install dev dependencies
run: |
python -m pip install --upgrade pip
pip install -U setuptools flit build twine hatchling wheel
pip install -U numpy>=1.26 scikit-build-core hatch-build-scripts pybind11_stubgen scikit-build
- name: Install APT On Linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update -qq -y
sudo apt-get install -qq -y libglu1-mesa build-essential ninja-build libeigen3-dev
- name: Install Brew On Mac OS
if: matrix.os == 'macos-15' || matrix.os == 'macos-14'
run: |
brew install eigen cmake ninja
- name: Build wheel
run: |
python -m build -n -w
- name: Twine check
run: |
twine check dist/*
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
path: dist
name: wheel-${{ matrix.os }}-${{ matrix.python-version }}

publish:
name: Publish to Github and Pypi
runs-on: ubuntu-latest
needs: [build-wheels]
if: success() && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Download assets
uses: actions/download-artifact@v5
with:
path: dist
- name: Flatten dist dir
run: |
find dist -mindepth 2 -type f -exec mv -f '{}' dist/ ';'
rm -rf dist/*/
- name: Set version from git ref
run: echo "PYCLIPR_PY_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Upload Release Assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.PYCLIPR_PY_VERSION }}
name: ${{ env.PYCLIPR_PY_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
files: |
dist/*.tar.gz
dist/*.whl
body: |
Autogenerated wheels for Pyclipr
draft: false
prerelease: false
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
10 changes: 4 additions & 6 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, macos-13, windows-latest]
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-13, macos-14, windows-latest]
exclude:
- os: ubuntu-latest
python-version: '3.12'
- os: macos-13
python-version: '3.7'

steps:
- uses: actions/checkout@v2
Expand All @@ -40,7 +38,7 @@ jobs:
sudo apt-get update -qq -y
sudo apt-get install -qq -y libglu1-mesa build-essential libeigen3-dev
- name: Install Brew On Mac OS
if: matrix.os == 'macos-latest' || matrix.os == 'macos-13'
if: matrix.os == 'macos-14' || matrix.os == 'macos-13'
run: |
brew install eigen
- name: Install dependencies
Expand All @@ -65,7 +63,7 @@ jobs:
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
if: matrix.os == 'macos-latest'
if: matrix.os == 'macos-14' || matrix.os == 'macos-13'
run: |
python3 -m twine upload dist/*

Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ ehthumbs_vista.db

.idea/

### A3200 API Files

External/a3200/

# Dump file
*.stackdump
Expand Down Expand Up @@ -671,7 +669,6 @@ StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
Expand Down
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
[submodule "external/filesystem"]
path = external/filesystem
url = https://github.com/wjakob/filesystem.git
[submodule "external/pybind11"]
path = external/pybind11
url = https://github.com/pybind/pybind11
[submodule "external/eigen"]
path = external/eigen
url = https://gitlab.com/libeigen/eigen.git
[submodule "external/fmt"]
path = external/fmt
url = https://github.com/fmtlib/fmt.git
[submodule "external/clipper2"]
path = external/clipper2
url = https://github.com/AngusJohnson/Clipper2.git
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@ All notable changes to this project will be documented in this file.

### Changed


## [0.1.8] - 2026-02-01

### Added
- Added a default parameter to `pyclipr.simplifyPath`, `pyclipr.simplifyPath` and `pyclipr.orientation` to apply implicit scaling (1e3 by default) [e4124f51c7e0b604ae190bc2ae3e2364bbe72960](https://github.com/drlukeparry/pyclipr/commit/e4124f51c7e0b604ae190bc2ae3e2364bbe72960)
- Changed the build scripts to use hatchling and scikit-build [9a90aecf8ee85cb2f7501fec277391e849201f46](https://github.com/drlukeparry/pyclipr/commit/9a90aecf8ee85cb2f7501fec277391e849201f46)

### Fixed
- Fixed pyclipr.simplifyPath to scale the output paths back to original scale [e4124f51c7e0b604ae190bc2ae3e2364bbe72960](https://github.com/drlukeparry/pyclipr/commit/e4124f51c7e0b604ae190bc2ae3e2364bbe72960)

### Changed
- Updated to use latest ClipperLib2 version 2.0.1 [6c15c31d51ea4813e1f4752279cbd5f171a8d4d5](https://github.com/drlukeparry/pyclipr/commit/6c15c31d51ea4813e1f4752279cbd5f171a8d4d5)
- Updated to use latest Eigen version 5.0.1 [6c15c31d51ea4813e1f4752279cbd5f171a8d4d5](https://github.com/drlukeparry/pyclipr/commit/6c15c31d51ea4813e1f4752279cbd5f171a8d4d5)
- Updated build scripts for latest Python versions (3.11, 3.12, 3.13, 3.14)
- Updated build scripts to use latest pybind11 version 3.0.1 [6c15c31d51ea4813e1f4752279cbd5f171a8d4d5](https://github.com/drlukeparry/pyclipr/commit/6c15c31d51ea4813e1f4752279cbd5f171a8d4d5)
- Update README.rst

## [0.1.7] - 2024-01-11

### Added
Expand All @@ -21,6 +38,9 @@ All notable changes to this project will be documented in this file.
- Fixed the external submodules (clipper2, pybind, eigen) to fixed version for reference
- Fixed a build issue with latest ClipperLib (PreserveCollinear property has become a protected member)

### Changed


## [0.1.6] - 2023-12-16

### Added
Expand Down
69 changes: 21 additions & 48 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.15)

project(pyclipr VERSION 0.1.0)
project(pyclipr)

# Set c++ to use cx17 as a requirement defined in ClipperLib2
set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ version selection")
Expand Down Expand Up @@ -49,7 +49,6 @@ if(WIN32)
add_compile_options("/GS-"
"/INCREMENTAL:NO")


endif(MSVC)

# Copy the shared libraries and libs to the main directory
Expand All @@ -60,14 +59,7 @@ if(WIN32)
else(WIN32)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")

#target_compile_options(Clipper2 PRIVATE -Wall -Wextra -Wpedantic -Werror)
#target_link_libraries(Clipper2 PUBLIC -lm)

# Find Required packages
find_package(Eigen3 3.3 REQUIRED)
set(EIGEN3_INCLUDE_DIR external/eigen)

endif(WIN32)

Expand All @@ -86,33 +78,12 @@ set(CLIPPER2_INCLUDE_DIR
external/clipper2/CPP
)


# Use the replacement of Boost::filesystem from a git submodule provided by WJakob
# in order to reduce compile time dependencies
# https://github.com/wjakob/filesystem

set(CPP_FILESYSTEM
external/filesystem
)

## A replacement library for std::Format
set(CPP_FMT
external/fmt/include
)

add_definitions(-DUSINGZ=1)

link_directories(
)

if(BUILD_PYTHON)
message(STATUS "Building PyClipr Python Module")

add_subdirectory(external/pybind11)

set(PYBIND11_CPP_STANDARD /std:c++17)


endif(BUILD_PYTHON)

include_directories(
Expand All @@ -123,15 +94,8 @@ include_directories(
${EIGEN3_INCLUDE_DIR}
${CLIPPER2_INCLUDE_DIR}
${CLIPPER2_INCLUDE_DIR}/Clipper2Lib/include
${CPP_FMT}
)


link_directories(
)



set(CLIPPER2_INC
Clipper2Lib/include/clipper2/clipper.h
Clipper2Lib/include/clipper2/clipper.core.h
Expand All @@ -148,15 +112,13 @@ set(CLIPPER2_SRCS
Clipper2Lib/src/clipper.rectclip.cpp
)


set(APP_SRCS
${CLIPPER2_INC}
${CLIPPER2_SRCS}
)

PREPEND(APP_SRCS "${CLIPPER2_INCLUDE_DIR}/" ${APP_SRCS})


SOURCE_GROUP("App" FILES
${APP_SRCS}
)
Expand Down Expand Up @@ -186,7 +148,6 @@ if(BUILD_PYTHON)
EXPORT_FILE_NAME CLIPR_Export.h
STATIC_DEFINE CLIPR_BUILT_AS_STATIC)


else(BUILD_PYTHON)
message(STATUS "Building PyClipr Module Standalone - Dynamic Library")

Expand Down Expand Up @@ -215,30 +176,42 @@ if(BUILD_PYTHON)

SOURCE_GROUP("Python" FILES ${PYCLIPR_SRCS})

pybind11_add_module(pyclipr ${PYCLIPR_SRCS})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/python/pyclipr/__init__.py
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

#add_library(example MODULE main.cpp)
pybind11_add_module(pyclipr ${PYCLIPR_SRCS})

target_link_libraries(pyclipr PRIVATE pybind11::module clipr_static ${PYCLIPR_LIBS})

set_target_properties(pyclipr PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}"
SUFFIX "${PYTHON_MODULE_EXTENSION}")
SUFFIX "${PYTHON_MODULE_EXTENSION}")

add_custom_command(
TARGET pyclipr
POST_BUILD
COMMAND ls && python ${CMAKE_CURRENT_SOURCE_DIR}/pybind11stubgen.py
WORKING_DIRECTORY ${CMAKE_CURRENT_BUILD_DIR}
COMMENT "Running pybind11-stubgen"
)

install(TARGETS pyclipr DESTINATION lib/pyclipr)
install(TARGETS pyclipr DESTINATION pyclipr)

# Copy the files generated by pybind11-stubgen
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/pyclipr/__init__.pyi
${CMAKE_CURRENT_BINARY_DIR}/pyclipr/pyclipr.pyi
DESTINATION pyclipr
)

else(BUILD_PYTHON)

add_executable(main ${App_SRCS})
target_link_libraries(main clipr ${PYCLIPR_LIBS})

#install(TARGETS mpir DESTINATION )

endif(BUILD_PYTHON)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/CLIPR_Export.h
${APP_H_SRCS}
DESTINATION include/pyclipr
)

Loading
Loading