diff --git a/.readthedocs.yml b/.readthedocs.yml index 770888b79e..9743a70494 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -11,7 +11,7 @@ version: 2 build: os: ubuntu-20.04 tools: - python: "3.9" + python: "3" submodules: include: @@ -22,4 +22,4 @@ formats: python: install: - - requirements: docs/requirements.txt + - requirements: requirements-doc.txt diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index aa3be74265..0000000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -sphinx<4 -myst-parser==0.14.0 -sphinxcontrib-svg2pdfconverter==0.1.0 -astroid -sphinx-autoapi -isort -black -readthedocs-sphinx-search diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index 0815112c3d..3b2724711f 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -354,7 +354,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_stop_obj, rp2pio_statemachine_stop //| def write(self, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None) -> None: //| """Write the data contained in ``buffer`` to the state machine. If the buffer is empty, nothing happens. //| -//| :param ~_typing.ReadableBuffer buffer: Write out the data in this buffer +//| :param ~circuitpython_typing.ReadableBuffer buffer: Write out the data in this buffer //| :param int start: Start of the slice of ``buffer`` to write out: ``buffer[start:end]`` //| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``""" //| ... @@ -402,7 +402,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_obj, 2, rp2pio_statemachine //| """Read into ``buffer``. If the number of bytes to read is 0, nothing happens. The buffer //| include any data added to the fifo even if it was added before this was called. //| -//| :param ~_typing.WriteableBuffer buffer: Read data into this buffer +//| :param ~circuitpython_typing.WriteableBuffer buffer: Read data into this buffer //| :param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]`` //| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``""" //| ... @@ -450,8 +450,8 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_readinto_obj, 2, rp2pio_statemach //| may be different. The function will return once both are filled. //| If buffer slice lengths are both 0, nothing happens. //| -//| :param ~_typing.ReadableBuffer buffer_out: Write out the data in this buffer -//| :param ~_typing.WriteableBuffer buffer_in: Read data into this buffer +//| :param ~circuitpython_typing.ReadableBuffer buffer_out: Write out the data in this buffer +//| :param ~circuitpython_typing.WriteableBuffer buffer_in: Read data into this buffer //| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` //| :param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` //| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` diff --git a/requirements-doc.txt b/requirements-doc.txt index cefd7dc51d..efdf19784e 100644 --- a/requirements-doc.txt +++ b/requirements-doc.txt @@ -8,7 +8,7 @@ astroid setuptools # For sphinx -Sphinx<4 +sphinx>=4.0.0 sphinx-autoapi sphinx-rtd-theme sphinxcontrib-svg2pdfconverter diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index d985b0aecd..baff277b69 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -196,8 +196,8 @@ const mp_obj_property_t bleio_adapter_name_obj = { //| .. note:: If you set ``anonymous=True``, then a timeout must be specified. If no timeout is //| specified, then the maximum allowed timeout will be selected automatically. //| -//| :param ~_typing.ReadableBuffer data: advertising data packet bytes -//| :param ~_typing.ReadableBuffer scan_response: scan response data packet bytes. ``None`` if no scan response is needed. +//| :param ~circuitpython_typing.ReadableBuffer data: advertising data packet bytes +//| :param ~circuitpython_typing.ReadableBuffer scan_response: scan response data packet bytes. ``None`` if no scan response is needed. //| :param bool connectable: If `True` then other devices are allowed to connect to this peripheral. //| :param bool anonymous: If `True` then this device's MAC address is randomized before advertising. //| :param int timeout: If set, we will only advertise for this many seconds. Zero means no timeout. @@ -282,7 +282,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_advertising_obj, bleio_adapt //| """Starts a BLE scan and returns an iterator of results. Advertisements and scan responses are //| filtered and returned separately. //| -//| :param ~_typing.ReadableBuffer prefixes: Sequence of byte string prefixes to filter advertising packets +//| :param ~circuitpython_typing.ReadableBuffer prefixes: Sequence of byte string prefixes to filter advertising packets //| with. A packet without an advertising structure that matches one of the prefixes is //| ignored. Format is one byte for length (n) and n bytes of prefix and can be repeated. //| :param int buffer_size: the maximum number of advertising bytes to buffer. diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index 93345d95b0..97322bbb79 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -42,7 +42,7 @@ //| """Create a new Address object encapsulating the address value. //| The value itself can be one of: //| -//| :param ~_typing.ReadableBuffer address: The address value to encapsulate. A buffer object (bytearray, bytes) of 6 bytes. +//| :param ~circuitpython_typing.ReadableBuffer address: The address value to encapsulate. A buffer object (bytearray, bytes) of 6 bytes. //| :param int address_type: one of the integer values: `PUBLIC`, `RANDOM_STATIC`, //| `RANDOM_PRIVATE_RESOLVABLE`, or `RANDOM_PRIVATE_NON_RESOLVABLE`.""" //| ... diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index 3744c610c7..f4c77405d1 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -67,7 +67,7 @@ //| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum //| number of data bytes that fit in a single BLE 4.x ATT packet. //| :param bool fixed_length: True if the characteristic value is of fixed length. -//| :param ~_typing.ReadableBuffer initial_value: The initial value for this characteristic. If not given, will be +//| :param ~circuitpython_typing.ReadableBuffer initial_value: The initial value for this characteristic. If not given, will be //| filled with zeros. //| :param str user_description: User friendly description of the characteristic //| diff --git a/shared-bindings/_bleio/Descriptor.c b/shared-bindings/_bleio/Descriptor.c index 5a29575ba0..d4dd9372f3 100644 --- a/shared-bindings/_bleio/Descriptor.c +++ b/shared-bindings/_bleio/Descriptor.c @@ -61,7 +61,7 @@ //| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum //| number of data bytes that fit in a single BLE 4.x ATT packet. //| :param bool fixed_length: True if the descriptor value is of fixed length. -//| :param ~_typing.ReadableBuffer initial_value: The initial value for this descriptor. +//| :param ~circuitpython_typing.ReadableBuffer initial_value: The initial value for this descriptor. //| //| :return: the new Descriptor.""" //| ... diff --git a/shared-bindings/_bleio/UUID.c b/shared-bindings/_bleio/UUID.c index 028d21d9d5..4e3154eb03 100644 --- a/shared-bindings/_bleio/UUID.c +++ b/shared-bindings/_bleio/UUID.c @@ -48,7 +48,7 @@ //| temporary 16-bit UUID that can be used in place of the full 128-bit UUID. //| //| :param value: The uuid value to encapsulate -//| :type value: int, ~_typing.ReadableBuffer or str""" +//| :type value: int, ~circuitpython_typing.ReadableBuffer or str""" //| ... //| STATIC mp_obj_t bleio_uuid_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { diff --git a/shared-bindings/_eve/__init__.c b/shared-bindings/_eve/__init__.c index 69300e47e4..13e51cb882 100644 --- a/shared-bindings/_eve/__init__.c +++ b/shared-bindings/_eve/__init__.c @@ -79,7 +79,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(flush_obj, _flush); //| def cc(self, b: ReadableBuffer) -> None: //| """Append bytes to the command FIFO. //| -//| :param ~_typing.ReadableBuffer b: The bytes to add""" +//| :param ~circuitpython_typing.ReadableBuffer b: The bytes to add""" //| ... //| STATIC mp_obj_t _cc(mp_obj_t self, mp_obj_t b) { diff --git a/shared-bindings/_stage/Layer.c b/shared-bindings/_stage/Layer.c index a040ee9ab0..c3c0aa1801 100644 --- a/shared-bindings/_stage/Layer.c +++ b/shared-bindings/_stage/Layer.c @@ -40,9 +40,9 @@ //| //| :param int width: The width of the grid in tiles, or 1 for sprites. //| :param int height: The height of the grid in tiles, or 1 for sprites. -//| :param ~_typing.ReadableBuffer graphic: The graphic data of the tiles. -//| :param ~_typing.ReadableBuffer palette: The color palette to be used. -//| :param ~_typing.ReadableBuffer grid: The contents of the grid map. +//| :param ~circuitpython_typing.ReadableBuffer graphic: The graphic data of the tiles. +//| :param ~circuitpython_typing.ReadableBuffer palette: The color palette to be used. +//| :param ~circuitpython_typing.ReadableBuffer grid: The contents of the grid map. //| //| This class is intended for internal use in the ``stage`` library and //| it shouldn't be used on its own.""" diff --git a/shared-bindings/_stage/Text.c b/shared-bindings/_stage/Text.c index b57f4f0b6a..d6b22171d6 100644 --- a/shared-bindings/_stage/Text.c +++ b/shared-bindings/_stage/Text.c @@ -40,9 +40,9 @@ //| //| :param int width: The width of the grid in tiles, or 1 for sprites. //| :param int height: The height of the grid in tiles, or 1 for sprites. -//| :param ~_typing.ReadableBuffer font: The font data of the characters. -//| :param ~_typing.ReadableBuffer palette: The color palette to be used. -//| :param ~_typing.ReadableBuffer chars: The contents of the character grid. +//| :param ~circuitpython_typing.ReadableBuffer font: The font data of the characters. +//| :param ~circuitpython_typing.ReadableBuffer palette: The color palette to be used. +//| :param ~circuitpython_typing.ReadableBuffer chars: The contents of the character grid. //| //| This class is intended for internal use in the ``stage`` library and //| it shouldn't be used on its own.""" diff --git a/shared-bindings/_stage/__init__.c b/shared-bindings/_stage/__init__.c index 4dfcc796e7..ebaa06898e 100644 --- a/shared-bindings/_stage/__init__.c +++ b/shared-bindings/_stage/__init__.c @@ -48,7 +48,7 @@ //| :param int y1: Bottom edge of the fragment. //| :param layers: A list of the :py:class:`~_stage.Layer` objects. //| :type layers: list[Layer] -//| :param ~_typing.WriteableBuffer buffer: A buffer to use for rendering. +//| :param ~circuitpython_typing.WriteableBuffer buffer: A buffer to use for rendering. //| :param ~displayio.Display display: The display to use. //| :param int scale: How many times should the image be scaled up. //| :param int background: What color to display when nothing is there. diff --git a/shared-bindings/adafruit_pixelbuf/PixelBuf.c b/shared-bindings/adafruit_pixelbuf/PixelBuf.c index db9f1c01a8..7be059fa6b 100644 --- a/shared-bindings/adafruit_pixelbuf/PixelBuf.c +++ b/shared-bindings/adafruit_pixelbuf/PixelBuf.c @@ -64,8 +64,8 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t //| :param str byteorder: Byte order string (such as "RGB", "RGBW" or "PBGR") //| :param float brightness: Brightness (0 to 1.0, default 1.0) //| :param bool auto_write: Whether to automatically write pixels (Default False) -//| :param ~_typing.ReadableBuffer header: Sequence of bytes to always send before pixel values. -//| :param ~_typing.ReadableBuffer trailer: Sequence of bytes to always send after pixel values.""" +//| :param ~circuitpython_typing.ReadableBuffer header: Sequence of bytes to always send before pixel values. +//| :param ~circuitpython_typing.ReadableBuffer trailer: Sequence of bytes to always send after pixel values.""" //| ... //| STATIC mp_obj_t pixelbuf_pixelbuf_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c index 232f4bede8..4acadc5ab6 100644 --- a/shared-bindings/aesio/aes.c +++ b/shared-bindings/aesio/aes.c @@ -19,10 +19,10 @@ //| def __init__(self, key: ReadableBuffer, mode: int = 0, iv: Optional[ReadableBuffer] = None, segment_size: int = 8) -> None: //| """Create a new AES state with the given key. //| -//| :param ~_typing.ReadableBuffer key: A 16-, 24-, or 32-byte key +//| :param ~circuitpython_typing.ReadableBuffer key: A 16-, 24-, or 32-byte key //| :param int mode: AES mode to use. One of: `MODE_ECB`, `MODE_CBC`, or //| `MODE_CTR` -//| :param ~_typing.ReadableBuffer iv: Initialization vector to use for CBC or CTR mode +//| :param ~circuitpython_typing.ReadableBuffer iv: Initialization vector to use for CBC or CTR mode //| //| Additional arguments are supported for legacy reasons. //| diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index c343df242c..c9910427f3 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -155,7 +155,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *ar STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_i2sout___exit___obj, 4, 4, audiobusio_i2sout_obj___exit__); -//| def play(self, sample: _typing.AudioSample, *, loop: bool = False) -> None: +//| def play(self, sample: circuitpython_typing.AudioSample, *, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index c3af2f30f0..05c5b14b5e 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -43,7 +43,7 @@ //| first sample will be for channel 1, the second sample will be for channel two, the third for //| channel 1 and so on. //| -//| :param ~_typing.ReadableBuffer buffer: A buffer with samples +//| :param ~circuitpython_typing.ReadableBuffer buffer: A buffer with samples //| :param int channel_count: The number of channels in the buffer //| :param int sample_rate: The desired playback sample rate //| diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index 74ea9fda9f..1a8b5cae11 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -44,7 +44,7 @@ //| """Load a .wav file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| //| :param typing.BinaryIO file: Already opened wave file -//| :param ~_typing.WriteableBuffer buffer: Optional pre-allocated buffer, +//| :param ~circuitpython_typing.WriteableBuffer buffer: Optional pre-allocated buffer, //| that will be split in half and used for double-buffering of the data. //| The buffer must be 8 to 1024 bytes long. //| If not provided, two 256 byte buffers are initially allocated internally. diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index 80072e9128..2fd4c0c452 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -146,7 +146,7 @@ STATIC mp_obj_t audioio_audioout_obj___exit__(size_t n_args, const mp_obj_t *arg STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_audioout___exit___obj, 4, 4, audioio_audioout_obj___exit__); -//| def play(self, sample: _typing.AudioSample, *, loop: bool = False) -> None: +//| def play(self, sample: circuitpython_typing.AudioSample, *, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index 619e2c095c..3248e649c9 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -211,7 +211,7 @@ const mp_obj_property_t audiomixer_mixer_voice_obj = { MP_ROM_NONE}, }; -//| def play(self, sample: _typing.AudioSample, *, voice: int = 0, loop: bool = False) -> None: +//| def play(self, sample: circuitpython_typing.AudioSample, *, voice: int = 0, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c index d3bac8c3de..82b6972864 100644 --- a/shared-bindings/audiomixer/MixerVoice.c +++ b/shared-bindings/audiomixer/MixerVoice.c @@ -57,7 +57,7 @@ STATIC mp_obj_t audiomixer_mixervoice_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(self); } -//| def play(self, sample: _typing.AudioSample, *, loop: bool = False) -> None: +//| def play(self, sample: circuitpython_typing.AudioSample, *, loop: bool = False) -> None: //| """Plays the sample once when ``loop=False``, and continuously when ``loop=True``. //| Does not block. Use `playing` to block. //| diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index 589751821d..227cb6dec1 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -42,7 +42,7 @@ //| """Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| //| :param typing.BinaryIO file: Already opened mp3 file -//| :param ~_typing.WriteableBuffer buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file. +//| :param ~circuitpython_typing.WriteableBuffer buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file. //| //| //| Playing a mp3 file from flash:: diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index cded4a634f..85332d0fac 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -148,7 +148,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj___exit__(size_t n_args, const mp_obj_ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiopwmio_pwmaudioout___exit___obj, 4, 4, audiopwmio_pwmaudioout_obj___exit__); -//| def play(self, sample: _typing.AudioSample, *, loop: bool = False) -> None: +//| def play(self, sample: circuitpython_typing.AudioSample, *, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index b47ace149f..c65b184ca0 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -292,8 +292,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_wr //| The number of bytes read will be the length of ``out_buffer[in_start:in_end]``. //| :param int address: 7-bit device address -//| :param ~_typing.ReadableBuffer out_buffer: buffer containing the bytes to write -//| :param ~_typing.WriteableBuffer in_buffer: buffer to write into +//| :param ~circuitpython_typing.ReadableBuffer out_buffer: buffer containing the bytes to write +//| :param ~circuitpython_typing.WriteableBuffer in_buffer: buffer to write into //| :param int out_start: beginning of ``out_buffer`` slice //| :param int out_end: end of ``out_buffer`` slice; if not specified, use ``len(out_buffer)`` //| :param int in_start: beginning of ``in_buffer`` slice diff --git a/shared-bindings/bitmaptools/__init__.c b/shared-bindings/bitmaptools/__init__.c index ec26eab98e..df6292afec 100644 --- a/shared-bindings/bitmaptools/__init__.c +++ b/shared-bindings/bitmaptools/__init__.c @@ -255,7 +255,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_rotozoom_obj, 0, bitmaptools_obj_rotozoom // requires at least 2 arguments (destination bitmap and source bitmap) //| -//| def alphablend(dest_bitmap, source_bitmap_1, source_bitmap_2, colorspace: displayio.Colorspace, factor1: float=.5, factor2: float=None): +//| def alphablend(dest_bitmap: displayio.Bitmap , source_bitmap_1: displayio.Bitmap, source_bitmap_2: displayio.Bitmap, colorspace: displayio.Colorspace, factor1: float=.5, factor2: float=None) -> None: //| """Alpha blend the two source bitmaps into the destination. //| //| It is permitted for the destination bitmap to be one of the two diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 4aea62a8a5..19b205e4ca 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -299,8 +299,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); //| The number of bytes read will be the length of ``out_buffer[in_start:in_end]``. //| :param int address: 7-bit device address -//| :param ~_typing.ReadableBuffer out_buffer: buffer containing the bytes to write -//| :param ~_typing.WriteableBuffer in_buffer: buffer to write into +//| :param ~circuitpython_typing.ReadableBuffer out_buffer: buffer containing the bytes to write +//| :param ~circuitpython_typing.WriteableBuffer in_buffer: buffer to write into //| :param int out_start: beginning of ``out_buffer`` slice //| :param int out_end: end of ``out_buffer`` slice; if not specified, use ``len(out_buffer)`` //| :param int in_start: beginning of ``in_buffer`` slice diff --git a/shared-bindings/_typing/__init__.pyi b/shared-bindings/circuitpython_typing/__init__.pyi similarity index 100% rename from shared-bindings/_typing/__init__.pyi rename to shared-bindings/circuitpython_typing/__init__.pyi diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index ca98f9339c..1b750eb934 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -84,7 +84,7 @@ //| //| :param display_bus: The bus that the display is connected to //| :type _DisplayBus: FourWire, ParallelBus or I2CDisplay -//| :param ~_typing.ReadableBuffer init_sequence: Byte-packed initialization sequence. +//| :param ~circuitpython_typing.ReadableBuffer init_sequence: Byte-packed initialization sequence. //| :param int width: Width in pixels //| :param int height: Height in pixels //| :param int colstart: The index if the first visible column @@ -449,7 +449,7 @@ const mp_obj_property_t displayio_display_bus_obj = { //| """Extract the pixels from a single row //| //| :param int y: The top edge of the area -//| :param ~_typing.WriteableBuffer buffer: The buffer in which to place the pixel data""" +//| :param ~circuitpython_typing.WriteableBuffer buffer: The buffer in which to place the pixel data""" //| ... //| STATIC mp_obj_t displayio_display_obj_fill_row(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 06245c90ae..64f7031f4d 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -76,8 +76,8 @@ //| //| :param display_bus: The bus that the display is connected to //| :type _DisplayBus: displayio.FourWire or paralleldisplay.ParallelBus -//| :param ~_typing.ReadableBuffer start_sequence: Byte-packed initialization sequence. -//| :param ~_typing.ReadableBuffer stop_sequence: Byte-packed initialization sequence. +//| :param ~circuitpython_typing.ReadableBuffer start_sequence: Byte-packed initialization sequence. +//| :param ~circuitpython_typing.ReadableBuffer stop_sequence: Byte-packed initialization sequence. //| :param int width: Width in pixels //| :param int height: Height in pixels //| :param int ram_width: RAM width in pixels diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 683e512b3e..acc50d7561 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -47,10 +47,10 @@ //| objects in CircuitPython, Display objects live until `displayio.release_displays()` //| is called. This is done so that CircuitPython can use the display itself.""" //| -//| def __init__(self, framebuffer: _typing.FrameBuffer, *, rotation: int = 0, auto_refresh: bool = True) -> None: +//| def __init__(self, framebuffer: circuitpython_typing.FrameBuffer, *, rotation: int = 0, auto_refresh: bool = True) -> None: //| """Create a Display object with the given framebuffer (a buffer, array, ulab.array, etc) //| -//| :param ~_typing.FrameBuffer framebuffer: The framebuffer that the display is connected to +//| :param ~circuitpython_typing.FrameBuffer framebuffer: The framebuffer that the display is connected to //| :param bool auto_refresh: Automatically refresh the screen //| :param int rotation: The rotation of the display in degrees clockwise. Must be in 90 degree increments (0, 90, 180, 270)""" //| ... @@ -298,7 +298,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_rotation_obj = { MP_ROM_NONE}, }; -//| framebuffer: _typing.FrameBuffer +//| framebuffer: circuitpython_typing.FrameBuffer //| """The framebuffer being used by the display""" //| //| @@ -320,7 +320,7 @@ const mp_obj_property_t framebufferio_framebufferframebuffer_obj = { //| """Extract the pixels from a single row //| //| :param int y: The top edge of the area -//| :param ~_typing.WriteableBuffer buffer: The buffer in which to place the pixel data""" +//| :param ~circuitpython_typing.WriteableBuffer buffer: The buffer in which to place the pixel data""" //| ... //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_fill_row(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { diff --git a/shared-bindings/i2cperipheral/I2CPeripheral.c b/shared-bindings/i2cperipheral/I2CPeripheral.c index f697646146..b63e8a891b 100644 --- a/shared-bindings/i2cperipheral/I2CPeripheral.c +++ b/shared-bindings/i2cperipheral/I2CPeripheral.c @@ -353,7 +353,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_read_obj, 1, i2c //| def write(self, buffer: ReadableBuffer) -> int: //| """Write the data contained in buffer. //| -//| :param ~_typing.ReadableBuffer buffer: Write out the data in this buffer +//| :param ~circuitpython_typing.ReadableBuffer buffer: Write out the data in this buffer //| :return: Number of bytes written""" //| ... //| diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index d71ab9a6b9..149f0343a0 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -87,8 +87,8 @@ //| """Ouput object to buffer in msgpack format. //| //| :param object obj: Object to convert to msgpack format. -//| :param ~_typing.WriteableBuffer buffer: buffer to write into -//| :param Optional[~_typing.Callable[[object], None]] default: +//| :param ~circuitpython_typing.WriteableBuffer buffer: buffer to write into +//| :param Optional[~circuitpython_typing.Callable[[object], None]] default: //| function called for python objects that do not have //| a representation in msgpack format. //| """ @@ -118,8 +118,8 @@ MP_DEFINE_CONST_FUN_OBJ_KW(mod_msgpack_pack_obj, 0, mod_msgpack_pack); //| def unpack(buffer: ReadableBuffer, *, ext_hook: Union[Callable[[int, bytes], object], None] = None, use_list: bool=True) -> object: //| """Unpack and return one object from buffer. //| -//| :param ~_typing.ReadableBuffer buffer: buffer to read from -//| :param Optional[~_typing.Callable[[int, bytes], object]] ext_hook: function called for objects in +//| :param ~circuitpython_typing.ReadableBuffer buffer: buffer to read from +//| :param Optional[~circuitpython_typing.Callable[[int, bytes], object]] ext_hook: function called for objects in //| msgpack ext format. //| :param Optional[bool] use_list: return array as list or tuple (use_list=False). //| diff --git a/shared-bindings/neopixel_write/__init__.c b/shared-bindings/neopixel_write/__init__.c index ae30518bd1..6895813db5 100644 --- a/shared-bindings/neopixel_write/__init__.c +++ b/shared-bindings/neopixel_write/__init__.c @@ -54,7 +54,7 @@ //| """Write buf out on the given DigitalInOut. //| //| :param ~digitalio.DigitalInOut digitalinout: the DigitalInOut to output with -//| :param ~_typing.ReadableBuffer buf: The bytes to clock out. No assumption is made about color order""" +//| :param ~circuitpython_typing.ReadableBuffer buf: The bytes to clock out. No assumption is made about color order""" //| ... STATIC mp_obj_t neopixel_write_neopixel_write_(mp_obj_t digitalinout_obj, mp_obj_t buf) { if (!mp_obj_is_type(digitalinout_obj, &digitalio_digitalinout_type)) { diff --git a/shared-bindings/sdcardio/SDCard.c b/shared-bindings/sdcardio/SDCard.c index fe487ae7fb..5afca798f6 100644 --- a/shared-bindings/sdcardio/SDCard.c +++ b/shared-bindings/sdcardio/SDCard.c @@ -130,7 +130,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_deinit_obj, sdcardio_sdcard_deinit); //| """Read one or more blocks from the card //| //| :param int start_block: The block to start reading from -//| :param ~_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512. +//| :param ~circuitpython_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512. //| //| :return: None""" //| @@ -171,7 +171,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_sync_obj, sdcardio_sdcard_sync); //| """Write one or more blocks to the card //| //| :param int start_block: The block to start writing from -//| :param ~_typing.ReadableBuffer buf: The buffer to read from. Length must be multiple of 512. +//| :param ~circuitpython_typing.ReadableBuffer buf: The buffer to read from. Length must be multiple of 512. //| //| :return: None""" //| diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index 6fd38ce24c..c4b23ea594 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -165,7 +165,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_count_obj, sdioio_sdcard_count); //| """Read one or more blocks from the card //| //| :param int start_block: The block to start reading from -//| :param ~_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512. +//| :param ~circuitpython_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512. //| //| :return: None""" STATIC mp_obj_t sdioio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { @@ -187,7 +187,7 @@ MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_readblocks_obj, sdioio_sdcard_readblocks //| """Write one or more blocks to the card //| //| :param int start_block: The block to start writing from -//| :param ~_typing.ReadableBuffer buf: The buffer to read from. Length must be multiple of 512. +//| :param ~circuitpython_typing.ReadableBuffer buf: The buffer to read from. Length must be multiple of 512. //| //| :return: None""" //| diff --git a/shared-bindings/synthio/MidiTrack.c b/shared-bindings/synthio/MidiTrack.c index 6ffefd4713..1fb3fdbec1 100644 --- a/shared-bindings/synthio/MidiTrack.c +++ b/shared-bindings/synthio/MidiTrack.c @@ -42,7 +42,7 @@ //| are supported; channel numbers and key velocities are ignored. Up to two notes may be on at the //| same time. //| -//| :param ~_typing.ReadableBuffer buffer: Stream of MIDI events, as stored in a MIDI file track chunk +//| :param ~circuitpython_typing.ReadableBuffer buffer: Stream of MIDI events, as stored in a MIDI file track chunk //| :param int tempo: Tempo of the streamed events, in MIDI ticks per second //| :param int sample_rate: The desired playback sample rate; higher sample rate requires more memory //| diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index 1bd51ca7a8..d35e09a2e0 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -244,7 +244,7 @@ def convert_folder(top_level, stub_directory): if imports["typing"]: import_lines.append("from typing import " + ", ".join(imports["typing"])) if imports["cpy_typing"]: - import_lines.append("from _typing import " + ", ".join(imports["cpy_typing"])) + import_lines.append("from circuitpython_typing import " + ", ".join(imports["cpy_typing"])) import_lines.extend(f"import {m}" for m in imports["modules"]) import_body = "\n".join(import_lines) m = re.match(r'(\s*""".*?""")', stub_contents, flags=re.DOTALL)