posit-dev / posit-dev/pointblank

Pointblank packaging error when used in marimo WASM notebooks

Open
#238 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: ☹︎ Bug
Dominant language
Python
Stars
490
Forks
32
Avg merge
14h 24m
Merged PRs (30d)
2

Description

Prework

Description

Pointblank doesn't import properly into marimo WASM notebooks because of a narwhals packaging conflict

Reproducible example

The following code in marimo

import sys

if "pyodide" in sys.modules:  # make sure we're running in pyodide/WASM
    import micropip
    await micropip.install("pointblank")

import pointblank as pb

This throws the following error.

Traceback (most recent call last):
  File "/lib/python3.12/site-packages/marimo/_runtime/executor.py", line 112, in execute_cell_async
    await eval(cell.body, glbls)
  Cell 
marimo://notebook.py#cell=cell-0
, line 10, in <module>
    await micropip.install("pointblank")
  File "/lib/python3.12/site-packages/micropip/package_manager.py", line 133, in install
    return await install(
           ^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/micropip/install.py", line 53, in install
    await transaction.gather_requirements(requirements)
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 55, in gather_requirements
    await asyncio.gather(*requirement_promises)
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 62, in add_requirement
    return await self.add_requirement_inner(Requirement(req))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 152, in add_requirement_inner
    await self._add_requirement_from_package_index(req)
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 214, in _add_requirement_from_package_index
    await self.add_wheel(wheel, req.extras, specifier=str(req.specifier))
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 262, in add_wheel
    await asyncio.gather(
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 55, in gather_requirements
    await asyncio.gather(*requirement_promises)
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 59, in add_requirement
    return await self.add_requirement_inner(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 141, in add_requirement_inner
    satisfied, ver = self.check_version_satisfied(req)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 86, in check_version_satisfied
    raise ValueError(
ValueError: Requested 'narwhals>=1.41.0', but narwhals==1.24.1 is already installed

You can try my example here
https://marimo.io/p/@paddy-mullen/notebook-f9ojwj

  • [X ] Post a minimal reproducible example (MRE) so the maintainer can troubleshoot the problems you identify. A reproducible example is:
    • [ X] Runnable: post enough code and data so any onlooker can create the error on their own computer.
    • [ X] Minimal: reduce runtime wherever possible and remove complicated details that are irrelevant to the issue at hand.
    • Readable: format your code according to the Style Guide for Python Code.

Expected result

You should be able to play with Pointblank in WASM/Pyodide marimo notebooks.

Development environment

  • Operating System: [e.g., Linux, macOS, Windows]
  • Pointblank Version: latest?

Additional context

Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the linked marimo notebook or the provided Pyodide example and confirm the narwhals version conflict during micropip.install("pointblank"). Inspect Pointblank's published dependency and packaging metadata to identify why narwhals>=1.41.0 is requested while 1.24.1 is preinstalled; done means Pointblank imports successfully in a WASM/Pyodide marimo notebook.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, wasm
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.