-
Notifications
You must be signed in to change notification settings - Fork 16
Fix uses of 'await sleep(0)' #30
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dhalbert
requested changes
Oct 15, 2022
…, Task" This reverts commit 95cd442.
d81500d
to
f22e949
Compare
This can be used in cases where `await SOMETHING` is required, but the task cannot be put back on the queue like `await sleep(0)` would do. This passes the test and the docs build (locally)
b247be5
to
c98cff8
Compare
Sadly this does not appear to fix adafruit/circuitpython#6706. |
a05d1cc
to
dfecbc5
Compare
.. and use a simpler(?) way to invoke sed I don't know why this apparently only started recently, but circuitpython-build-tools creates build_deps/circuitpython with a directory 'nvm.toml' inside. The existing sed command would attempt to run on this directory. `find pattern... -exec command... +` takes the matching items and puts them on the command... commandline, without any concerns about whitespace or quoting. `for $(find...)` has several concerns about whitespace and quoting. It also adds "-type f" to restrict the match to only files, not directories.
dfecbc5
to
d81e6aa
Compare
@dhalbert I think this is ready, though I could rebase it to get rid of the 'bare yield' iteration of the change. |
d2c907a
to
d81e6aa
Compare
@dhalbert ready for your re-review |
dhalbert
approved these changes
Oct 18, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for researching and fixing this!
This was referenced Oct 18, 2022
adafruit-adabot
added a commit
to adafruit/Adafruit_CircuitPython_Bundle
that referenced
this pull request
Oct 19, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_ADXL34x to 1.12.7 from 1.12.6: > Merge pull request adafruit/Adafruit_CircuitPython_ADXL34x#37 from tekktrik/dev/fix-value-error Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306 to 1.5.10 from 1.5.9: > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306#29 from tekktrik/dev/fix-type-annotation Updating https://github.com/adafruit/Adafruit_CircuitPython_GPS to 3.10.6 from 3.10.5: > Merge pull request adafruit/Adafruit_CircuitPython_GPS#90 from tekktrik/dev/fix-example-import Updating https://github.com/adafruit/Adafruit_CircuitPython_PM25 to 2.1.13 from 2.1.12: > Merge pull request adafruit/Adafruit_CircuitPython_PM25#25 from tekktrik/main Updating https://github.com/adafruit/Adafruit_CircuitPython_SD to 3.3.15 from 3.3.14: > Merge pull request adafruit/Adafruit_CircuitPython_SD#51 from calcut/main Updating https://github.com/adafruit/Adafruit_CircuitPython_SHTC3 to 1.1.10 from 1.1.9: > Merge pull request adafruit/Adafruit_CircuitPython_SHTC3#17 from tcfranks/main Updating https://github.com/adafruit/Adafruit_CircuitPython_asyncio to 0.5.17 from 0.5.16: > Merge pull request adafruit/Adafruit_CircuitPython_asyncio#30 from jepler/make-tests-pass Updating https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer to 0.5.2 from 0.5.1: > Merge pull request adafruit/Adafruit_CircuitPython_HTTPServer#15 from FoamyGuy/smaller_file_read_buffer Updating https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad to 1.16.7 from 1.16.6: > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#61 from deshipu/png Updating https://github.com/adafruit/Adafruit_CircuitPython_Ticks to 1.0.8 from 1.0.7: > Merge pull request adafruit/Adafruit_CircuitPython_Ticks#8 from adafruit/try-time-ticksms
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This set of changes, together with some other changes in the core and in adafruit_circuitpython_ticks, allow all the asyncio-related core tests to pass at build time (that is, with the ports/unix build).
Probably a good place to discuss this is
Micropython can use a non-standard construct of
yield
in anasync def
to cause the async function to be suspended indefinitely, until some other task causes it to be scheduled again.await sleep(0)
is equivalent, so an internal "_Never" class is introduced which can do this in a way that is syntactically valid in standard Python as well.When using the core implementation of Task & TaskGroup, there are Problems, so this PR disables that. Doing so might also fix the following issues in the core repo, but I didn't specifically test them:This Closes adafruit/circuitpython#6954 but adafruit/circuitpython#6706 is not fixed (a different core change will fix that one)