Merged
Conversation
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Contributor
|
Do you mind if we punt this to after v3.0? Big diffs like this seem like unecessary risk when tapering to a release. |
Contributor
Author
|
Sure, I even almost added the tag when I opened it. |
henryiii
commented
May 30, 2025
joerick
approved these changes
Jun 13, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR converts several conditional chains to Python's pattern matching syntax to streamline the code.
- Refactored AST checking in projectfiles.py
- Replaced if/elif chains with match-case in platforms modules (windows, macos, linux, ios) and oci_container.py
- Applied pattern matching for merging rules and settings conversion in options.py
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cibuildwheel/projectfiles.py | Converted AST conditionals to a match-case construct for evaluating if a node is the main check. |
| cibuildwheel/platforms/windows.py | Replaced string comparisons with match-case on build frontend values. |
| cibuildwheel/platforms/macos.py | Updated build and setup routines to use pattern matching consistently. |
| cibuildwheel/platforms/linux.py | Simplified build_in_container logic with match-case on build frontend names. |
| cibuildwheel/platforms/ios.py | Enhanced build and setup logic by using pattern matching for cleaner control flow. |
| cibuildwheel/options.py | Switched to match-case for merging options and stringifying settings, although a potential issue exists. |
| cibuildwheel/oci_container.py | Replaced if-elif comparisons with a match-case structure for engine version validation. |
Contributor
|
yeah, let's get this in now. I'll let you hit the button henryiii, just in case there's something else you wanted to address here. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adding some pattern matching where I think it makes sense to do so.