From eadb99fdd903448dfc9c0c2d1e0849e9e9ae1afa Mon Sep 17 00:00:00 2001 From: masoda Date: Tue, 28 Jan 2025 21:46:27 +0100 Subject: [PATCH 01/27] Switch to scikit-build-core --- CMakeLists.txt | 8 ++- pyproject.toml | 23 ++++++--- setup.py | 133 ++----------------------------------------------- 3 files changed, 23 insertions(+), 141 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a51f53..ca6f767 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,11 @@ -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}) project( PythonCDT - VERSION 0.1.0 - DESCRIPTION "Software surface data rasterizer library" + VERSION 0.0.1 + DESCRIPTION "Constrained Delaunay Triangulation" LANGUAGES CXX ) @@ -19,5 +19,3 @@ target_include_directories( PythonCDT PRIVATE $ ) 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) diff --git a/pyproject.toml b/pyproject.toml index 7b3b581..8a461d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,20 @@ +[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.6" + +[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"] +build-backend = "scikit_build_core.build" [tool.isort] profile = "black" diff --git a/setup.py b/setup.py index cbe1c3b..6c5f46a 100644 --- a/setup.py +++ b/setup.py @@ -1,139 +1,14 @@ -import os -import re -import subprocess -import sys +from skbuild import setup -from setuptools import Extension, setup -from setuptools.command.build_ext import build_ext - -# Convert distutils Windows platform specifiers to CMake -A arguments -PLAT_TO_CMAKE = { - "win32": "Win32", - "win-amd64": "x64", - "win-arm32": "ARM", - "win-arm64": "ARM64", -} - - -# A CMakeExtension needs a sourcedir instead of a file list. -# The name must be the _single_ output extension from the CMake build. -# If you need multiple extensions, see scikit-build. -class CMakeExtension(Extension): - def __init__(self, name, sourcedir=""): - Extension.__init__(self, name, sources=[]) - self.sourcedir = os.path.abspath(sourcedir) - - -class CMakeBuild(build_ext): - def build_extension(self, ext): - extdir = os.path.abspath(os.path.dirname( - self.get_ext_fullpath(ext.name))) - - # required for auto-detection & inclusion of auxiliary "native" libs - if not extdir.endswith(os.path.sep): - extdir += os.path.sep - - debug = int(os.environ.get("DEBUG", 0) - ) if self.debug is None else self.debug - cfg = "Debug" if debug else "Release" - - # CMake lets you override the generator - we need to check this. - # Can be set with Conda-Build, for example. - cmake_generator = os.environ.get("CMAKE_GENERATOR", "") - - # Set Python_EXECUTABLE instead if you use PYBIND11_FINDPYTHON - # EXAMPLE_VERSION_INFO shows you how to pass a value into the C++ code - # from Python. - cmake_args = [ - f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}", - f"-DPYTHON_EXECUTABLE={sys.executable}", - f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm - ] - build_args = [] - # Adding CMake arguments set as environment variable - # (needed e.g. to build for ARM OSx on conda-forge) - if "CMAKE_ARGS" in os.environ: - cmake_args += [ - item for item in os.environ["CMAKE_ARGS"].split(" ") if item] - - # In this example, we pass in the version to C++. You might not need to. - cmake_args += [ - f"-DEXAMPLE_VERSION_INFO={self.distribution.get_version()}"] - - if self.compiler.compiler_type != "msvc": - # Using Ninja-build since it a) is available as a wheel and b) - # multithreads automatically. MSVC would require all variables be - # exported for Ninja to pick it up, which is a little tricky to do. - # Users can override the generator with CMAKE_GENERATOR in CMake - # 3.15+. - if not cmake_generator: - try: - import ninja # noqa: F401 - - cmake_args += ["-GNinja"] - except ImportError: - pass - - else: - - # Single config generators are handled "normally" - single_config = any( - x in cmake_generator for x in {"NMake", "Ninja"}) - - # CMake allows an arch-in-generator style for backward compatibility - contains_arch = any(x in cmake_generator for x in {"ARM", "Win64"}) - - # Specify the arch if using MSVC generator, but only if it doesn't - # contain a backward-compatibility arch spec already in the - # generator name. - if not single_config and not contains_arch: - cmake_args += ["-A", PLAT_TO_CMAKE[self.plat_name]] - - # Multi-config generators have a different way to specify configs - if not single_config: - cmake_args += [ - f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{cfg.upper()}={extdir}" - ] - build_args += ["--config", cfg] - - if sys.platform.startswith("darwin"): - # Cross-compile support for macOS - respect ARCHFLAGS if set - archs = re.findall(r"-arch (\S+)", os.environ.get("ARCHFLAGS", "")) - if archs: - cmake_args += [ - "-DCMAKE_OSX_ARCHITECTURES={}".format(";".join(archs))] - - # Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level - # across all generators. - if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ: - # self.parallel is a Python 3 only way to set parallel jobs by hand - # using -j in the build_ext call, not supported by pip or PyPA-build. - if hasattr(self, "parallel") and self.parallel: - # CMake 3.12+ only. - build_args += [f"-j{self.parallel}"] - - if not os.path.exists(self.build_temp): - os.makedirs(self.build_temp) - - subprocess.check_call( - ["cmake", ext.sourcedir] + cmake_args, cwd=self.build_temp - ) - subprocess.check_call( - ["cmake", "--build", "."] + build_args, cwd=self.build_temp - ) - - -# The information here can also be placed in setup.cfg - better separation of -# logic and declaration, and simpler if you include description/version in a file. setup( name="PythonCDT", version="0.0.1", author="Leica Geosystems", author_email="", - description="Test", + license="MPL-2.0", + url="https://github.com/artem-ogre/PythonCDT", + description="Constrained Delaunay Triangulation", long_description="", - ext_modules=[CMakeExtension("PythonCDT")], - cmdclass={"build_ext": CMakeBuild}, zip_safe=False, extras_require={"test": ["pytest>=6.0"]}, python_requires=">=3.6", From b06bbd507a3e9cd90dfb511f4c3a45f2b8b78724 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Tue, 28 Jan 2025 23:30:38 +0100 Subject: [PATCH 02/27] Refine scikit-build-core config --- CMakeLists.txt | 15 +++++---------- pyproject.toml | 2 -- setup.py | 15 --------------- 3 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 setup.py diff --git a/CMakeLists.txt b/CMakeLists.txt index ca6f767..5320a1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.18.0) -set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) - project( - PythonCDT - VERSION 0.0.1 - DESCRIPTION "Constrained Delaunay Triangulation" + ${SKBUILD_PROJECT_NAME} + VERSION ${SKBUILD_PROJECT_VERSION} LANGUAGES CXX ) @@ -14,8 +11,6 @@ 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 $ -) -target_link_libraries(PythonCDT PRIVATE CDT::CDT) +pybind11_add_module(${SKBUILD_PROJECT_NAME} cdt_bindings.cpp) +target_link_libraries(${SKBUILD_PROJECT_NAME} PRIVATE CDT::CDT) +install(TARGETS ${SKBUILD_PROJECT_NAME} DESTINATION .) diff --git a/pyproject.toml b/pyproject.toml index 8a461d5..e937710 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,5 +30,3 @@ testpaths = ["tests"] 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" diff --git a/setup.py b/setup.py deleted file mode 100644 index 6c5f46a..0000000 --- a/setup.py +++ /dev/null @@ -1,15 +0,0 @@ -from skbuild import setup - -setup( - name="PythonCDT", - version="0.0.1", - author="Leica Geosystems", - author_email="", - license="MPL-2.0", - url="https://github.com/artem-ogre/PythonCDT", - description="Constrained Delaunay Triangulation", - long_description="", - zip_safe=False, - extras_require={"test": ["pytest>=6.0"]}, - python_requires=">=3.6", -) From 99e5120f06469f3df7b020e1c6172fca1a659243 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Mon, 24 Mar 2025 23:17:24 +0100 Subject: [PATCH 03/27] feat: make CMAKE_BUILD_TYPE Release unless otherwise specified (CMakeLists.txt) --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5320a1a..96d7309 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,9 @@ cmake_minimum_required(VERSION 3.18.0) +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + project( ${SKBUILD_PROJECT_NAME} VERSION ${SKBUILD_PROJECT_VERSION} From 25a0fe8c8b7c98d9a9662fe5339ef58380dcaf91 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Mon, 24 Mar 2025 23:40:39 +0100 Subject: [PATCH 04/27] feat: .gitignore dist/* and tweak in CMakeLists.txt --- .gitignore | 1 + CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4ef79c3..c6ef758 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .vscode/* .idea/* build/* +dist/* cmake-build-*/* python/.venv/* .venv/* diff --git a/CMakeLists.txt b/CMakeLists.txt index 96d7309..7b9ad2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,4 +17,4 @@ add_subdirectory(CDT/CDT CDT) add_subdirectory(pybind11) pybind11_add_module(${SKBUILD_PROJECT_NAME} cdt_bindings.cpp) target_link_libraries(${SKBUILD_PROJECT_NAME} PRIVATE CDT::CDT) -install(TARGETS ${SKBUILD_PROJECT_NAME} DESTINATION .) +install(TARGETS ${SKBUILD_PROJECT_NAME} LIBRARY DESTINATION .) From 75177a4fd9f6e175d08e320bfc7de8875845f962 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Mon, 24 Mar 2025 23:50:04 +0100 Subject: [PATCH 05/27] chore: cleanup pyproject.toml --- pyproject.toml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e937710..fd322c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,17 +16,9 @@ Repository = "https://github.com/artem-ogre/PythonCDT" requires = ["scikit-build-core"] build-backend = "scikit_build_core.build" +# [tool.setuptools.packages.find] +# exclude = [ +# ] + [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"] From 167c880d3581ca602bfad360a128c5074d0b8114 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Tue, 25 Mar 2025 00:07:20 +0100 Subject: [PATCH 06/27] chore: exclude include/* and cmake/* from wheel (pyproject.toml) --- pyproject.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fd322c1..037aa5d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,9 +16,8 @@ Repository = "https://github.com/artem-ogre/PythonCDT" requires = ["scikit-build-core"] build-backend = "scikit_build_core.build" -# [tool.setuptools.packages.find] -# exclude = [ -# ] +[tool.scikit-build] +wheel.exclude = ["include/*", "cmake/*"] [tool.isort] profile = "black" From 46611934075a21355f45251480ad1156986cc484 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 11:11:14 +0100 Subject: [PATCH 07/27] feat: migrate to using pybind11 as a scikit-build-core dependency (pyproject.toml, CMakeLists.txt, .gitmodules) --- .gitmodules | 3 --- CMakeLists.txt | 7 +++++-- pybind11 | 1 - pyproject.toml | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) delete mode 160000 pybind11 diff --git a/.gitmodules b/.gitmodules index 498897e..5ccc340 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ [submodule "CDT"] path = CDT url = https://github.com/artem-ogre/CDT.git -[submodule "pybind11"] - path = pybind11 - url = https://github.com/pybind/pybind11.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b9ad2b..7bf4df1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,8 +13,11 @@ project( set(CMAKE_CXX_STANDARD 17) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +set(PYBIND11_NEWPYTHON ON) +find_package(pybind11 CONFIG REQUIRED) + add_subdirectory(CDT/CDT CDT) -add_subdirectory(pybind11) -pybind11_add_module(${SKBUILD_PROJECT_NAME} cdt_bindings.cpp) +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 .) diff --git a/pybind11 b/pybind11 deleted file mode 160000 index 8b48ff8..0000000 --- a/pybind11 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8b48ff878c168b51fe5ef7b8c728815b9e1a9857 diff --git a/pyproject.toml b/pyproject.toml index 037aa5d..0f2e980 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ text = "MPL-2.0" Repository = "https://github.com/artem-ogre/PythonCDT" [build-system] -requires = ["scikit-build-core"] +requires = ["scikit-build-core", "pybind11"] build-backend = "scikit_build_core.build" [tool.scikit-build] From 6f1dd3499dd17f513eb677f0cb1148bc1debb250 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 12:18:04 +0100 Subject: [PATCH 08/27] dist: use FetchContent to get CDT library (CMakelists.txt) --- .gitmodules | 3 --- CMakeLists.txt | 10 +++++++++- 2 files changed, 9 insertions(+), 4 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 5ccc340..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "CDT"] - path = CDT - url = https://github.com/artem-ogre/CDT.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 7bf4df1..c3e497e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,15 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(PYBIND11_NEWPYTHON ON) find_package(pybind11 CONFIG REQUIRED) -add_subdirectory(CDT/CDT CDT) +include(FetchContent) +FetchContent_Declare( + CDT + GIT_REPOSITORY https://github.com/artem-ogre/CDT.git + GIT_TAG e5fe660c4c94b16493ef3f06abae01e53e0dd81f + SOURCE_SUBDIR CDT +) +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) From f8e66ee4dc78eb2fb064621d4390faa2153aa464 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 12:20:19 +0100 Subject: [PATCH 09/27] dist: remove submodule CDT --- CDT | 1 - 1 file changed, 1 deletion(-) delete mode 160000 CDT diff --git a/CDT b/CDT deleted file mode 160000 index 58f34da..0000000 --- a/CDT +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 58f34da24b438bd17629450fcec189ccb181dc9f From d69b18e2d0ee9d635bff61368e2ac6d67e040c09 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 15:06:42 +0100 Subject: [PATCH 10/27] feat: publish distribution to TestPyPI --- .github/workflows/publish-to-test-pypi.yml | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/publish-to-test-pypi.yml diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml new file mode 100644 index 0000000..fd91ecc --- /dev/null +++ b/.github/workflows/publish-to-test-pypi.yml @@ -0,0 +1,54 @@ +name: Publish Python distribution to TestPyPI + +on: push + +jobs: + build: + name: Build distribution + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + publish-to-testpypi: + name: Publish Python distribution to TestPyPI + needs: + - build + runs-on: ubuntu-latest + + environment: + name: testpypi + url: https://test.pypi.org/p/PythonCDT + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish all the dists + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ From b268b16ba71added7f9eecb339f98e3e96015b4c Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 17:10:19 +0100 Subject: [PATCH 11/27] dist: attempt at cibuildwheel --- .github/workflows/cibuildwheel.yml | 69 ++++++++++++++++++++++ .github/workflows/publish-to-test-pypi.yml | 61 ++++++++++--------- 2 files changed, 102 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/cibuildwheel.yml diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml new file mode 100644 index 0000000..bc69c05 --- /dev/null +++ b/.github/workflows/cibuildwheel.yml @@ -0,0 +1,69 @@ +name: Build wheels for multiple platforms + +# on: +# workflow_dispatch: +# pull_request: +# push: +# branches: +# - main +# release: +# types: +# - published + +jobs: + build_wheels: + name: Build wheels for ${{ matrix.os }} + runs-on: ${{ matrix.runs-on }} + strategy: + matrix: + # os: [ linux-intel, linux-arm, windows, macOS-intel, macOS-arm ] + os: [ linux-intel, windows ] + include: + - archs: auto + platform: auto + - os: linux-intel + runs-on: ubuntu-latest + - os: linux-arm + runs-on: ubuntu-24.04-arm + - os: windows + runs-on: windows-latest + - os: macos-intel + # macos-13 was the last x86_64 runner + runs-on: macos-13 + - os: macos-arm + # macos-14+ (including latest) are ARM64 runners + runs-on: macos-latest + archs: auto,universal2 + + steps: + - uses: actions/checkout@v4 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.23.2 + env: + CIBW_PLATFORM: ${{ matrix.platform }} + CIBW_ARCHS: ${{ matrix.archs }} + # Can also be configured directly, using `with:` + # with: + # package-dir: . + # output-dir: wheelhouse + # config-file: "{package}/pyproject.toml" + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + 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 diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index fd91ecc..3761a72 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -1,38 +1,43 @@ name: Publish Python distribution to TestPyPI -on: push +# on: push jobs: - build: - name: Build distribution + download-wheels: + name: Get the pre-built wheels runs-on: ubuntu-latest + # this must match the cibuildwheel.yml section + strategy: + matrix: + # os: [ linux-intel, linux-arm, windows, macOS-intel, macOS-arm ] + os: [ linux-intel, windows ] + include: + - archs: auto + platform: auto + - os: linux-intel + runs-on: ubuntu-latest + - os: linux-arm + runs-on: ubuntu-24.04-arm + - os: windows + runs-on: windows-latest + - os: macos-intel + # macos-13 was the last x86_64 runner + runs-on: macos-13 + - os: macos-arm + # macos-14+ (including latest) are ARM64 runners + runs-on: macos-latest + archs: auto,universal2 + steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - name: Install pypa/build - run: >- - python3 -m - pip install - build - --user - - name: Build a binary wheel and a source tarball - run: python3 -m build - - name: Store the distribution packages - uses: actions/upload-artifact@v4 + - name: Download wheels + uses: actions/download-artifact@v4 with: - name: python-package-distributions - path: dist/ - + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: wheelhouse/ + publish-to-testpypi: name: Publish Python distribution to TestPyPI - needs: - - build runs-on: ubuntu-latest environment: @@ -43,11 +48,11 @@ jobs: id-token: write # IMPORTANT: mandatory for trusted publishing steps: - - name: Download all the dists + - name: Download source distribution uses: actions/download-artifact@v4 with: - name: python-package-distributions - path: dist/ + name: cibw-sdist + path: wheelhouse/ - name: Publish all the dists uses: pypa/gh-action-pypi-publish@release/v1 with: From cf23d9ea2b0c3e1e59ee8d36ac1aef1da443d0c3 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 17:15:07 +0100 Subject: [PATCH 12/27] cicd: add workflow_dispatch as trigger event --- .github/workflows/cibuildwheel.yml | 4 ++-- .github/workflows/publish-to-test-pypi.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index bc69c05..c0c618f 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -1,7 +1,7 @@ name: Build wheels for multiple platforms -# on: -# workflow_dispatch: +on: + workflow_dispatch: # pull_request: # push: # branches: diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 3761a72..f41cb6f 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -1,6 +1,7 @@ name: Publish Python distribution to TestPyPI # on: push +on: workflow_dispatch jobs: download-wheels: From 516ded20a014eebed77d64b921ce35d25b78089c Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 17:22:40 +0100 Subject: [PATCH 13/27] cicd: wip --- .github/workflows/cibuildwheel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index c0c618f..0e32a56 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -1,7 +1,7 @@ name: Build wheels for multiple platforms -on: - workflow_dispatch: +on: push +# workflow_dispatch: # pull_request: # push: # branches: From 76202da5a2fd9b47607e64468174ec6c63ea3858 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 18:22:15 +0100 Subject: [PATCH 14/27] cicd: new action from GHA guide (build-and-publish.yml) --- .github/workflows/build-and-publish.yml | 78 ++++++++++++++++++++++ .github/workflows/cibuildwheel.yml | 6 +- .github/workflows/publish-to-test-pypi.yml | 6 +- 3 files changed, 84 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build-and-publish.yml diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml new file mode 100644 index 0000000..b5aa962 --- /dev/null +++ b/.github/workflows/build-and-publish.yml @@ -0,0 +1,78 @@ +name: Build wheels+sdist and publish to TestPyPI + +on: + workflow_dispatch: + release: + types: + - published + pull_request: + paths: + - .github/workflows/cd.yml + +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 + + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }} + path: wheelhouse/*.whl + + upload_all: + name: Publish on TestPyPI + needs: [build_wheels, make_sdist] + runs-on: ubuntu-latest + environment: + name: testpypi + url: https://test.pypi.org/p/PythonCDT + permissions: + id-token: write + attestations: write + contents: read + + # if: github.event_name == 'release' && github.event.action == 'published' + 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 TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 0e32a56..4e236c9 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -1,7 +1,7 @@ name: Build wheels for multiple platforms -on: push -# workflow_dispatch: +on: + workflow_dispatch: # pull_request: # push: # branches: @@ -12,7 +12,7 @@ on: push jobs: build_wheels: - name: Build wheels for ${{ matrix.os }} + name: Build wheels for (${{ matrix.os }}, ${{ matrix.arch }}, ${{ matrix. runs-on: ${{ matrix.runs-on }} strategy: matrix: diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index f41cb6f..ef764ae 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -1,7 +1,7 @@ -name: Publish Python distribution to TestPyPI +name: Publish Python artifacts to TestPyPI -# on: push -on: workflow_dispatch +on: + workflow_dispatch: jobs: download-wheels: From b4ce7d295cd302d530fca71c931b56f118ccc908 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 18:27:48 +0100 Subject: [PATCH 15/27] cicd: wip --- .github/workflows/cibuildwheel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 4e236c9..b9186ae 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -1,6 +1,7 @@ name: Build wheels for multiple platforms on: + push: workflow_dispatch: # pull_request: # push: From 174130ab1dd4897dd6bf87ae127d9fc1dfec9f8f Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 18:29:41 +0100 Subject: [PATCH 16/27] cicd: wip --- .github/workflows/cibuildwheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index b9186ae..d835434 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -13,7 +13,7 @@ on: jobs: build_wheels: - name: Build wheels for (${{ matrix.os }}, ${{ matrix.arch }}, ${{ matrix. + name: Build wheels for (${{ matrix.os }}, ${{ matrix.runs-on }} runs-on: ${{ matrix.runs-on }} strategy: matrix: From 766258d4836309e5d4d1965d7b4afe9d26ebe207 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 18:31:36 +0100 Subject: [PATCH 17/27] cicd: rename workflows --- .github/workflows/{build-and-publish.yml => buildpublish.yml} | 0 .../workflows/{publish-to-test-pypi.yml => publish_TestPyPI.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build-and-publish.yml => buildpublish.yml} (100%) rename .github/workflows/{publish-to-test-pypi.yml => publish_TestPyPI.yml} (100%) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/buildpublish.yml similarity index 100% rename from .github/workflows/build-and-publish.yml rename to .github/workflows/buildpublish.yml diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish_TestPyPI.yml similarity index 100% rename from .github/workflows/publish-to-test-pypi.yml rename to .github/workflows/publish_TestPyPI.yml From 1fb7abfb5c4eaf18d3a696fce28de0bec1347356 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 18:36:17 +0100 Subject: [PATCH 18/27] cicd: reduce to single workflow --- .github/workflows/buildpublish.yml | 78 ------------------------------ .github/workflows/cibuildwheel.yml | 70 --------------------------- 2 files changed, 148 deletions(-) delete mode 100644 .github/workflows/buildpublish.yml delete mode 100644 .github/workflows/cibuildwheel.yml diff --git a/.github/workflows/buildpublish.yml b/.github/workflows/buildpublish.yml deleted file mode 100644 index b5aa962..0000000 --- a/.github/workflows/buildpublish.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Build wheels+sdist and publish to TestPyPI - -on: - workflow_dispatch: - release: - types: - - published - pull_request: - paths: - - .github/workflows/cd.yml - -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 - - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: cibw-wheels-${{ matrix.os }} - path: wheelhouse/*.whl - - upload_all: - name: Publish on TestPyPI - needs: [build_wheels, make_sdist] - runs-on: ubuntu-latest - environment: - name: testpypi - url: https://test.pypi.org/p/PythonCDT - permissions: - id-token: write - attestations: write - contents: read - - # if: github.event_name == 'release' && github.event.action == 'published' - 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 TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml deleted file mode 100644 index d835434..0000000 --- a/.github/workflows/cibuildwheel.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: Build wheels for multiple platforms - -on: - push: - workflow_dispatch: -# pull_request: -# push: -# branches: -# - main -# release: -# types: -# - published - -jobs: - build_wheels: - name: Build wheels for (${{ matrix.os }}, ${{ matrix.runs-on }} - runs-on: ${{ matrix.runs-on }} - strategy: - matrix: - # os: [ linux-intel, linux-arm, windows, macOS-intel, macOS-arm ] - os: [ linux-intel, windows ] - include: - - archs: auto - platform: auto - - os: linux-intel - runs-on: ubuntu-latest - - os: linux-arm - runs-on: ubuntu-24.04-arm - - os: windows - runs-on: windows-latest - - os: macos-intel - # macos-13 was the last x86_64 runner - runs-on: macos-13 - - os: macos-arm - # macos-14+ (including latest) are ARM64 runners - runs-on: macos-latest - archs: auto,universal2 - - steps: - - uses: actions/checkout@v4 - - - name: Build wheels - uses: pypa/cibuildwheel@v2.23.2 - env: - CIBW_PLATFORM: ${{ matrix.platform }} - CIBW_ARCHS: ${{ matrix.archs }} - # Can also be configured directly, using `with:` - # with: - # package-dir: . - # output-dir: wheelhouse - # config-file: "{package}/pyproject.toml" - - - uses: actions/upload-artifact@v4 - with: - name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} - path: ./wheelhouse/*.whl - - build_sdist: - name: Build source distribution - 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 From c4bf89a5ce8fe0984eb5235593b9454083828d34 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 18:39:02 +0100 Subject: [PATCH 19/27] cicd: change workflow file --- .github/workflows/buildpublish.yml | 78 ++++++++++++++++++++++++++ .github/workflows/publish_TestPyPI.yml | 60 -------------------- 2 files changed, 78 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/buildpublish.yml delete mode 100644 .github/workflows/publish_TestPyPI.yml diff --git a/.github/workflows/buildpublish.yml b/.github/workflows/buildpublish.yml new file mode 100644 index 0000000..b5aa962 --- /dev/null +++ b/.github/workflows/buildpublish.yml @@ -0,0 +1,78 @@ +name: Build wheels+sdist and publish to TestPyPI + +on: + workflow_dispatch: + release: + types: + - published + pull_request: + paths: + - .github/workflows/cd.yml + +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 + + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }} + path: wheelhouse/*.whl + + upload_all: + name: Publish on TestPyPI + needs: [build_wheels, make_sdist] + runs-on: ubuntu-latest + environment: + name: testpypi + url: https://test.pypi.org/p/PythonCDT + permissions: + id-token: write + attestations: write + contents: read + + # if: github.event_name == 'release' && github.event.action == 'published' + 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 TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/publish_TestPyPI.yml b/.github/workflows/publish_TestPyPI.yml deleted file mode 100644 index ef764ae..0000000 --- a/.github/workflows/publish_TestPyPI.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Publish Python artifacts to TestPyPI - -on: - workflow_dispatch: - -jobs: - download-wheels: - name: Get the pre-built wheels - runs-on: ubuntu-latest - - # this must match the cibuildwheel.yml section - strategy: - matrix: - # os: [ linux-intel, linux-arm, windows, macOS-intel, macOS-arm ] - os: [ linux-intel, windows ] - include: - - archs: auto - platform: auto - - os: linux-intel - runs-on: ubuntu-latest - - os: linux-arm - runs-on: ubuntu-24.04-arm - - os: windows - runs-on: windows-latest - - os: macos-intel - # macos-13 was the last x86_64 runner - runs-on: macos-13 - - os: macos-arm - # macos-14+ (including latest) are ARM64 runners - runs-on: macos-latest - archs: auto,universal2 - - steps: - - name: Download wheels - uses: actions/download-artifact@v4 - with: - name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} - path: wheelhouse/ - - publish-to-testpypi: - name: Publish Python distribution to TestPyPI - runs-on: ubuntu-latest - - environment: - name: testpypi - url: https://test.pypi.org/p/PythonCDT - - permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing - - steps: - - name: Download source distribution - uses: actions/download-artifact@v4 - with: - name: cibw-sdist - path: wheelhouse/ - - name: Publish all the dists - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ From 487736955dac4a9f5adfcfcdfe912c42c05f8b1e Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 18:44:55 +0100 Subject: [PATCH 20/27] cicd: reformat workflow --- .github/workflows/buildpublish.yml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/buildpublish.yml b/.github/workflows/buildpublish.yml index b5aa962..adb76ea 100644 --- a/.github/workflows/buildpublish.yml +++ b/.github/workflows/buildpublish.yml @@ -1,13 +1,14 @@ -name: Build wheels+sdist and publish to TestPyPI +name: Build wheels/sdist and publish to TestPyPI on: + push: workflow_dispatch: release: types: - published pull_request: paths: - - .github/workflows/cd.yml + - ".github/workflows/cd.yml" jobs: make_sdist: @@ -15,15 +16,12 @@ jobs: 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 }} @@ -31,21 +29,17 @@ jobs: 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 - - name: Upload wheels uses: actions/upload-artifact@v4 with: name: cibw-wheels-${{ matrix.os }} path: wheelhouse/*.whl - upload_all: name: Publish on TestPyPI needs: [build_wheels, make_sdist] @@ -57,8 +51,6 @@ jobs: id-token: write attestations: write contents: read - - # if: github.event_name == 'release' && github.event.action == 'published' steps: - name: Download artifacts uses: actions/download-artifact@v4 @@ -66,13 +58,11 @@ jobs: 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 TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - repository-url: https://test.pypi.org/legacy/ + repository-url: "https://test.pypi.org/legacy/" From e73b109104da09fa871642b858ccd727704f45f5 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 18:55:03 +0100 Subject: [PATCH 21/27] cicd: limit python versions cp310-* --- .github/workflows/buildpublish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/buildpublish.yml b/.github/workflows/buildpublish.yml index adb76ea..646a5fa 100644 --- a/.github/workflows/buildpublish.yml +++ b/.github/workflows/buildpublish.yml @@ -35,6 +35,8 @@ jobs: fetch-depth: 0 submodules: true - uses: pypa/cibuildwheel@v2.23 + env: + CIBW_BUILD: "cp310-*" - name: Upload wheels uses: actions/upload-artifact@v4 with: From 9c89f38a4e1a2648591a621f9cfdb6080a0bf3f4 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 19:25:14 +0100 Subject: [PATCH 22/27] cicd: adjust python version for 3.10+ and reduce number of builds while testing --- .github/workflows/buildpublish.yml | 7 +++++-- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/buildpublish.yml b/.github/workflows/buildpublish.yml index 646a5fa..d8040bf 100644 --- a/.github/workflows/buildpublish.yml +++ b/.github/workflows/buildpublish.yml @@ -28,7 +28,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-13, macos-14] + # os: [ubuntu-latest, windows-latest, macos-13, macos-14] + os: [ubuntu-latest] steps: - uses: actions/checkout@v4 with: @@ -36,7 +37,9 @@ jobs: submodules: true - uses: pypa/cibuildwheel@v2.23 env: - CIBW_BUILD: "cp310-*" + CIBW_ARCHS: auto64 + CIBW_SKIP: *musllinux* + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_34 - name: Upload wheels uses: actions/upload-artifact@v4 with: diff --git a/pyproject.toml b/pyproject.toml index 0f2e980..e6328b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ version = "0.0.1" authors = [{name = "Leica Geosystems"}] description = "Constrained Delaunay Triangulation" readme = {file = "README.md", content-type = "text/markdown"} -requires-python=">=3.6" +requires-python=">=3.10" [project.license] text = "MPL-2.0" From 85b6eaa9e0468e6612e7687947e95b42b891a8f6 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 19:29:46 +0100 Subject: [PATCH 23/27] cicd: quote string --- .github/workflows/buildpublish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildpublish.yml b/.github/workflows/buildpublish.yml index d8040bf..1f30324 100644 --- a/.github/workflows/buildpublish.yml +++ b/.github/workflows/buildpublish.yml @@ -38,7 +38,7 @@ jobs: - uses: pypa/cibuildwheel@v2.23 env: CIBW_ARCHS: auto64 - CIBW_SKIP: *musllinux* + CIBW_SKIP: "*musllinux*" CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_34 - name: Upload wheels uses: actions/upload-artifact@v4 From 8f977a8322905acd318025d6317011ee6dc3bc77 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 19:33:28 +0100 Subject: [PATCH 24/27] cicd: add full URL to manylinux image --- .github/workflows/buildpublish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildpublish.yml b/.github/workflows/buildpublish.yml index 1f30324..3d8490c 100644 --- a/.github/workflows/buildpublish.yml +++ b/.github/workflows/buildpublish.yml @@ -38,8 +38,8 @@ jobs: - uses: pypa/cibuildwheel@v2.23 env: CIBW_ARCHS: auto64 - CIBW_SKIP: "*musllinux*" - CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_34 + CIBW_SKIP: "*musllinux* pp*" + CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_34 - name: Upload wheels uses: actions/upload-artifact@v4 with: From 8617e477b641caaf5053d5b1045c6a462309696a Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 27 Mar 2025 19:42:29 +0100 Subject: [PATCH 25/27] cicd: enable more platforms --- .github/workflows/buildpublish.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/buildpublish.yml b/.github/workflows/buildpublish.yml index 3d8490c..1676e99 100644 --- a/.github/workflows/buildpublish.yml +++ b/.github/workflows/buildpublish.yml @@ -28,8 +28,7 @@ jobs: strategy: fail-fast: false matrix: - # os: [ubuntu-latest, windows-latest, macos-13, macos-14] - os: [ubuntu-latest] + os: [ubuntu-latest, windows-latest, macos-13, macos-14] steps: - uses: actions/checkout@v4 with: From 66b9975f769f037f742e9ad57bc3cbeb2fad0242 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Fri, 28 Mar 2025 10:29:06 +0100 Subject: [PATCH 26/27] cicd: point Github action to PyPI (buildpublish.yml) --- .github/workflows/buildpublish.yml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/buildpublish.yml b/.github/workflows/buildpublish.yml index 1676e99..c193a21 100644 --- a/.github/workflows/buildpublish.yml +++ b/.github/workflows/buildpublish.yml @@ -1,14 +1,10 @@ -name: Build wheels/sdist and publish to TestPyPI +name: Build wheels/sdist and publish to PyPI on: push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' workflow_dispatch: - release: - types: - - published - pull_request: - paths: - - ".github/workflows/cd.yml" jobs: make_sdist: @@ -44,13 +40,11 @@ jobs: with: name: cibw-wheels-${{ matrix.os }} path: wheelhouse/*.whl - upload_all: - name: Publish on TestPyPI + publish_all: + name: Publish on PyPI needs: [build_wheels, make_sdist] runs-on: ubuntu-latest - environment: - name: testpypi - url: https://test.pypi.org/p/PythonCDT + environment: pypi permissions: id-token: write attestations: write @@ -66,7 +60,5 @@ jobs: uses: actions/attest-build-provenance@v2.2.3 with: subject-path: "dist/*" - - name: Upload to TestPyPI + - name: Upload to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: "https://test.pypi.org/legacy/" From 9889700299ac3cfb8848ab2e539018bb90a19372 Mon Sep 17 00:00:00 2001 From: Mauricio Souza de Alencar <856825+mdealencar@users.noreply.github.com> Date: Thu, 3 Apr 2025 08:57:30 +0200 Subject: [PATCH 27/27] deps: bump commit of CDT library (fixes CMake version < 3.5 error) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3e497e..87c9e01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ include(FetchContent) FetchContent_Declare( CDT GIT_REPOSITORY https://github.com/artem-ogre/CDT.git - GIT_TAG e5fe660c4c94b16493ef3f06abae01e53e0dd81f + GIT_TAG 4b4181713c73cf0a49a5b88fb3df4acca7436235 SOURCE_SUBDIR CDT ) FetchContent_MakeAvailable(CDT)