-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make aiohttp work in Jupyterlite #7253
Comments
Pin in 3.9 is < 7, so if it's just multidict version, this'll be resolved then. |
Thx. My guess is that more is needed to make aiohttp work in Pyodide and Jupyterlite. For example there is quite some work in pyodide-http for widely used http libraries to make them work in the browser. |
I'm not really into the idea of modifying the inner workings of a robust library such as aiohttp so "it works" with another library. For all I know, it should not be aiohttp to change it's behavior. |
Pyodide/ webassembly is not another library. Its a new platform for Python. Similar to Windows, OSX and Linux 👍 The ask is not to make it work with Panel. The ask is to also support the browser as a platform vis Pyodide/ PyScript/ Jupyterlite/ webassembly. I understand this is not a high priority right now. |
My bad i wrongly understood the request. I'm just a user tough ;) |
Generally, if you want a feature, you'll likely have to do the work to implement it. Once it's merged in, we'll try and keep it maintained in the future. I'll try and get a beta release of 3.9 out soon, and then you can retest installation. |
@Dreamsorcerer I was considering doing a patch to this library in pyodide-http. Would you have an interest in support directly in aiohttp? Because of the nature of webasembly/emscripten, it would only be client, and would have some limitations due to only being able to do whatever the browser running it does, but looking at the API it doesn't seem so far removed from async http in webasembly. It would be handy for me to push it here rather than to have to monkeypatch it in pyodide-http. |
It depends on what the changes involve really. Can you throw together a draft PR without putting much time into it? Then we can decide on whether it'll be worth finishing off. |
FIY @hoodmane wrote a draft monkeypatch in pyodide/pyodide#4282 (comment) and that PR woulds build a binary pyodide/wasm wheel for aiohttp, on which it could be applied. |
@Dreamsorcerer currently the patch for Pyodide might be a bit invasive. The main problem is that we cannot meaningfully respect the user's choice of I think the best thing to do would be to add a Pyodide-specific |
I will try to make a draft PR as a point of discussion, maybe later this week. |
Okay opened #7803. |
This doesn't actually work without an additional patch but it's possible to get it to work by monkey patching a method. See discussion about adding support for Pyodide to aiohttp: aio-libs/aiohttp#7253 aio-libs/aiohttp#7803
Is your feature request related to a problem?
I'm a contributor to Panel which can run on many platforms including Panelite (~Jupyterlite). We would like to be able to use Jupyterlite to provide an easy to use platform to showcase our framework and help our users learn how to use it.
I believe this is a general trend in Python that frameworks and users start moving to the browser powered by Pyodide, PyScript and Jupyterlite for education and for lighter data analytics.
One of Panels reference notebooks shows how to use Panel with async and
aiohttp
. The problem is that I cannot importaiohttp
with piplite.You can reproduce as described below
Describe the solution you'd like
That I can import and use
aiohttp
in Pyodide and Jupyterlite.Describe alternatives you've considered
Removing the
aiohttp
notebook from the Panelite example notebooks.Related component
Client
Additional context
When the import problem has been solved there is probably a lot more to solve to get aiohttp working.
The code we are using is
I can see that
multidict
can be imported by it self. Its the version pinned that is the import problem.Code of Conduct
The text was updated successfully, but these errors were encountered: