From 2dbcd760fc9e253d2f91904e2ff31d472f427697 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sun, 25 Sep 2022 04:53:54 +0200 Subject: [PATCH 1/4] usb_cdc.Serial.readinto has no nbytes parameter --- shared-bindings/usb_cdc/Serial.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shared-bindings/usb_cdc/Serial.c b/shared-bindings/usb_cdc/Serial.c index 8a74380be3..47e91b5721 100644 --- a/shared-bindings/usb_cdc/Serial.c +++ b/shared-bindings/usb_cdc/Serial.c @@ -54,11 +54,12 @@ //| ... //| //| def readinto(self, buf: WriteableBuffer) -> int: -//| """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most -//| that many bytes, subject to `timeout`. Otherwise, read at most ``len(buf)`` bytes. +//| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. If `timeout` +//| is > 0 or ``None``, keep waiting until the timeout expires or ``len(buf)`` +//| bytes are available. //| //| :return: number of bytes read and stored into ``buf`` -//| :rtype: bytes""" +//| :rtype: int""" //| ... //| //| def readline(self, size: int = -1) -> Optional[bytes]: From 5346b89b08400d84f895f723f23ea7fd98967cc6 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sun, 25 Sep 2022 07:18:18 +0200 Subject: [PATCH 2/4] don't use @property in docs, just document as a property --- ports/raspberrypi/bindings/rp2pio/StateMachine.c | 12 +++++------- shared-bindings/sdioio/SDCard.c | 14 +++++--------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index be87a47ec5..97668bf303 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -521,9 +521,8 @@ STATIC mp_obj_t rp2pio_statemachine_obj_stop_background_write(mp_obj_t self_in) } MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_stop_background_write_obj, rp2pio_statemachine_obj_stop_background_write); -//| @property -//| def writing(self) -> bool: -//| """Returns True if a background write is in progress""" +//| writing: bool +//| """Returns True if a background write is in progress""" //| STATIC mp_obj_t rp2pio_statemachine_obj_get_writing(mp_obj_t self_in) { rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -539,11 +538,10 @@ const mp_obj_property_t rp2pio_statemachine_writing_obj = { }; -//| @property -//| def pending(self) -> int: -//| """Returns the number of pending buffers for background writing. +//| pending: int +//| """Returns the number of pending buffers for background writing. //| -//| If the number is 0, then a `StateMachine.background_write` call will not block.""" +//| If the number is 0, then a `StateMachine.background_write` call will not block.""" //| STATIC mp_obj_t rp2pio_statemachine_obj_get_pending(mp_obj_t self_in) { rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index dbeb50ddf3..d3929c9372 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -201,11 +201,9 @@ STATIC mp_obj_t sdioio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_writeblocks_obj, sdioio_sdcard_writeblocks); -//| @property -//| def frequency(self) -> int: -//| """The actual SDIO bus frequency. This may not match the frequency -//| requested due to internal limitations.""" -//| ... +//| frequency: int +//| """The actual SDIO bus frequency. This may not match the frequency +//| requested due to internal limitations.""" //| STATIC mp_obj_t sdioio_sdcard_obj_get_frequency(mp_obj_t self_in) { sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -217,10 +215,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_get_frequency_obj, sdioio_sdcard_obj_get MP_PROPERTY_GETTER(sdioio_sdcard_frequency_obj, (mp_obj_t)&sdioio_sdcard_get_frequency_obj); -//| @property -//| def width(self) -> int: -//| """The actual SDIO bus width, in bits""" -//| ... +//| width:int +//| """The actual SDIO bus width, in bits""" //| STATIC mp_obj_t sdioio_sdcard_obj_get_width(mp_obj_t self_in) { sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); From 2c35e5e284c5bd2b180e787ec0adf4ff366accfd Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sun, 25 Sep 2022 16:10:11 +0200 Subject: [PATCH 3/4] avoid problematic sphinx version number for rtd theme --- requirements-doc.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-doc.txt b/requirements-doc.txt index 40ab2ad4ac..43e99fa32f 100644 --- a/requirements-doc.txt +++ b/requirements-doc.txt @@ -9,7 +9,7 @@ setuptools>=45 setuptools_scm # For sphinx -sphinx>=4.0.0 +sphinx!=5.2.0.post0 sphinx-autoapi sphinx-rtd-theme sphinxcontrib-svg2pdfconverter From 645cb6c2a591c49b9473b6fd182e5acd51b11a68 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 25 Sep 2022 12:22:50 -0500 Subject: [PATCH 4/4] pin python version for doc building --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84224a1c1a..02985212f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -220,7 +220,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v2 with: - python-version: "3.x" + python-version: "3.10.6" - name: Install dependencies run: | sudo apt-get update