Skip to content

micropip.install is mishandling wheel tags#32

Description

@mentalisttraceur

馃悰 Bug

micropip.install does not reliably select the best-matching tagged wheel.

To Reproduce

  1. Open the official website's Pyodide REPL

  2. Use micropip to install a package with multiple pure Python 3 wheels. For example, my compose package has three (one for older Pythons, one for 3.5+ with async/await features added, and one for 3.8+ to use native PEP-570 positional-only arguments):

    >>> import micropip
    >>> await micropip.install('compose')
  3. Try importing acompose. If the py2.py30-tagged wheel got installed, this will fail:

    >>> from compose import acompose
    Traceback (most recent call last):
      File "<console>", line 1, in <module>
    ImportError: cannot import name 'acompose' from 'compose' (/lib/python3.10/site-packages/compose.py)

Expected behavior

The wheel tagged py38 gets installed (since Pyodide in that REPL is 3.10 at this time), import of acompose succeeds, and inspecting the signature of acompose.__call__ shows that PEP-570 positional-only syntax is being used:

>>> from compose import acompose
>>> help(acompose.__call__)
Help on function __call__ in module compose:

async __call__(self, /, *args, **kwargs)
    Call the composed function.

>>> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions