From 7a6510e8b2172d508c6f45014c453bb912368761 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 16:02:55 +0800 Subject: [PATCH 01/15] Rename python project name. --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a520081..e02ee65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ requires = [ build-backend = "scikit_build_core.build" [project] -name = "pyds" +name = "apyds" dynamic = ["version"] dependencies = [] requires-python = ">=3.10, <3.14" @@ -22,6 +22,7 @@ version_scheme = "no-guess-dev" fallback_version = "0.0.0" [tool.scikit-build] +wheel.packages = ["pyds"] metadata.version.provider = "scikit_build_core.metadata.setuptools_scm" build.verbose = true From 23668b56ae51969d6177723ef36eceee65da491a Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 16:20:33 +0800 Subject: [PATCH 02/15] Add cibuildwheel in github action. --- .github/workflows/pytest.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 629b5ea..04b5166 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -26,3 +26,23 @@ jobs: - name: pytest run: pytest --cov=pyds + + pypi: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - uses: actions/checkout@v6 + + - name: install cibuildwheel + run: python -m pip install cibuildwheel==3.3.0 + + - name: build wheels + run: python -m cibuildwheel + + - uses: actions/upload-artifact@v5 + with: + path: ./wheelhouse/*.whl From 8f6f625cd6c5d587598367628691dbd63c1075c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hao=20Zhang=28=E5=BC=A0=E6=B5=A9=29?= Date: Mon, 24 Nov 2025 16:25:51 +0800 Subject: [PATCH 03/15] Potential fix for code scanning alert no. 11: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .github/workflows/pytest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 04b5166..b8ff515 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -1,4 +1,6 @@ name: pytest +permissions: + contents: read on: - pull_request From e99365af54dcfc30e174ba33f5c0e924eb968c12 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 16:26:48 +0800 Subject: [PATCH 04/15] Remove the version specification for cibuildwheel. --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index b8ff515..8c64f63 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -40,7 +40,7 @@ jobs: - uses: actions/checkout@v6 - name: install cibuildwheel - run: python -m pip install cibuildwheel==3.3.0 + run: python -m pip install cibuildwheel - name: build wheels run: python -m cibuildwheel From 2acee849fae5f2526b7e503a520a223116f25ea1 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 16:30:52 +0800 Subject: [PATCH 05/15] Add python setup and dependencies for wheel build. --- .github/workflows/pytest.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 8c64f63..dc5fd3f 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -31,6 +31,7 @@ jobs: pypi: runs-on: ${{ matrix.os }} + needs: pytest strategy: matrix: @@ -39,6 +40,10 @@ jobs: steps: - uses: actions/checkout@v6 + - uses: actions/setup-python@v4 + with: + python-version: '3.13' + - name: install cibuildwheel run: python -m pip install cibuildwheel From c0aca112a6d1460226b414246d0691dc68ab7612 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 16:36:20 +0800 Subject: [PATCH 06/15] Disable fail fast. --- .github/workflows/pytest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index dc5fd3f..ee9b2e1 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -34,6 +34,7 @@ jobs: needs: pytest strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] From 29fdfea97a4c9388a561108dbcf0ae69dd3691fa Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 16:36:30 +0800 Subject: [PATCH 07/15] Update the C++ version to C++20. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ed7bda..2febaa2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc") add_library(${PROJECT_NAME} STATIC ${SOURCES}) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) set_property(TARGET ${PROJECT_NAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION True) file(GLOB EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/examples/*.cc") From 0e24329c8f53821693860181148acfe6eb2494ba Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 16:42:17 +0800 Subject: [PATCH 08/15] Add upload job in pytest action. --- .github/workflows/pytest.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index ee9b2e1..bb41ccb 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -29,7 +29,7 @@ jobs: - name: pytest run: pytest --cov=pyds - pypi: + wheels: runs-on: ${{ matrix.os }} needs: pytest @@ -54,3 +54,21 @@ jobs: - uses: actions/upload-artifact@v5 with: path: ./wheelhouse/*.whl + + upload: + runs-on: ubuntu-latest + needs: wheels + if: "github.event_name == 'push' && (startsWith(github.ref, 'refs/tags')" + + environment: pypi + + steps: + - uses: actions/download-artifact@v3 + + - uses: actions/setup-python@v4 + with: + python-version: '3.13' + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: artifact From 0ac1b0d22a0615136af75977f3fa17b98829a5cc Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 16:48:48 +0800 Subject: [PATCH 09/15] Use different artifact name across different matrix.os. --- .github/workflows/pytest.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index bb41ccb..bff5976 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -46,14 +46,15 @@ jobs: python-version: '3.13' - name: install cibuildwheel - run: python -m pip install cibuildwheel + run: pip install cibuildwheel - name: build wheels run: python -m cibuildwheel - uses: actions/upload-artifact@v5 with: - path: ./wheelhouse/*.whl + name: wheels-${{ matrix.os }} + path: wheelhouse/*.whl upload: runs-on: ubuntu-latest @@ -64,11 +65,10 @@ jobs: steps: - uses: actions/download-artifact@v3 - - - uses: actions/setup-python@v4 with: - python-version: '3.13' + pattern: wheels-* + path: dist - uses: pypa/gh-action-pypi-publish@release/v1 with: - packages-dir: artifact + packages-dir: dist From 51a519279fea48c094cb2d64ff02e5b0df110d54 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 16:50:59 +0800 Subject: [PATCH 10/15] Use ninja in windows. --- .github/workflows/pytest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index bff5976..2032efa 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -50,6 +50,8 @@ jobs: - name: build wheels run: python -m cibuildwheel + env: + CIBW_ENVIRONMENT_WINDOWS: SKBUILD_CMAKE_ARGS=-GNinja - uses: actions/upload-artifact@v5 with: From a3e9804274ec722b7f0de0617c983003ecfa1947 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 16:54:13 +0800 Subject: [PATCH 11/15] Fix typo. --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 2032efa..a59b746 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -61,7 +61,7 @@ jobs: upload: runs-on: ubuntu-latest needs: wheels - if: "github.event_name == 'push' && (startsWith(github.ref, 'refs/tags')" + if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags')" environment: pypi From 0ed0115fed171c994b266cc093e225e4240c9ac1 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 16:59:11 +0800 Subject: [PATCH 12/15] Skip to build wheel unless for tag push. --- .github/workflows/pytest.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index a59b746..5b019a0 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -33,6 +33,8 @@ jobs: runs-on: ${{ matrix.os }} needs: pytest + if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags')" + strategy: fail-fast: false matrix: @@ -61,7 +63,6 @@ jobs: upload: runs-on: ubuntu-latest needs: wheels - if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags')" environment: pypi From 261dc56b0865f9ad642c9a23ded1f0adb9ab1ce4 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 17:02:14 +0800 Subject: [PATCH 13/15] Skip windows platform. --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 5b019a0..1562e3b 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -38,7 +38,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@v6 From 8fa58d764a103790f65239cd7a9e6c61ef4472de Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 17:02:54 +0800 Subject: [PATCH 14/15] Revert "Update the C++ version to C++20." This reverts commit 29fdfea97a4c9388a561108dbcf0ae69dd3691fa. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2febaa2..4ed7bda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc") add_library(${PROJECT_NAME} STATIC ${SOURCES}) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) set_property(TARGET ${PROJECT_NAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION True) file(GLOB EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/examples/*.cc") From 20df6f5b2866d25a50da1afa23878075016b1661 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 17:07:23 +0800 Subject: [PATCH 15/15] Recovery tags. --- .github/workflows/pytest.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 1562e3b..c0b5082 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -43,6 +43,9 @@ jobs: steps: - uses: actions/checkout@v6 + - name: recovery tag information + run: git fetch --tags --force + - uses: actions/setup-python@v4 with: python-version: '3.13'