-
-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
It would be nice if there was a fallback method to provide a URL while micropip is unable to find a pure Python wheel.
Currently (while waiting for pyodide/pyodide#5388 to be released), I'm having to do
from packaging.tags import parse_tag # noqa
from packaging.version import Version # noqa
import micropip # noqa
from micropip import transaction # noqa
from micropip.wheelinfo import WheelInfo # noqa
real_find_wheel = transaction.find_wheel
def custom_find_wheel(metadata: Any, req: Any) -> Any:
if metadata.name == 'jiter':
known_version = Version('0.8.2')
if known_version in metadata.releases:
tag = 'cp312-cp312-emscripten_3_1_58_wasm32'
filename = f'{metadata.name}-{known_version}-{tag}.whl'
url = f'https://files.pydantic.run/{filename}'
return WheelInfo(
name=metadata.name,
version=known_version,
filename=filename,
build=(),
tags=frozenset({parse_tag(tag)}),
url=url,
parsed_url=urlparse(url),
)
return real_find_wheel(metadata, req)
transaction.find_wheel = custom_find_wheelWhich seems excessively ugly.
I know I could use an index_url, but then:
- I think it would stop micropip consulting the pyodide lock file first
- would require more infra than I want to setup
andycloke
Metadata
Metadata
Assignees
Labels
No labels