diff --git a/micropip/wheelinfo.py b/micropip/wheelinfo.py index c6d255f..8c77cbf 100644 --- a/micropip/wheelinfo.py +++ b/micropip/wheelinfo.py @@ -54,6 +54,7 @@ class WheelInfo: _dist_info: Path | None = None def __post_init__(self): + assert self.url.startswith("http"), self.url self._project_name = safe_name(self.name) @classmethod diff --git a/tests/conftest.py b/tests/conftest.py index af55b88..c704a57 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -270,7 +270,7 @@ def add_pkg_version( releases[version] = [ { "filename": filename, - "url": filename, + "url": f"http://fake.domain/f/{filename}", "digests": { "sha256": Wildcard(), }, diff --git a/tests/test_install.py b/tests/test_install.py index 111926a..aa89b0e 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -257,7 +257,7 @@ def _mock_fetch_bytes(arg, *args, **kwargs): msg = "Access-Control-Allow-Origin" with pytest.raises(ValueError, match=msg): - await micropip.install("htps://x.com/xxx-1.0.0-py3-none-any.whl") + await micropip.install("https://x.com/xxx-1.0.0-py3-none-any.whl") @pytest.mark.skip_refcount_check