Skip to content

Commit 139393f

Browse files
committed
compile: set default MPY ABI version to 5
This is what is required by the current Pybricks firmware.
1 parent 99b57dc commit 139393f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@
5959

6060
nitpicky = True
6161
nitpick_ignore = [
62+
# TODO: remove BT and USB after https://github.com/sphinx-doc/sphinx/commit/86091934db5ec593b4b0c982b7f08f3231ef995b is released
63+
("py:class", "BT"),
64+
("py:class", "USB"),
6265
("py:class", "abc.ABC"),
6366
("py:class", "bleak.backends.bluezdbus.client.BleakClientBlueZDBus"),
6467
("py:class", "bleak.backends.device.BLEDevice"),

pybricksdev/ble/pybricks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ def _standard_uuid(short: int) -> str:
174174
PNP_ID_UUID = _standard_uuid(0x2A50)
175175
"""Standard PnP ID UUID
176176
177-
Vendor ID is :data:`pybricks.ble.lwp3.LEGO_CID`. Product ID is one of
178-
:class:`pybricks.ble.lwp3.bytecodes.HubKind`. Revision is ``0`` for most
177+
Vendor ID is :const:`pybricksdev.ble.lwp3.LEGO_CID`. Product ID is one of
178+
:class:`pybricksdev.ble.lwp3.bytecodes.HubKind`. Revision is ``0`` for most
179179
hubs or ``1`` for MINDSTORMS Robot Inventor Hub.
180180
181181
.. availability:: Since Pybricks protocol v1.1.0.

pybricksdev/compile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def run_mpy_cross(args):
6767
return stdout.decode()
6868

6969

70-
async def compile_file(path, compile_args=["-mno-unicode"], mpy_version=None):
70+
async def compile_file(path, compile_args=["-mno-unicode"], mpy_version=5):
7171
"""Compiles a Python file with mpy-cross and return as bytes.
7272
7373
Arguments:
@@ -89,7 +89,7 @@ async def compile_file(path, compile_args=["-mno-unicode"], mpy_version=None):
8989
# Get version info
9090
out = await run_mpy_cross(["--version"])
9191
installed_mpy_version = int(out.strip()[-1])
92-
if mpy_version is not None and installed_mpy_version != mpy_version:
92+
if installed_mpy_version != mpy_version:
9393
raise ValueError(
9494
"Expected mpy-cross ABI v{0} but v{1} is installed.".format(
9595
mpy_version, installed_mpy_version

0 commit comments

Comments
 (0)