scikit-hep / awkward

Manipulate JSON-like data with NumPy-like idioms.
https://awkward-array.org
BSD 3-Clause "New" or "Revised" License
850 stars 89 forks source link

chore: increase try-it version of Awkward to 2.6.4 #3279

Closed jpivarski closed 2 weeks ago

jpivarski commented 1 month ago

When I check the Pyodide console currently available online, the current version of awkward-cpp is 33:

>>> import awkward_cpp
>>> import pkg_resources
<console>:1: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
>>> pkg_resources.get_distribution("awkward-cpp")
awkward-cpp 33 (/lib/python3.12/site-packages)

This is a little more recent than the awkward-cpp 26 that the Try-it! page is currently pinned to (because if we didn't pin it, it wouldn't get the latest awkward-cpp but would get the latest awkward and there'd be a conflict). Updates are good things, so let's update (from November 2023 to May 2024).

The latest awkward version this corresponds to is 2.6.4:

https://github.com/scikit-hep/awkward/blob/836b28a1451c0a0bfab5c74ec179fc15af24cd2f/awkward-cpp/pyproject.toml#L8-L10

This PR ought to give me a "View Deployment" button (it's also a test of that), which I'll want to test before committing to change the documentation. The worst thing is when a public Try-it! page is broken—even being out of date is better.

jpivarski commented 1 month ago

No, this has the wheel spin forever, but in the Javascript console,

Uncaught (in promise) PythonError: Traceback (most recent call last):
  File "/lib/python3.11/site-packages/micropip/_commands/install.py", line 142, in install
    await transaction.gather_requirements(requirements)
  File "/lib/python3.11/site-packages/micropip/transaction.py", line 204, in gather_requirements
    await asyncio.gather(*requirement_promises)
  File "/lib/python3.11/site-packages/micropip/transaction.py", line 211, in add_requirement
    return await self.add_requirement_inner(Requirement(req))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/micropip/transaction.py", line 300, in add_requirement_inner
    await self._add_requirement_from_package_index(req)
  File "/lib/python3.11/site-packages/micropip/transaction.py", line 347, in _add_requirement_from_package_index
    await self.add_wheel(wheel, req.extras, specifier=str(req.specifier))
  File "/lib/python3.11/site-packages/micropip/transaction.py", line 385, in add_wheel
    await self.gather_requirements(wheel.requires(extras))
  File "/lib/python3.11/site-packages/micropip/transaction.py", line 204, in gather_requirements
    await asyncio.gather(*requirement_promises)
  File "/lib/python3.11/site-packages/micropip/transaction.py", line 208, in add_requirement
    return await self.add_requirement_inner(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/micropip/transaction.py", line 300, in add_requirement_inner
    await self._add_requirement_from_package_index(req)
  File "/lib/python3.11/site-packages/micropip/transaction.py", line 339, in _add_requirement_from_package_index
    wheel = find_wheel(metadata, req)
            ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/micropip/transaction.py", line 431, in find_wheel
    raise ValueError(
ValueError: Can't find a pure Python 3 wheel for 'awkward-cpp==33'.
See: https://pyodide.org/en/stable/usage/faq.html#why-can-t-micropip-find-a-pure-python-wheel-for-a-package
You can use `await micropip.install(..., keep_going=True)` to get a list of all packages with missing wheels.

    at new_error (pyodide.asm.js:9:10014)
    at pyodide.asm.wasm:0x158e62
    at pyodide.asm.wasm:0x15ff9e
    at _PyEM_TrampolineCall_JS (pyodide.asm.js:9:120223)
    at pyodide.asm.wasm:0x1a3494
    at pyodide.asm.wasm:0x28a2bd
    at pyodide.asm.wasm:0x1e431e
    at pyodide.asm.wasm:0x1a397d
    at pyodide.asm.wasm:0x1a3c3e
    at pyodide.asm.wasm:0x1a3ce0
    at pyodide.asm.wasm:0x2689a4
    at pyodide.asm.wasm:0x26e800
    at pyodide.asm.wasm:0x1a3e08
    at pyodide.asm.wasm:0x1a3a98
    at pyodide.asm.wasm:0x15f76b
    at Module.callPyObjectKwargs (pyodide.asm.js:9:64297)
    at Module.callPyObject (pyodide.asm.js:9:65365)
    at wrapper (pyodide.asm.js:9:32855)
agoose77 commented 1 month ago

@jpivarski the thing to watch out for here is the version of pyodide that is pulled into the HTML page. Before, we built the WASM wheel ourselves and pulled it in, but now that we rely on the prebuilt distribution, we can only move as fast as the distribution release cadence.

It looks like we can bump to whichever version of Awkward is in 0.26.2 (see https://github.com/scikit-hep/awkward/blob/3d031ca2482c6d9f94f1153aef53e3b772b2406b/docs/_static/try-it.html#L76C58-L76C65)

jpivarski commented 2 weeks ago

Thanks, @agoose77! I see now that we're pulling a specific version of Pyodide, and so we need to get three versions aligned: Pyodide, awkward-cpp, and awkward. But it is fortunate that we do control the Pyodide version, rather than just getting whatever the latest version is, because this triple-combination will continue to work, like a lockfile. It just won't always have the latest features. Someone (me) will need to manually update it.

(For instance, if someone wants to try out the named axes...)