Skip to content

Conversation

@dlech
Copy link
Member

@dlech dlech commented Jan 18, 2025

Main purpose is fixing pybricksdev run ble - (piping python file from stdin) which regressed due to a change in v1.0.0-alpha.49.

Cleaned up and fixed some other stuff along the way.

dlech added 8 commits January 18, 2025 17:27
Change imports from relative to absolute. Quick fix tools in the IDE
will automatically generate absolute imports so if we stick with that
we can use the tools without having to manually fix the imports. Also
absolute imports can be easier to understand if you don't know the
folder structure by heart.
Fix failing on newer versions of Python which are more strict about
empty enums.

Fixes the following error:

    TypeError: <flag 'IODeviceCapabilities'> has no members; specify `names=()` if you meant to create a new, empty, enum
The recommended way to handle this is to have an empty names attribute
rather than having a fake member.
It appears that Python has changed how repr works for enums in some
cases. This fixes tests that were failing on Python 3.12.
mpy-cross saves the file path as part of the binary file. To keep things
small and not leak host computer details, we want to only include the
portion of the path that is relative to the project directory.

Previously, this could only be done by changing the current working
directory to the project directory before calling compile_file(). Now,
that is no longer necessary and the project directory is passed as a
separate argument.

This fixes not being able to compile files piped from stdin when using
the cli tool.
Fix warnings about moved imports in cryptography dependency.
Fix failing on Python 3.13.
These were scattered about and repeated or hard-coded in various places.
@dlech dlech merged commit bae50f7 into pybricks:master Jan 18, 2025
7 checks passed
@dlech dlech deleted the absolute-imports branch January 18, 2025 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant