cibuildwheel icon indicating copy to clipboard operation
cibuildwheel copied to clipboard

pip supports arrays in config-settings - update our docs/behaviour?

Open joerick opened this issue 2 years ago • 4 comments

Not needed for this PR, but this is not true anymore, pip supports arrays, as long as we don't stop it in cibuildwheel (which I don't think we do), it should just work.

Originally posted by @henryiii in https://github.com/pypa/cibuildwheel/pull/1511#discussion_r1214763910

cant remember if we special-cased translation to the command line, but we should probably check that arrays are passed through regardless.

joerick avatar Jun 06 '23 09:06 joerick

There's also a number of differences with build that might be worth noting..

webknjaz avatar Jun 14 '23 10:06 webknjaz

I think this just works. We assumed pip and build are the same (even to the point of being incorrect about the name of the option, which we fixed later). But yes, should be checked a little more carefully then fixed in the docs.

And what differences would you note?

henryiii avatar Jun 14 '23 12:06 henryiii

And what differences would you note?

Yesterday, I discovered that a flag/option I've been implementing in the past has to be declared differently for pip wheel. Basically, with build, I'd do python -m build --config-setting=--with-c-extensions and the in-tree backend would check that as '--with-c-extensions' in config_settings. I don't care about the value, just the presence. Pip errors out with --config-setting=--with-c-extensions but allows an empty string value like this: python -m pip wheel . --config-setting=--with-c-extensions=.

FWIW I'd rather make sure that both projects have the same argument validation/transformation logic, though.

webknjaz avatar Jun 14 '23 13:06 webknjaz

Good to know, thanks. If cibuildwheel users are configuring config_settings with a TOML dict, it's not possible to set an empty flag, but using CIBW_CONFIG_SETTINGS it is possible to make the mistake as you note above.

Since it's a dict in the spec, we could just normalise all to be key-value pairs, to smooth over this issue. That would be my preference, I think.

joerick avatar Jun 16 '23 08:06 joerick