Update Emscripten binary wheels to include Emscripten platform tags (#2610)

This commit is contained in:
Hood Chatham 2022-05-24 23:39:33 -07:00 committed by GitHub
parent a525c54d66
commit 2513a89616
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 22 deletions

View File

@ -14,8 +14,9 @@ substitutions:
## Unreleased
- {{ Enhancement }} Integrity of Pyodide packages are now verified before loading them. This is for now only
limited to browser environments. {pr}`2513`
- {{ Enhancement }} Integrity of Pyodide packages are now verified before
loading them. This is for now only limited to browser environments.
{pr}`2513`
- {{ Fix }} Fix building on macOS {issue}`2360` {pr}`2554`
@ -28,9 +29,13 @@ substitutions:
- {{ Enhancement }} Update sqlite version to latest stable release
{pr}`2477` and {pr}`2518`
- {{ Fix }} We now tell packagers (e.g., Webpack) to ignore npm-specific imports when packing files for the browser. {pr}`2468`
- {{ Fix }} We now tell packagers (e.g., Webpack) to ignore npm-specific imports
when packing files for the browser.
{pr}`2468`
- {{ Enhancement }} Update Typescript target to ES2017 to generate more modern Javascript code. {pr}`2471`
- {{ Enhancement }} Update Typescript target to ES2017 to generate more modern
Javascript code.
{pr}`2471`
- {{ Enhancement }} We now put our built files into the `dist` directory rather
than the `build` directory. {pr}`2387`
@ -44,7 +49,8 @@ substitutions:
`pyodide.runPython(code, { globals : some_dict})`;
{pr}`2391`
- {{ Fix }} The build will error out earlier if `cmake` or `libtool` are not installed.
- {{ Fix }} The build will error out earlier if `cmake` or `libtool` are not
installed.
{pr}`2423`
- {{ Enhancement }} `pyodide.unpackArchive` now accepts any `ArrayBufferView` or
@ -61,7 +67,8 @@ substitutions:
translated to negative Python ints.
{pr}`2484`
- {{ Fix }} Pyodide now correctly handles JavaScript objects with `null` constructor.
- {{ Fix }} Pyodide now correctly handles JavaScript objects with `null`
constructor.
{pr}`2520`
- {{ Fix }} Fix garbage collection of `once_callable` {pr}`2401`
@ -70,8 +77,8 @@ substitutions:
rewriting and various other improvements.
{pr}`2510`
- {{ BREAKING }} `pyodide_build.testing` is removed. `run_in_pyodide` decorator can now be accessed
through `pyodide_test_runner`.
- {{ BREAKING }} `pyodide_build.testing` is removed. `run_in_pyodide` decorator
can now be accessed through `pyodide_test_runner`.
{pr}`2418`
- {{ Enhancement }} Added the `js_id` attribute to `JsProxy` to allow using
@ -82,16 +89,24 @@ substitutions:
`dictConverter` argument.
{pr}`2533`
- {{ Enhancement }} Added Python wrappers `set_timeout`, `clear_timeout`, `set_interval`,
`clear_interval`, `add_event_listener` and `remove_event_listener` for the corresponding JavaScript functions.
- {{ Enhancement }} Added Python wrappers `set_timeout`, `clear_timeout`,
`set_interval`, `clear_interval`, `add_event_listener` and
`remove_event_listener` for the corresponding JavaScript functions.
{pr}`2456`
- {{ Enhancement }} Pyodide now directly exposes the Emscripten `PATH` and `ERRNO_CODES` APIs.
- {{ Enhancement }} Pyodide now directly exposes the Emscripten `PATH` and
`ERRNO_CODES` APIs.
{pr}`2582`
- {{ Fix }} If the request errors due to CORS, `pyfetch` now raises an `OSError` not a `JSException`.
- {{ Fix }} If the request errors due to CORS, `pyfetch` now raises an `OSError`
not a `JSException`.
{pr}`2598`
- {{ Enhancement }} The platform tags of wheels now include the Emscripten
version in them. This should help ensure ABI compatibility if Emscripten
wheels are distributed outside of the main Pyodide distribution.
{pr}`2610`
### micropip
- {{ Fix }} micropip now correctly handles package names that include dashes
@ -111,7 +126,8 @@ substitutions:
If set to `True`, micropip will include pre-release and development versions.
{pr}`2542`
- {{ Enhancement }} `micropip` was refactored to improve readability and ease of maintenance.
- {{ Enhancement }} `micropip` was refactored to improve readability and ease of
maintenance.
{pr}`2561`, {pr}`2563`, {pr}`2564`, {pr}`2565`, {pr}`2568`
- {{ Enhancement }} Various error messages were fine tuned and improved.

View File

@ -11,7 +11,11 @@ from packaging.utils import parse_wheel_filename
from .io import parse_package_config
PLATFORM = "emscripten_wasm32"
def platform():
emscripten_version = get_make_flag("PYODIDE_EMSCRIPTEN_VERSION")
version = emscripten_version.replace(".", "_")
return f"emscripten_{version}_wasm32"
def pyodide_tags() -> Iterator[Tag]:
@ -22,6 +26,7 @@ def pyodide_tags() -> Iterator[Tag]:
"""
PYMAJOR = get_make_flag("PYMAJOR")
PYMINOR = get_make_flag("PYMINOR")
PLATFORM = platform()
python_version = (int(PYMAJOR), int(PYMINOR))
yield from cpython_tags(platforms=[PLATFORM], python_version=python_version)
yield from compatible_tags(platforms=[PLATFORM], python_version=python_version)

View File

@ -107,7 +107,7 @@ def compile(env, **kwargs):
args["orig__name__"] = __name__
make_command_wrapper_symlinks(env)
env["PYWASMCROSS_ARGS"] = json.dumps(args)
env["_PYTHON_HOST_PLATFORM"] = common.PLATFORM
env["_PYTHON_HOST_PLATFORM"] = common.platform()
from pyodide_build.pypabuild import build

View File

@ -9,6 +9,7 @@ from pyodide_build.common import (
find_matching_wheels,
get_make_environment_vars,
get_make_flag,
platform,
search_pyodide_root,
)
@ -89,6 +90,7 @@ def test_wheel_paths():
old_version = "cp38"
PYMAJOR = int(get_make_flag("PYMAJOR"))
PYMINOR = int(get_make_flag("PYMINOR"))
PLATFORM = platform()
current_version = f"cp{PYMAJOR}{PYMINOR}"
future_version = f"cp{PYMAJOR}{PYMINOR + 1}"
strings = []
@ -102,17 +104,17 @@ def test_wheel_paths():
"py2.py3",
]:
for abi in [interp, "abi3", "none"]:
for arch in ["emscripten_wasm32", "linux_x86_64", "any"]:
for arch in [PLATFORM, "linux_x86_64", "any"]:
strings.append(f"wrapt-1.13.3-{interp}-{abi}-{arch}.whl")
paths = [Path(x) for x in strings]
assert [x.stem.split("-", 2)[-1] for x in find_matching_wheels(paths)] == [
f"{current_version}-{current_version}-emscripten_wasm32",
f"{current_version}-abi3-emscripten_wasm32",
f"{current_version}-none-emscripten_wasm32",
f"{old_version}-abi3-emscripten_wasm32",
"py3-none-emscripten_wasm32",
"py2.py3-none-emscripten_wasm32",
f"{current_version}-{current_version}-{PLATFORM}",
f"{current_version}-abi3-{PLATFORM}",
f"{current_version}-none-{PLATFORM}",
f"{old_version}-abi3-{PLATFORM}",
f"py3-none-{PLATFORM}",
f"py2.py3-none-{PLATFORM}",
"py3-none-any",
"py2.py3-none-any",
]