mirror of https://github.com/pyodide/pyodide.git
also lowercase when normalizing micropip package names (#2445)
This commit is contained in:
parent
e3e3c193a2
commit
7152cea01d
|
@ -33,7 +33,7 @@ def _format_table(headers: list[str], table: list[Iterable]) -> str:
|
|||
|
||||
|
||||
def normalize_package_name(pkgname: str):
|
||||
return re.sub(r"[^\w\d.]+", "_", pkgname, re.UNICODE)
|
||||
return re.sub(r"[^\w\d.]+", "_", pkgname, re.UNICODE).lower()
|
||||
|
||||
|
||||
@dataclass
|
||||
|
|
|
@ -405,10 +405,9 @@ def test_list_wheel_name_mismatch(monkeypatch):
|
|||
pytest.importorskip("packaging")
|
||||
from micropip import _micropip
|
||||
|
||||
dummy_pkg_name = "dummy-dummy"
|
||||
dummy_url = (
|
||||
f"https://dummy.com/{dummy_pkg_name.replace('-', '_')}-1.0.0-py3-none-any.whl"
|
||||
)
|
||||
dummy_pkg_name = "dummy-Dummy"
|
||||
normalized_pkg_name = dummy_pkg_name.replace("-", "_").lower()
|
||||
dummy_url = f"https://dummy.com/{normalized_pkg_name}-1.0.0-py3-none-any.whl"
|
||||
_mock_fetch_bytes = mock_fetch_bytes(dummy_pkg_name, f"Name: {dummy_pkg_name}")
|
||||
|
||||
monkeypatch.setattr(_micropip, "fetch_bytes", _mock_fetch_bytes)
|
||||
|
|
Loading…
Reference in New Issue