-
Notifications
You must be signed in to change notification settings - Fork 258
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
feat: stricter selector parsing, refactor to platforms
module
#2291
base: main
Are you sure you want to change the base?
Conversation
88ac468
to
fe78ba6
Compare
- Use a different method to build nothing - Make the check aware of enable groups
Unit test time: 26.2s -> 13.1s
f7c0412
to
6942c47
Compare
This change made the unit tests quite a bit slower (26s), so I broke out the profiler. In doing so I spotted a few places things could be sped up. I'll split out the unrelated changes to a separate PR. |
Do you know why this change made it slower, though? |
Yeah, it was these lines, it ended up doing a lot of TOML loading and running of the BuildSelector. |
6942c47
to
7b94bcd
Compare
I've kept only the optimisation relevant to this change, the rest are in #2293. |
def get_platform_module(platform: PlatformName) -> PlatformModule: | ||
if platform == "linux": | ||
return linux | ||
if platform == "windows": | ||
return windows | ||
if platform == "macos": | ||
return macos | ||
if platform == "pyodide": | ||
return pyodide | ||
assert_never(platform) |
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 function is probably not needed anymore given it's just a look-up in the ALL_PLATFORM_MODULES dict now ?
Can be rebased now. |
Implementation of an idea from #2070 (comment)
cibuildwheel will error out if the
build
config contains something that it doesn't recognise. Forskip
andtest-skip
, it just prints a warning.This is to highlight misconfiguration as seen in #2070. Notably, the set of identifiers that cibuildwheel will consider is not dependent on platform, so users can still do a global CIBW_BUILD that's shared across platforms.
Also in this PR, I wanted to iterate through platform modules, and so decided it was time to factor them out into their own package.
I'll keep this draft to merge #2286 first, since that adds a new platform.