6565 & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -all -products * -prerelease -format json
6666 shell : powershell
6767
68+ - name : Enable git long paths
69+ shell : powershell
70+ run : git config --global core.longpaths true
71+
6872 - name : Checkout code
6973 uses : actions/checkout@v6
7074 with :
@@ -86,31 +90,33 @@ jobs:
8690 with :
8791 arch : x64
8892
89- - name : Install cibuildwheel
90- run : |
91- pip install --upgrade pip
92- pip install cibuildwheel==3.4.0
93-
9493 - name : Add Git bin to PATH
9594 run : echo "C:\Program Files\Git\usr\bin" >> $env:GITHUB_PATH
9695 shell : powershell
9796
98- - name : Cache built wheels
99- id : cache-wheels
100- uses : actions/cache@v4
101- with :
102- path : wheelhouse
103- key : ${{ runner.os }}-wheels-${{ hashFiles('**/pyproject.toml', '**/setup.py', '**/*.py', '**/*.c', '**/*.cpp') }}
97+ # - name: Cache built wheels
98+ # id: cache-wheels
99+ # uses: actions/cache@v4
100+ # with:
101+ # path: wheelhouse
102+ # key: ${{ runner.os }}-wheels-${{ hashFiles('**/pyproject.toml', '**/setup.py', '**/*.py', '**/*.c', '**/*.cpp') }}
104103
105104 - name : Build wheels using cibuildwheel
106- if : steps.cache-wheels.outputs.cache-hit != 'true'
105+ # if: steps.cache-wheels.outputs.cache-hit != 'true'
107106 shell : powershell
108- # env:
109- # CIBW_BUILD_VERBOSITY: 1
110- # CIBW_DEBUG_TRACEBACK: 1
111- # CIBW_DEBUG_KEEP_CONTAINER: 1
112-
113107 run : |
108+ # 1. Generate and capture the version from setuptools_scm
109+ pip install --upgrade pip
110+ pip install cibuildwheel==3.4.0
111+ pip install setuptools-scm>=8.0
112+
113+ $SCM_VERSION = python -m setuptools_scm
114+ echo "Detected Version: $SCM_VERSION"
115+
116+ # 2. Set it as an environment variable for the current shell and subsequent steps
117+ $env:SETUPTOOLS_SCM_PRETEND_VERSION = $SCM_VERSION
118+
119+ # 3. Run cibuildwheel
114120 python -m cibuildwheel --output-dir wheelhouse
115121
116122 - name : Install and test wheel
@@ -190,6 +196,11 @@ jobs:
190196 runs-on : ${{ matrix.platform }}
191197
192198 steps :
199+ - name : Set up Python
200+ uses : actions/setup-python@v6
201+ with :
202+ python-version : ${{ matrix.python-version }}
203+
193204 - name : Smoke test from PyPI
194205 shell : powershell
195206 env :
@@ -217,7 +228,7 @@ jobs:
217228 $PSNativeCommandUseErrorActionPreference = $false
218229 $found = $false
219230 for ($i = 1; $i -le 30; $i++) {
220- python -m pip install --force-reinstall @indexArgs --dry-run "zvec==$version" 1>$null 2>$null
231+ python -m pip install --force-reinstall @indexArgs --dry-run "zvec==$version"
221232 if ($LASTEXITCODE -eq 0) {
222233 Write-Host "Version $version is available."
223234 $found = $true
0 commit comments