Replies: 4 comments 9 replies
-
I really like this idea! I had a similar idea in #516 (reply in thread), but it didn't go anywhere because it involved a total overhaul of how the options were parsed. This would fit really neatly inside the existing options structure. A couple points on the above snippet-
The other interesting thing to talk about is implementation, because we'd have to delay evaluation of the build options until each build. That's probably fine, but presents an interesting challenge when we print the options at the start of a cibuildwheel session! Maybe there's something we can do like-
|
Beta Was this translation helpful? Give feedback.
-
Actually, NumPy has bumped 3.10 up to manylinux2014, making this even nicer to have. The default manylinux 2010 build is not able to download NumPy wheels on Python 3.10. |
Beta Was this translation helpful? Give feedback.
-
A few thoughts as I've been working on the implementation. First, So this is valid: [tool.cibuildwheel]
before-all = "yum install somelib"
[[tool.cibuildwheel.overrides]]
select = "cp310-*"
manylinux-x86_64-image = "manylinux_2_24"
before-all = "apt-get install somelib" and this is an error: [tool.cibuildwheel]
before-all = "yum install somelib"
[[tool.cibuildwheel.overrides]]
select = "cp310-*"
before-all = "apt-get install somelib" We could expand this later if needed to add new docker launches if before-all changes (but this already is also how Windows and macOS would behave - there are no containers there, so they support only one before-all). |
Beta Was this translation helpful? Give feedback.
-
Is environment variable parsing supported using the TOML overrides? There's something weird going on when I try to export a host variable, e.g., [[tool.cibuildwheel.overrides]]
select = "*-manylinux_x86_64"
[tool.cibuildwheel.overrides.environment]
MY_VAR = "$MY_VAR" But it doesn't seem to be exported properly. Also, has it ever been discussed how to have a method to extend the set of environment variables? I wish the environment variables were a list of tables so I could easily append environment variables. With the current API I have copies of five or six environment variables for each override. |
Beta Was this translation helpful? Give feedback.
-
I've really been enjoying the design of MyPy's 0.9xx TOML interface. I think the same idea could be applied to cibuildwheel, possibly. Here's my idea of what it would look like:
Each
overrides
item overrides the matchingbuild
selected by the expression (analogous totool.mypy.overrides
andmodule
).build
could be called something else to differentiate it, or or could bebuild
for similarity. Overrides are applied to every build selector they match sequentially.This would be really useful in reducing one of the two remaining reasons to use environment variables, and would simply both CI and local builds. The fact that CPython 3.10 can't build with manylinux1 makes this especially useful now (and, really, there's little point in building manylinux1 CPython 3.9 wheels either, even NumPy bumped those up to manylinux2010).
The other remaining reason for environment variables is to build two different wheels from a single identifier (like manylinux1 and manylinux2010), which this would not solve. I think this is special enough that it does not need to be addressed here.
Beta Was this translation helpful? Give feedback.
All reactions