Skip to content

feat: add handling for Emscripten wheels tags per PEP 783#804

Merged
henryiii merged 2 commits intopypa:mainfrom
hoodmane:pyodide-compat
Apr 8, 2026
Merged

feat: add handling for Emscripten wheels tags per PEP 783#804
henryiii merged 2 commits intopypa:mainfrom
hoodmane:pyodide-compat

Conversation

@hoodmane
Copy link
Copy Markdown
Contributor

@hoodmane hoodmane commented May 21, 2024

These are the changes to packaging specified in PEP 783.

PEP 783 is now accepted per @dstufft
https://discuss.python.org/t/pep-783-emscripten-packaging/86862/104

@hoodmane hoodmane changed the title Add Pyodide compatibility Add compatibility for Pyodide-tagged wheels May 21, 2024
@hoodmane hoodmane marked this pull request as ready for review June 7, 2024 02:05
@hoodmane
Copy link
Copy Markdown
Contributor Author

hoodmane commented Jun 7, 2024

@mayeut @henryiii @pradyunsg would appreciate review on this from any of you (and running the workflow).

@hoodmane
Copy link
Copy Markdown
Contributor Author

Tests and coverage check now pass locally for me.

@agriyakhetarpal
Copy link
Copy Markdown
Member

I stumbled into this PR, somehow – I guess the tests are valid for only Python 3.12 and should be skipped for other Python versions, @hoodmane?

@agriyakhetarpal
Copy link
Copy Markdown
Member

Now, we also pre-emptively need 2025_0 as we broke/will be breaking the ABI.

@juntyr
Copy link
Copy Markdown

juntyr commented Feb 19, 2025

+1 - it would be great if packaging installed from PyPi would just work out of the box in Pyodide

@agriyakhetarpal
Copy link
Copy Markdown
Member

I guess the only remaining parts here are to generalise the ABI tags, so that emscripten_x_y_zw and pyodide_abcd_e, where $$x, y, z, w, a, b, c, d, e ∈ [0, 9] $$ work, and skip the tests on unsupported Python versions (by probably grabbing the Python version from pyodide config get python_version)?

Comment thread tests/test_tags.py Outdated
Comment thread src/packaging/tags.py Outdated
@ofek
Copy link
Copy Markdown
Contributor

ofek commented Oct 28, 2025

What are the next steps for this?

@hoodmane
Copy link
Copy Markdown
Contributor Author

This can only be merged once PEP 783 is approved.

@ofek
Copy link
Copy Markdown
Contributor

ofek commented Oct 28, 2025

Indeed, and what's the status of that? I haven't seen any discussion update in months so I don't quite understand the state of the proposal.

@hoodmane
Copy link
Copy Markdown
Contributor Author

hoodmane commented Oct 28, 2025

Well I assume you also asked on the discuss thread? You can see the new comments there.
https://discuss.python.org/t/pep-783-emscripten-packaging/86862/64

@ofek
Copy link
Copy Markdown
Contributor

ofek commented Oct 28, 2025

Ah I don't have notifications for that enabled apparently, thanks a lot!

@hoodmane hoodmane changed the title Add compatibility for Pyodide-tagged wheels Add compatibility for PyEmscripten-tagged wheels Apr 6, 2026
@hoodmane hoodmane changed the title Add compatibility for PyEmscripten-tagged wheels PEP 783: Add handling for Emscripten wheels tags Apr 6, 2026
@hoodmane hoodmane changed the title PEP 783: Add handling for Emscripten wheels tags Add handling for Emscripten wheels tags per PEP 783 Apr 6, 2026
@hoodmane hoodmane force-pushed the pyodide-compat branch 3 times, most recently from dffeaa4 to 3585143 Compare April 7, 2026 04:20
Copy link
Copy Markdown
Contributor

@henryiii henryiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PEP has been accepted, and the little bit of code this adds is in the PEP, so I'll merge this in a day or so unless someone else does it first.

@henryiii henryiii mentioned this pull request Apr 7, 2026
Copy link
Copy Markdown
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it's a bit odd to have the Emscripten versions from 2024 (when this PR was opened) frozen in the code, and that we should reflect the newer changes in the ABI at the time of PEP acceptance.

Comment thread tests/test_tags.py Outdated
Comment thread tests/test_tags.py Outdated
Comment thread tests/test_tags.py Outdated
Comment thread tests/test_tags.py Outdated
Comment thread tests/test_tags.py Outdated
Comment thread tests/test_tags.py Outdated
Comment thread tests/test_tags.py Outdated
@hoodmane
Copy link
Copy Markdown
Contributor Author

hoodmane commented Apr 8, 2026

It doesn't matter what the values are at all, so I think it's fine.

@henryiii
Copy link
Copy Markdown
Contributor

henryiii commented Apr 8, 2026

Just in case people look at the tests to implement this (or this gets burned into some LLM), having more realistic values is (slightly) nicer. Since the numbers don't matter, I think it's also fine to have the more realistic values.

They don't need to keep updating, but starting realistic is nice.

@henryiii
Copy link
Copy Markdown
Contributor

henryiii commented Apr 8, 2026

@agriyakhetarpal it's saying you are requesting changes? Could you rearview (or point me to any remaining changes?)

Copy link
Copy Markdown
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why that is the case, but all is good here. It showed "Requested changes with read-only permissions" for me, and I'm not a collaborator on this project either, so my review/request-for-changes should have been non-blocking. Approving :)

hoodmane and others added 2 commits April 8, 2026 13:09
These are the changes to packaging specified in PEP 783.

PEP 783 is now accepted per dstufft
https://discuss.python.org/t/pep-783-emscripten-packaging/86862/104
Co-authored-by: Agriya Khetarpal <[email protected]>
@henryiii henryiii merged commit 2c6c7df into pypa:main Apr 8, 2026
57 checks passed
@henryiii henryiii changed the title Add handling for Emscripten wheels tags per PEP 783 feat: add handling for Emscripten wheels tags per PEP 783 Apr 8, 2026
Comment thread src/packaging/tags.py


def _emscripten_platforms() -> Iterator[str]:
pyemscripten_abi_version = sysconfig.get_config_var("PYEMSCRIPTEN_ABI_VERSION")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this should be PYEMSCRIPTEN_PLATFORM_VERSION 😅

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch, yes it is that in the PEP. Guess you want a 26.2 with PLATFORM?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though isn't this really more of a ABI version? PYEMSCRIPTEN_PLATFORM_VERSION seems more like it should be the whole thing.

Copy link
Copy Markdown
Member

@agriyakhetarpal agriyakhetarpal Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A 26.1.1 would be fine! And perhaps 26.1 could be yanked, if it's alright (or not).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though isn't this really more of a ABI version? PYEMSCRIPTEN_PLATFORM_VERSION seems more like it should be the whole thing.

It is, ultimately it's what we call the ABI officially now: https://pyodide.org/en/stable/development/abi.html

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though isn't this really more of a ABI version? PYEMSCRIPTEN_PLATFORM_VERSION seems more like it should be the whole thing.

Well there was a long discussion about whether we should call it ABI or platform, etc. I am not sure which was the better choice, but at least for me platform is clearer than ABI for most of the users I guess.

Copy link
Copy Markdown
Contributor

@henryiii henryiii Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Packaging does not allow patch releases. I don't really know why, but it's hard-coded into our release system. ¯\_(ツ)_/¯

(probably because we aren't semver?)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could pyodide also set PYEMSCRIPTEN_ABI_VERSION so that 26.1 works without yanking? Don't think we need to yank, not many will be using old packaging and new pyodide together, I'd hope.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need yanking here. sysconfig.get_config_var will return None for PYEMSCRIPTEN_ABI_VERSION and the _emscripten_platforms will simply return generic platforms. Old Pyodide will not have the pyemscripten sysconfig var anyways.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, let's leave out yanking here then. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants