-
Notifications
You must be signed in to change notification settings - Fork 16
update asyncio from MicroPython v1.19.1 #47
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
Conversation
79a37b9
to
b2732bc
Compare
b2732bc
to
9d69aa2
Compare
gather is now async, and the one `yield` that was in it was replaced by `await core._never()`. Incorporated adafruit/circuitpython@55169e0#diff-01b6761622028d47c6d1c2293fa365de3d8f03feb485d42e42ea9050198e1635 which never got into the asyncio library previously. (I fixed the bug independently, but didn't understand why it was needed, until I found that PR.)
This breaks running against 8.x. I have a
The 'price' of this is probably under 100 bytes of flash in the core (6 dict entries + 3 qstrs with 30 chars total) |
How about keeping the new names in the Python version of |
Another alternative is to adapt to either naming convention inside asyncio but I am not thrilled about it: https://gist.github.com/jepler/71f02ca767d75d5fa4dd40abf70655f9 -- it does present a merge burden because all the call sites change.
I don't think the "provide both names in core" is much of a merge burden, it just looks like this: diff --git a/extmod/moduasyncio.c b/extmod/moduasyncio.c
index ea81fbc310..2ba8efb1fe 100644
--- a/extmod/moduasyncio.c
+++ b/extmod/moduasyncio.c
@@ -160,6 +160,11 @@ STATIC const mp_rom_map_elem_t task_queue_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_push), MP_ROM_PTR(&task_queue_push_obj) },
{ MP_ROM_QSTR(MP_QSTR_pop), MP_ROM_PTR(&task_queue_pop_obj) },
{ MP_ROM_QSTR(MP_QSTR_remove), MP_ROM_PTR(&task_queue_remove_obj) },
+
+ // CIRCUITPYTHON: remove these after the bundle need not support 8.x
+ { MP_ROM_QSTR(MP_QSTR_push_head), MP_ROM_PTR(&task_queue_push_obj) },
+ { MP_ROM_QSTR(MP_QSTR_push_sorted), MP_ROM_PTR(&task_queue_push_obj) },
+ { MP_ROM_QSTR(MP_QSTR_pop_head), MP_ROM_PTR(&task_queue_pop_obj) },
};
STATIC MP_DEFINE_CONST_DICT(task_queue_locals_dict, task_queue_locals_dict_table);
|
I agree with your conclusion. I was suggesting leaving |
oh, yes, I see what you mean. I agree, the new names could be adopted now in the bundled pure Python TaskQueue implementation. |
choose the way that is compatible with 8.x and 9.x
This is now compatible with 8.x again, by using the old names |
Updating https://github.com/adafruit/Adafruit_CircuitPython_asyncio to 1.1.0 from 0.5.24: > Merge pull request adafruit/Adafruit_CircuitPython_asyncio#49 from tannewt/1.20-fixes > Merge pull request adafruit/Adafruit_CircuitPython_asyncio#47 from adafruit/9.0.0-updates Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Added the following libraries: Adafruit_CircuitPython_AD569x Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Updated download stats for the libraries
These are updates, including bug fixes, merged from https://github.com/micropython/micropython/tree/v1.19.1/extmod/uasyncio.
They are needed for adafruit/circuitpython#8281, in particular, to make the updated asyncio tests in v1.19.1 pass.
There will be further changes to consider for the v1.20 merge, at least micropython/micropython#10190.
I made this PR in
adafruit
rather than indhalbert
so I did not change.gitmodules
to point to my own repo while testing this in the CircuitPython PR.