You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ah I ran into that error with the build action as well I think. I'm not sure what the specific syntax that is the culprit but I think something about that line is valid only in py3.12+. I updated the version used by the build action last week, but didn't think about about other actions that might try to parse the code. The library screenshot action will need to be updated as well, I'll submit a PR for that tomorrow.
yes, this syntax is accepted in Python 3.13 but not earlier versions, and no version of CircuitPython.
The library sources themselves are checked for circuitpython syntax compatibility when the CI runs mpy-cross on them; I wonder if there's a possibility to run mpy-cross on examples too---not to ship the resulting files, but instead to check that they are considered valid circuitpython syntax as well.
fwiw now that I'm on a laptop here's the actual error:
File "/home/runner/work/Adafruit_CircuitPython_Bundle/Adafruit_CircuitPython_Bundle/CircuitPython_Library_Screenshot_Maker/create_requirement_images.py", line 525, in bundle
for _ in pool.imap(generate_example_requirement_image, paths):
File "/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/multiprocessing/pool.py", line 873, in next
raise value
File "libraries/helpers/usb_host_mouse/examples/usb_host_mouse_simpletest.py", line 50
out_str += f" {" ".join(pressed_btns)}"
^
SyntaxError: f-string: expecting '}'
I will double check, but I believe the code ran on a circuitpython device without issue. That was why I ended up changing the version of python in use by the actions instead of changing the code to use different formatting syntax at the time.
Activity
FoamyGuy commentedon May 11, 2025
Ah I ran into that error with the build action as well I think. I'm not sure what the specific syntax that is the culprit but I think something about that line is valid only in py3.12+. I updated the version used by the build action last week, but didn't think about about other actions that might try to parse the code. The library screenshot action will need to be updated as well, I'll submit a PR for that tomorrow.
jepler commentedon May 12, 2025
yes, this syntax is accepted in Python 3.13 but not earlier versions, and no version of CircuitPython.
The library sources themselves are checked for circuitpython syntax compatibility when the CI runs mpy-cross on them; I wonder if there's a possibility to run mpy-cross on examples too---not to ship the resulting files, but instead to check that they are considered valid circuitpython syntax as well.
Another option is enhancing ruff config with target-version, except that it's a bit murky which standard python version best corresponds with circuitpython: https://docs.astral.sh/ruff/settings/#target-version https://docs.astral.sh/ruff/configuration/#inferring-the-python-version
fwiw now that I'm on a laptop here's the actual error:
FoamyGuy commentedon May 12, 2025
I will double check, but I believe the code ran on a circuitpython device without issue. That was why I ended up changing the version of python in use by the actions instead of changing the code to use different formatting syntax at the time.
jepler commentedon May 12, 2025
OK, I stand corrected. I didn't think this worked in CircuitPython! but you are correct.
maybe the bundle job should be bumped to run on a newer python than 3.13 then