From c3eccaeec52b4d6d9c3ab305db1d43205d6fd5d1 Mon Sep 17 00:00:00 2001 From: JalinWang Date: Fri, 3 Apr 2026 11:06:07 +0800 Subject: [PATCH] python -m setuptools_scm --- .github/workflows/build_wheel_on_windows.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_wheel_on_windows.yml b/.github/workflows/build_wheel_on_windows.yml index 6ccc8c4..135b59a 100644 --- a/.github/workflows/build_wheel_on_windows.yml +++ b/.github/workflows/build_wheel_on_windows.yml @@ -105,14 +105,15 @@ jobs: - name: Build wheels using cibuildwheel if: steps.cache-wheels.outputs.cache-hit != 'true' shell: powershell - env: - # If this workflow is triggered by a tag, then just use it - SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '' }} -# CIBW_BUILD_VERBOSITY: 1 -# CIBW_DEBUG_TRACEBACK: 1 -# CIBW_DEBUG_KEEP_CONTAINER: 1 run: | - python -m setuptools_scm + # 1. Generate and capture the version from setuptools_scm + $SCM_VERSION = python -m setuptools_scm + echo "Detected Version: $SCM_VERSION" + + # 2. Set it as an environment variable for the current shell and subsequent steps + $env:SETUPTOOLS_SCM_PRETEND_VERSION = $SCM_VERSION + + # 3. Run cibuildwheel python -m cibuildwheel --output-dir wheelhouse - name: Install and test wheel