python -m setuptools_scm

This commit is contained in:
JalinWang
2026-04-03 11:06:07 +08:00
parent da0d97f9a1
commit c3eccaeec5
+8 -7
View File
@@ -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