From 2cb1a146fb08edd699542879a9907e2d8331a25d Mon Sep 17 00:00:00 2001 From: Jalin Wang Date: Thu, 2 Apr 2026 22:26:00 +0800 Subject: [PATCH] fix(ci): fix wheel version detection & windows wheel ci (#303) --- .github/workflows/_build_wheel_job.yml | 4 +++- .github/workflows/build_wheel_on_windows.yml | 14 ++++++++++++-- pyproject.toml | 6 ++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/_build_wheel_job.yml b/.github/workflows/_build_wheel_job.yml index 34b46b7..7de332c 100644 --- a/.github/workflows/_build_wheel_job.yml +++ b/.github/workflows/_build_wheel_job.yml @@ -28,7 +28,9 @@ jobs: uses: actions/checkout@v6 with: submodules: recursive - + fetch-tags: true + fetch-depth: 0 + - name: Set up Python (for cibuildwheel controller) uses: actions/setup-python@v6 with: diff --git a/.github/workflows/build_wheel_on_windows.yml b/.github/workflows/build_wheel_on_windows.yml index 3cbaf31..64978bb 100644 --- a/.github/workflows/build_wheel_on_windows.yml +++ b/.github/workflows/build_wheel_on_windows.yml @@ -1,8 +1,6 @@ name: Build and Test PyPi Wheels on Windows on: - push: - branches: [ "main" ] workflow_call: inputs: publish_target: @@ -71,6 +69,8 @@ jobs: uses: actions/checkout@v6 with: submodules: recursive + fetch-tags: true + fetch-depth: 0 - name: Cleanup left marker files run: | @@ -81,6 +81,11 @@ jobs: with: python-version: '3.11' + - name: Set up MSVC environment + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 + - name: Install cibuildwheel run: | pip install --upgrade pip @@ -100,6 +105,11 @@ jobs: - name: Build wheels using cibuildwheel if: steps.cache-wheels.outputs.cache-hit != 'true' shell: powershell +# env: +# CIBW_BUILD_VERBOSITY: 1 +# CIBW_DEBUG_TRACEBACK: 1 +# CIBW_DEBUG_KEEP_CONTAINER: 1 + run: | python -m cibuildwheel --output-dir wheelhouse diff --git a/pyproject.toml b/pyproject.toml index 5d167ef..c45b39e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -130,7 +130,7 @@ BUILD_PYTHON_BINDINGS = "ON" [tool.setuptools_scm] local_scheme = "no-local-version" version_scheme = "guess-next-dev" -fallback_version = "0.2.1b1" +fallback_version = "0.0.0" ###################################################################################################### # TESTING & QUALITY ###################################################################################################### @@ -189,7 +189,9 @@ environment = { CMAKE_GENERATOR = "Unix Makefiles", CMAKE_BUILD_PARALLEL_LEVEL = [tool.cibuildwheel.windows] archs = ["auto64"] -test-command = "cd /d {project} && pytest python/tests -v --tb=short --basetemp=./.pytest_tmp" +test-command = "cd /d {project} && pytest python/tests -v --tb=short --basetemp=./.pytest_tmp && if exist .pytest_tmp rmdir /s /q .pytest_tmp" +environment = { CMAKE_GENERATOR = "Ninja" } +config-settings = { build-dir = "build/{wheel_tag}" } ###################################################################################################### # CODE QUALITY & FORMATTING (Ruff)