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

using build tags #791

Closed
davidism opened this issue Aug 10, 2021 · 8 comments
Closed

using build tags #791

davidism opened this issue Aug 10, 2021 · 8 comments

Comments

@davidism
Copy link

I'd like to release a Python 3.10 RC1 wheel for MarkupSafe 2.0.1, which is already on PyPI. Since I haven't built a 3.10 wheel before, I'll be able to push it to the existing PyPI release. However, when 3.10 final comes out, I'll want to rebuild the wheel, but I'll need to build with something like bdist_wheel --build-number 01 to allow pushing another 3.10 wheel to the same PyPI release. Is it possible to tell cibuildwheel to use a build tag? Or maybe this is just a filename convention, something I can change after downloading the builds?

@davidism
Copy link
Author

It looks like besides the file name, --build-number 01 does add a Build: 01 field to the dist-info/WHEEL file inside the wheel, but otherwise I think the wheel looks the same.

@davidism
Copy link
Author

And the dist-info/RECORD file would need an updated hash for dist-info/WHEEL.

@davidism
Copy link
Author

davidism commented Aug 10, 2021

I can probably do this with a script that uses wheel unpack and wheel pack.

@henryiii
Copy link
Contributor

Why re-release when 3.10 is out? The 3.10 series has a locked locked ABI once the first RC candidate is out, so a wheel built with 3.10.0rc1 will be identical to one built with 3.10.0. Or 3.10.9 - the patch version (starting with RC 1) does not factor into the build.

(Technically, I think they locked the ABI at beta 4, but rc 1 is a nicer point to start at)

@henryiii
Copy link
Contributor

And I'm planning to work on what you are asking for in pypa/wheel#407 - being able to change the wheel tags is useful, but I would not use it to "re-release" a 3.10 binary.

@davidism
Copy link
Author

I didn't know it wouldn't need to be rebuilt for that. I was also thinking that CI wouldn't really have the right information for tags, so this seems like something I should do locally with wheel. I'll close this, but maybe a mention of "use wheel to add a build number if you needed to rebuild a wheel` would be useful in the docs?

@EwoutH
Copy link
Contributor

EwoutH commented Jul 9, 2024

Hi everyone! I found this issue via @hugovk, who has been doing some serious work on getting Python 3.13 supported in the ecosystem. He proposed in a blog:

ABI breaks during the beta are infrequent and unintentional. If they happen, you can rebuild your wheels and upload them to an existing PyPI release by adding an optional build tag to the filename:

When using cibuildwheel, that method would require being able to use build tags.

This is part of a larger discussing we're having on discuss.python.org, which I would like to reference: https://discuss.python.org/t/idea-tracking-abi-additions-and-changes-for-better-pre-release-wheel-management/26033/12

@henryiii
Copy link
Contributor

henryiii commented Jul 9, 2024

That's not up to cibuildwheel. There are two ways to do it: if the build backend supports it, you can tell it to add a build tag; -Cwheel.build-tag=1 for scikit-build-core, for example (this can be set in cibuildwheel's config-settings field). Or you can re-tag the wheel with the wheel tags utility. pipx run wheel tags --build=1 --remove wheelhouse/*.whl for example.

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

No branches or pull requests

3 participants