QUERY · ISSUE
aiohttp newer version
enhancementproposed-close
This is how I install the aiohttp library on ESP32 C3 super mini:
import mip
mip.install('aiohttp')
Unfortunately, this installs a very old version: 0.0.6.
Is there any way to get a newer version?
CANDIDATE · PULL REQUEST
micropython/aiohttp: Add aiohttp package.
Implement an updated version of uaiohttpclient (renamed aiohttp) with ClientSession, WebSocketClient and SSLContext support, which is mostly compatible with CPython aiohttp-v3.9.1. client i.e. https://docs.aiohttp.org/en/stable/client_quickstart.html
This replaces #752 and #724 and requires:
- https://github.com/micropython/micropython/pull/11897
This is a really great contribution, thank you!
A few top-level comments/questions:
uaiohttpclient)? The main question here is about licensing/copyright.python-ecosysdirectory, because it's aiming to match something that already exists (in the Python ecosystem). And the manifest.py should have the optionpypi="aiohttp"added to themetadata()entry there (see other packages in thepython-ecosysdir for hints).uaiohttpclientlibrary as-is, and it can be deprecated and removed in the future. Essentiallyaiohttpwill be a completely new package.Thanks for the feedback!
The original idea was to add this to
uaiohttpclient, but I felt that it was a bit outdated so I though it would be better to add this as a replacement. ( although I agree with keepinguaiohttpclientas-is). So the source code I used comes from:uaiohttpclient(MIT) ->ClientResponse,ChunkedClientResponse,_request,request_rawaiohttp(Apache-2) -> https://docs.aiohttp.org/en/stable/client_reference.htmlAnd for WebSockets I used this too:
I would say so, e.g. all examples run as expected in MicroPython and CPython.
The TLDR of the things that are implemented is:
most features of https://docs.aiohttp.org/en/stable/client_quickstart.html (except Timeouts, and file uploads)
and some of https://docs.aiohttp.org/en/stable/client_advanced.html (i.e. headers and
SSLContext)I think the main difference is that MicroPython implementation is missing some keyword arguments in
ClientSessionand in requests method (I may update this with the "exact" diff if necessary)Also if you see anything that can be improved let me know or feel free to add any changes and I can review them later (whatever is faster 👍🏼 )
Great, thanks for those details. That all looks fine, the code is all MIT.
That's really good, getting the quick-start code mostly working is great.
That's fine. These things can be added in the future if needed.
Thanks for updating. Now merged.