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

chore: bump pyodide #1859

Merged
merged 1 commit into from
Jun 8, 2024
Merged

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented Jun 8, 2024

Bumping for pyodide 0.26.1, which contains some important fixes.

We should probably automate this. You can get the emscripten version from pyodide build, not sure if there's a better way.

Signed-off-by: Henry Schreiner <[email protected]>
@henryiii
Copy link
Contributor Author

henryiii commented Jun 8, 2024

@hoodmane, is there another way to get the emscripten version for a specific pypodide versions, via an API or anything? One that doesn't require installing pyodide-build? Okay if not, but just checking before setting something up. I'd like to be able to quickly get the current pyodide version (can do that with lastversion), and then get the matching emscripten version it requires.

@hoodmane
Copy link
Contributor

hoodmane commented Jun 8, 2024

@ryanking13 do we have anything for this? The information is in this file:
https://raw.githubusercontent.com/pyodide/pyodide/1196a59a8b58b3e2c3e1a1b5f7fd71b924d3ed92/pyodide-cross-build-environments.json
Ideally we should make an http API for this...

@henryiii henryiii merged commit ed12054 into pypa:main Jun 8, 2024
20 of 23 checks passed
@henryiii henryiii deleted the henryiii/chore/pyodide0.26.1 branch June 8, 2024 05:38
@ryanking13
Copy link

ryanking13 commented Jun 8, 2024

@ryanking13 do we have anything for this? The information is in this file:
https://raw.githubusercontent.com/pyodide/pyodide/1196a59a8b58b3e2c3e1a1b5f7fd71b924d3ed92/pyodide-cross-build-environments.json

Yes, that file has the python and emscripten version information needed to build targeting a specific pyodide version.
We will try to keep backward compatibility as much as possible, so I guess for now you can use jq to parse that file.

@henryiii
Copy link
Contributor Author

henryiii commented Jun 8, 2024

@ryanking13
Copy link

I opened a PR to add 0.26.1 (pyodide/pyodide#4854). The workflow for updating that file is not fully automated yet, but I'm planning to improve it.

@henryiii
Copy link
Contributor Author

henryiii commented Jun 8, 2024

# /// script
# dependencies = [ "requests", "packaging", "tomlkit" ]
# ///

from pathlib import Path

import requests
import tomlkit
from packaging.version import Version

URL = "https://raw.githubusercontent.com/pyodide/pyodide/main/pyodide-cross-build-environments.json"
DIR = Path(__file__).parent.resolve()


def main():
    response = requests.get(URL)
    response.raise_for_status()
    pyodide_info = response.json()

    current = max(pyodide_info["releases"].values(), key=lambda v: Version(v["version"]))

    config_file = DIR.parent / "cibuildwheel/resources/build-platforms.toml"
    content = tomlkit.parse(config_file.read_text())
    configs = content["pyodide"]["python_configurations"]
    for config in configs:
        if config["version"].split(".")[1] == current["python_version"].split(".")[1]:
            config["version"] = current["python_version"]
            config["pyodide_version"] = current["version"]
            config["emscripten_version"] = current["emscripten_version"]

    config_file.write_text(tomlkit.dumps(content))


if __name__ == "__main__":
    main()

Works (well, currently it downgrades pyodide, but that's "working").

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