Skip to content
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

Optionally build a pure wheel #1022

Closed
wants to merge 1 commit into from
Closed

Conversation

pombredanne
Copy link

Add a new --pure-wheel command line option to also build pure Python
wheel. If not selected, build will fail with a wheel that does not
contain platform-specific code once built.
Also add a new CIBW_PURE_WHEEL environment variable for this option.

Reference: #1021
Signed-off-by: Philippe Ombredanne pombredanne@nexb.com

@henryiii
Copy link
Contributor

This absolutely cannot go in until #569 is in, and even then, at the very best, I think it could be a undocumented environment only option that disables (or controls?) the check.

@henryiii
Copy link
Contributor

Could we possibly detect the pure wheel immediately (before the repair!), and then error out with a unique error code? Then you could continue if you receive that specific error code?

@henryiii
Copy link
Contributor

So basically raise NonPlatformWheelError() would have a unique "error" code.

@pombredanne
Copy link
Author

So basically raise NonPlatformWheelError() would have a unique "error" code.

@henryiii if you think this is not a good idea in the first place, do you still want to have something in place that would be guarded only by an environment variable then?

@henryiii
Copy link
Contributor

No, if there was a unique error, then you could detect it and just continue on if that's actually what you want to do. No need for a secret or hidden setting, or special logic on our end.

Add a new --pure-wheel command line option to also build pure Python
wheel. If not selected, build will fail with a wheel that does not
contain platform-specific code once built.
Also add a new CIBW_PURE_WHEEL environment variable for this option.



Reference: pypa#1021
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@pombredanne
Copy link
Author

No, if there was a unique error, then you could detect it and just continue on if that's actually what you want to do. No need for a secret or hidden setting, or special logic on our end.

I am not entirely clear about what you want. Let me reformulate:

  1. remove the --pure-wheel option. There will be no CLI option at all?
  2. in the main build loop ("for config in platform_configs:" as in
    for config in platform_configs:
    ) we would accumulate some list of "errors" to tracks when pure wheels are created (likely which ones),
  3. if there were pure wheels a exception would be raised at the end?

I am not sure I get how this design would work, at least without some CLI option or env var unless you are saying that building pure wheels would never go through the tests?

@joerick
Copy link
Contributor

joerick commented Feb 22, 2022

Closing this for the reasons stated in #1021.

@joerick joerick closed this Feb 22, 2022
@joerick
Copy link
Contributor

joerick commented Feb 22, 2022

My apologies @pombredanne. But we can't support every user request! There is a small chance that such functionality might find its way into the project as a side-effect of limited-api support, but my advice would be to find a workaround external to cibuildwheel. We could add a custom error code, to address your question above, one way to do this would be to catch NonPlatformWheelError at this location and handle it by printing the message and exiting the program with sys.exit(3).

@pombredanne pombredanne deleted the pure-wheel branch February 22, 2022 12:53
@pombredanne
Copy link
Author

@joerick You do not have to be sorry! I was about to close this anyway as it truly does not make sense to have it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants