diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 3ee611c..4f8df56 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -44,6 +44,22 @@ jobs: run: | python -m pip install cibuildwheel + - name: Set VSDev RC (windows only) + if: ${{ matrix.buildplat[1] }} == 'win' + run: | + function Invoke-VSDevEnvironment { + $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + $installationPath = & $vswhere -prerelease -legacy -latest -property installationPath + $Command = Join-Path $installationPath "Common7\Tools\vsdevcmd.bat" + & "${env:COMSPEC}" /s /c "`"$Command`" -arch=amd64 -no_logo && set" | Foreach-Object { + if ($_ -match '^([^=]+)=(.*)') { + [System.Environment]::SetEnvironmentVariable($matches[1], $matches[2]) + } + } + } + Invoke-VSDevEnvironment + Get-Command rc.exe | Format-Table -AutoSize + - name: Build wheels uses: pypa/cibuildwheel@v2.15.0 env: diff --git a/pyproject.toml b/pyproject.toml index c44efab..e51638c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ setup = ['--default-library=static'] [tool.cibuildwheel] test-requires = ["pytest", "pytest-cov", "pytest-benchmark"] # coverage-badge test-command = ["coverage run --source={package} -m pytest {package}/tests", "coverage report -m"] -build-verbosity = 2 +build-verbosity = 1 skip = "cp36-* cp37-* pp* *_ppc64le *_i686 *_s390x" [tool.cibuildwheel.macos] @@ -47,4 +47,5 @@ environment = { PKG_CONFIG_PATH="C:/opt/64/lib/pkgconfig", CXX="g++", CC="gcc" } repair-wheel-command = "bash ./tools/wheels/repair_windows.sh {wheel} {dest_dir}" [tool.cibuildwheel.linux] -environment = { CC="clang", CXX="clang++" } \ No newline at end of file +before-build = "bash {project}/tools/cibw_linux.sh" +environment = { CC="clang", CXX="clang" } \ No newline at end of file diff --git a/tools/cibw_windows.sh b/tools/cibw_windows.sh index 9660c3a..4e3ba85 100644 --- a/tools/cibw_windows.sh +++ b/tools/cibw_windows.sh @@ -5,18 +5,18 @@ # https://github.com/actions/virtual-environments/issues/294#issuecomment-588090582 # with additional -arch=x86 flag to vsdevcmd.bat # https://github.com/actions/runner-images/issues/294 -function Invoke-VSDevEnvironment { - $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" - $installationPath = & $vswhere -prerelease -legacy -latest -property installationPath - $Command = Join-Path $installationPath "Common7\Tools\vsdevcmd.bat" - & "${env:COMSPEC}" /s /c "`"$Command`" -arch=amd64 -no_logo && set" | Foreach-Object { - if ($_ -match '^([^=]+)=(.*)') { - [System.Environment]::SetEnvironmentVariable($matches[1], $matches[2]) - } - } -} -Invoke-VSDevEnvironment -Get-Command rc.exe | Format-Table -AutoSize +# function Invoke-VSDevEnvironment { +# $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" +# $installationPath = & $vswhere -prerelease -legacy -latest -property installationPath +# $Command = Join-Path $installationPath "Common7\Tools\vsdevcmd.bat" +# & "${env:COMSPEC}" /s /c "`"$Command`" -arch=amd64 -no_logo && set" | Foreach-Object { +# if ($_ -match '^([^=]+)=(.*)') { +# [System.Environment]::SetEnvironmentVariable($matches[1], $matches[2]) +# } +# } +# } +# Invoke-VSDevEnvironment +# Get-Command rc.exe | Format-Table -AutoSize choco install rtools -y --no-progress --force --version=4.0.0.20220206" set PATH=C:\rtools40\ucrt64\bin\;%PATH% \ No newline at end of file