Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
eadb99f
Switch to scikit-build-core
Jan 28, 2025
b06bbd5
Refine scikit-build-core config
mdealencar Jan 28, 2025
99e5120
feat: make CMAKE_BUILD_TYPE Release unless otherwise specified (CMake…
mdealencar Mar 24, 2025
25a0fe8
feat: .gitignore dist/* and tweak in CMakeLists.txt
mdealencar Mar 24, 2025
75177a4
chore: cleanup pyproject.toml
mdealencar Mar 24, 2025
167c880
chore: exclude include/* and cmake/* from wheel (pyproject.toml)
mdealencar Mar 24, 2025
4661193
feat: migrate to using pybind11 as a scikit-build-core dependency (py…
mdealencar Mar 27, 2025
6f1dd34
dist: use FetchContent to get CDT library (CMakelists.txt)
mdealencar Mar 27, 2025
f8e66ee
dist: remove submodule CDT
mdealencar Mar 27, 2025
d69b18e
feat: publish distribution to TestPyPI
mdealencar Mar 27, 2025
b268b16
dist: attempt at cibuildwheel
mdealencar Mar 27, 2025
cf23d9e
cicd: add workflow_dispatch as trigger event
mdealencar Mar 27, 2025
516ded2
cicd: wip
mdealencar Mar 27, 2025
76202da
cicd: new action from GHA guide (build-and-publish.yml)
mdealencar Mar 27, 2025
b4ce7d2
cicd: wip
mdealencar Mar 27, 2025
174130a
cicd: wip
mdealencar Mar 27, 2025
766258d
cicd: rename workflows
mdealencar Mar 27, 2025
1fb7abf
cicd: reduce to single workflow
mdealencar Mar 27, 2025
c4bf89a
cicd: change workflow file
mdealencar Mar 27, 2025
4877369
cicd: reformat workflow
mdealencar Mar 27, 2025
e73b109
cicd: limit python versions cp310-*
mdealencar Mar 27, 2025
9c89f38
cicd: adjust python version for 3.10+ and reduce number of builds whi…
mdealencar Mar 27, 2025
85b6eaa
cicd: quote string
mdealencar Mar 27, 2025
8f977a8
cicd: add full URL to manylinux image
mdealencar Mar 27, 2025
8617e47
cicd: enable more platforms
mdealencar Mar 27, 2025
66b9975
cicd: point Github action to PyPI (buildpublish.yml)
mdealencar Mar 28, 2025
9889700
deps: bump commit of CDT library (fixes CMake version < 3.5 error)
mdealencar Apr 3, 2025
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
64 changes: 64 additions & 0 deletions .github/workflows/buildpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build wheels/sdist and publish to PyPI

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:

jobs:
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build SDist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
build_wheels:
name: Wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: pypa/cibuildwheel@v2.23
env:
CIBW_ARCHS: auto64
CIBW_SKIP: "*musllinux* pp*"
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_34
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: wheelhouse/*.whl
publish_all:
name: Publish on PyPI
needs: [build_wheels, make_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
attestations: write
contents: read
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- name: Generate artifact attestations
uses: actions/attest-build-provenance@v2.2.3
with:
subject-path: "dist/*"
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.vscode/*
.idea/*
build/*
dist/*
cmake-build-*/*
python/.venv/*
.venv/*
Expand Down
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion CDT
Submodule CDT deleted from 58f34d
34 changes: 21 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
cmake_minimum_required(VERSION 3.13.0)
cmake_minimum_required(VERSION 3.18.0)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

project(
PythonCDT
VERSION 0.1.0
DESCRIPTION "Software surface data rasterizer library"
${SKBUILD_PROJECT_NAME}
VERSION ${SKBUILD_PROJECT_VERSION}
LANGUAGES CXX
)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

add_subdirectory(CDT/CDT CDT)
add_subdirectory(pybind11)
pybind11_add_module(PythonCDT cdt_bindings.cpp)
target_include_directories(
PythonCDT PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
set(PYBIND11_NEWPYTHON ON)
find_package(pybind11 CONFIG REQUIRED)

include(FetchContent)
FetchContent_Declare(
CDT
GIT_REPOSITORY https://github.com/artem-ogre/CDT.git
GIT_TAG 4b4181713c73cf0a49a5b88fb3df4acca7436235
SOURCE_SUBDIR CDT
)
target_link_libraries(PythonCDT PRIVATE CDT::CDT)
# Use rasterizer as pre-compiled header for faster test-only re-compiles
#target_precompile_headers(PythonCDT PRIVATE include/rasterizer.h)
FetchContent_MakeAvailable(CDT)

pybind11_add_module(${SKBUILD_PROJECT_NAME} MODULE cdt_bindings.cpp)
target_link_libraries(${SKBUILD_PROJECT_NAME} PRIVATE pybind11::module)
target_link_libraries(${SKBUILD_PROJECT_NAME} PRIVATE CDT::CDT)
install(TARGETS ${SKBUILD_PROJECT_NAME} LIBRARY DESTINATION .)
1 change: 0 additions & 1 deletion pybind11
Submodule pybind11 deleted from 8b48ff
40 changes: 19 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
[project]
name = "PythonCDT"
version = "0.0.1"
authors = [{name = "Leica Geosystems"}]
description = "Constrained Delaunay Triangulation"
readme = {file = "README.md", content-type = "text/markdown"}
requires-python=">=3.10"

[project.license]
text = "MPL-2.0"

[project.urls]
Repository = "https://github.com/artem-ogre/PythonCDT"

[build-system]
requires = [
"setuptools>=42",
"wheel",
"ninja",
"cmake>=3.12",
]
build-backend = "setuptools.build_meta"
requires = ["scikit-build-core", "pybind11"]
build-backend = "scikit_build_core.build"

[tool.scikit-build]
wheel.exclude = ["include/*", "cmake/*"]

[tool.isort]
profile = "black"

[tool.pytest.ini_options]
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
xfail_strict = true
filterwarnings = ["error"]
testpaths = ["tests"]

[tool.cibuildwheel]
test-command = "pytest {project}/tests"
test-extras = ["test"]
test-skip = ["*universal2:arm64"]
# Setuptools bug causes collision between pypy and cpython artifacts
before-build = "rm -rf {project}/build"
140 changes: 0 additions & 140 deletions setup.py

This file was deleted.