-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Build Windows wheels using cibuildwheel #7580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4f939a1
use cibuildwheel on windows
nulano bf51d71
enable heap verification
nulano 3d49244
specify build config settings in pyproject.toml
nulano 1fdb066
test cibuildwheel wheels in Docker on Windows
nulano 7dc3a8f
do not build Windows wheels on every push
nulano d88ab8a
use verbose flag when building wheels
nulano 6fe42bd
Apply suggestions from code review
nulano e105976
replace importlib.util.find_spec with try import except ImportError
nulano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| param ([string]$venv, [string]$pillow="C:\pillow") | ||
| $ErrorActionPreference = 'Stop' | ||
| $ProgressPreference = 'SilentlyContinue' | ||
| Set-PSDebug -Trace 1 | ||
| if ("$venv" -like "*\cibw-run-*\pp*-win_amd64\*") { | ||
| # unlike CPython, PyPy requires Visual C++ Redistributable to be installed | ||
| [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | ||
| Invoke-WebRequest -Uri 'https://aka.ms/vs/15/release/vc_redist.x64.exe' -OutFile 'vc_redist.x64.exe' | ||
| C:\vc_redist.x64.exe /install /quiet /norestart | Out-Null | ||
| } | ||
| $env:path += ";$pillow\winbuild\build\bin\" | ||
| & "$venv\Scripts\activate.ps1" | ||
| & reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\python.exe" /v "GlobalFlag" /t REG_SZ /d "0x02000000" /f | ||
| cd $pillow | ||
| & python -VV | ||
| if (!$?) { exit $LASTEXITCODE } | ||
| & python selftest.py | ||
| if (!$?) { exit $LASTEXITCODE } | ||
| & python -m pytest -vx Tests\check_wheel.py | ||
| if (!$?) { exit $LASTEXITCODE } | ||
| & python -m pytest -vx Tests | ||
| if (!$?) { exit $LASTEXITCODE } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import sys | ||
|
|
||
| from PIL import features | ||
|
|
||
|
|
||
| def test_wheel_modules(): | ||
| expected_modules = {"pil", "tkinter", "freetype2", "littlecms2", "webp"} | ||
|
|
||
| # tkinter is not available in cibuildwheel installed CPython on Windows | ||
| try: | ||
| import tkinter | ||
|
|
||
| assert tkinter | ||
| except ImportError: | ||
| expected_modules.remove("tkinter") | ||
|
|
||
| assert set(features.get_supported_modules()) == expected_modules | ||
|
|
||
|
|
||
| def test_wheel_codecs(): | ||
| expected_codecs = {"jpg", "jpg_2000", "zlib", "libtiff"} | ||
|
|
||
| assert set(features.get_supported_codecs()) == expected_codecs | ||
|
|
||
|
|
||
| def test_wheel_features(): | ||
| expected_features = { | ||
| "webp_anim", | ||
| "webp_mux", | ||
| "transp_webp", | ||
| "raqm", | ||
| "fribidi", | ||
| "harfbuzz", | ||
| "libjpeg_turbo", | ||
| "xcb", | ||
| } | ||
|
|
||
| if sys.platform == "win32": | ||
| expected_features.remove("xcb") | ||
|
|
||
| assert set(features.get_supported_features()) == expected_features |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, this was only run for one Python version.
Pillow/.github/workflows/test-windows.yml
Lines 246 to 248 in 63bec07
Any particular reason it's now being run for every version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now in the
wheels.ymlworkflow which only runs a single job for all Python versions of a single architecture.Previously it was in
test-windows.ymlwhich has a separate job for each Python version.