Skip to content

Commit 0672acd

Browse files
committed
Hardcode support for platform pyodide_wasm32
I don't like it; this feels like a hack, but it works, and I would be happy to get more guidance. Also one weird thing, is if I installl pywavelets nightly, it installs numpy stable; while the index does have a numpy nightly; And with the same config, if I ask it to install numpy; it does install numpy nightly. So there is something wonkey in recursive dependency handling of indexes.
1 parent 1fa0b52 commit 0672acd

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Unreleased
8+
9+
### Fixed
10+
11+
- Fix a bug that prevented some wasm32 wheel to be recognized as compatible with pyodide
12+
[#159](https://github.com/pyodide/micropip/pull/159)
13+
714
## [0.7.1] - 2024/11/11
815

916
### Fixed

micropip/_utils.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import json
33
from importlib.metadata import Distribution
44
from pathlib import Path
5-
from sysconfig import get_platform
5+
from sysconfig import get_config_var, get_platform
66

77
from packaging.requirements import Requirement
88
from packaging.tags import Tag
@@ -62,8 +62,15 @@ def get_files_in_distribution(dist: Distribution) -> set[Path]:
6262

6363

6464
@functools.cache
65-
def sys_tags() -> list[Tag]:
66-
return list(sys_tags_orig())
65+
def sys_tags() -> tuple[Tag, ...]:
66+
new_tags = []
67+
abi_version = get_config_var("PYODIDE_ABI_VERSION")
68+
pyodide_platform_tag = f"pyodide_{abi_version}_wasm32"
69+
for tag in sys_tags_orig():
70+
if "emscripten" in tag.platform:
71+
new_tags.append(Tag(tag.interpreter, tag.abi, pyodide_platform_tag))
72+
new_tags.append(tag)
73+
return tuple(new_tags)
6774

6875

6976
@functools.cache

micropip/package_index.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ def _fast_check_incompatibility(filename: str) -> bool:
214214
if not filename.endswith(".whl"):
215215
return False
216216

217+
if filename.endswith("wasm32.whl") and sys.platform == "emscripten":
218+
return True
219+
217220
if sys.platform not in filename and not filename.endswith("-none-any.whl"):
218221
return False
219222

0 commit comments

Comments
 (0)