aio-libs/frozenlist

Pure Python wheel not included in release

Closed this issue · 5 comments

Long story short

The pure Python wheel (frozenlist-1.4.0-py3-none-any.whl) is not present in the release even though python -Im build --config-setting=pure-python=true is present in the workflow. This is needed for Pyodide, where installing through micropip would not result in an error.

Testing environment: https://jupyter.org/try-jupyter/lab/

import micropip
await micropip.install("frozenlist", keep_going=True)
import frozenlist
print(frozenlist.__version__)

Expected behaviour

1.4.0

Actual behaviour

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[5], line 1
----> 1 await micropip.install("frozenlist", keep_going=True)
      2 import frozenlist
      3 print(frozenlist.__version__)

File /lib/python3.11/site-packages/micropip/_commands/install.py:146, in install(requirements, keep_going, deps, credentials, pre, index_urls, verbose)
    144 if transaction.failed:
    145     failed_requirements = ", ".join([f"'{req}'" for req in transaction.failed])
--> 146     raise ValueError(
    147         f"Can't find a pure Python 3 wheel for: {failed_requirements}\n"
    148         f"See: {FAQ_URLS['cant_find_wheel']}\n"
    149     )
    151 package_names = [pkg.name for pkg in transaction.pyodide_packages] + [
    152     pkg.name for pkg in transaction.wheels
    153 ]
    155 if package_names:

ValueError: Can't find a pure Python 3 wheel for: 'frozenlist'
See: https://pyodide.org/en/stable/usage/faq.html#why-can-t-micropip-find-a-pure-python-wheel-for-a-package

Steps to reproduce

import micropip
await micropip.install("frozenlist", keep_going=True)
import frozenlist
print(frozenlist.__version__)

Your environment

https://jupyter.org/try-jupyter/lab/

@psymbio the CI workflow runs against the master branch, but v1.4.0 has been released long before the packaging revamp. I haven't yet made a release.
I think the confusing bit may be that the version in the source hasn't been updated to "dev" and the docs show that as 1.4.0, while in fact you're looking into the unreleased changelog draft.

When I get to releasing, the pure-python wheel will be shipped together with the rest.

While I have you here, do you know of any reusable way of setting up wasm testing in GHA? Like actions/setup-python but for things like pyodide? I'd be happy to run an additional CI job for this, if needed.

cc @rth

rth commented

There is an example of such setup e.g. in numpy. In this case, because you don't need to compile any C extensions, you can probably do,

  • install python 3.11 and node
  • pip install pyodide-build
  • create a venv with where python is provided by pyodide
    pyodide venv my-env
    
  • install your pure Python wheel with pip there
  • run pytest

As you discovered, related there is also https://github.com/pyodide/pyodide-actions and https://github.com/pyodide/pytest-pyodide/, but we should probably improve the developer experience here.

Regarding testing, here honestly I'm not even sure it makes sense to run tests for Pyodide. As long as the package is pure Python, doesn't do any complex syscalls (network, sockets, processes, threads, or some rare fs features) which work differently in the browser, it should just work with no changes.

Ah, interesting. Would it make sense to build the Cython version for WASM?

v1.4.1 now ships said wheels: