From 3ec8b9a77c598104d5caf02e0b6e45d9f5d139dd Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 24 Sep 2025 11:17:51 +1000 Subject: [PATCH] all: Replace legacy name with MicroPython and MPy as applicable. With the aim of getting consistency, and removing the need to learn an additional term, replace uses of uPy/uPython with MPy/MicroPython. Rule of thumb was to use "MPy" abbreviation where "CPy" is used nearby, but the full word MicroPython otherwise. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton --- docs/pyboard/tutorial/lcd_skin.rst | 4 ++-- docs/reference/asm_thumb2_index.rst | 2 +- extmod/asyncio/core.py | 2 +- extmod/modtls_mbedtls.c | 2 +- extmod/vfs.c | 2 +- ports/esp32/machine_hw_spi.c | 8 ++++---- ports/webassembly/asyncio/core.py | 2 +- ports/windows/msvc/paths.props | 2 +- py/gc.c | 2 +- py/mpconfig.h | 2 +- py/objexcept.c | 2 +- py/objstr.c | 2 +- tests/basics/async_await2.py | 2 +- tests/basics/async_for2.py | 2 +- tests/basics/async_with2.py | 2 +- tests/basics/boundmeth1.py | 2 +- tests/basics/builtin_range.py | 2 +- tests/basics/builtin_setattr.py | 2 +- tests/basics/class_bind_self.py | 2 +- tests/basics/del_attr.py | 2 +- tests/basics/del_global.py | 2 +- tests/basics/del_name.py | 2 +- tests/basics/frozenset_set.py | 2 +- tests/basics/fun_name.py | 2 +- tests/basics/gc1.py | 4 ++-- tests/basics/io_iobase.py | 2 +- tests/basics/list_pop.py | 2 +- tests/basics/module2.py | 2 +- tests/basics/parser.py | 2 +- tests/basics/python34.py | 2 +- tests/basics/syntaxerror.py | 4 ++-- tests/basics/sys_tracebacklimit.py | 2 +- tests/basics/tuple1.py | 2 +- tests/cpydiff/modules_struct_fewargs.py | 2 +- tests/cpydiff/modules_struct_manyargs.py | 2 +- .../modules_struct_whitespace_in_format.py | 2 +- .../cpydiff/types_float_implicit_conversion.py | 2 +- tests/extmod/asyncio_set_exception_handler.py | 2 +- tests/extmod/hashlib_md5.py | 3 +-- tests/extmod/hashlib_sha1.py | 3 +-- tests/extmod/hashlib_sha256.py | 3 +-- tests/extmod/json_dump.py | 4 ++-- tests/extmod/json_dump_iobase.py | 2 +- tests/extmod/json_dump_separators.py | 6 +++--- tests/extmod/json_dumps_extra.py | 2 +- tests/extmod/json_dumps_separators.py | 2 +- tests/extmod/re_error.py | 2 +- tests/extmod/re_sub.py | 2 +- tests/float/string_format2.py | 4 ++-- tests/float/string_format_modulo.py | 2 +- tests/frozen/frozentest.mpy | Bin 196 -> 201 bytes tests/frozen/frozentest.py | 2 +- tests/io/builtin_print_file.py | 2 +- tests/io/file_seek.py | 2 +- tests/micropython/decorator_error.py | 2 +- tests/micropython/heapalloc_traceback.py | 2 +- tests/misc/non_compliant.py | 6 +++--- tests/misc/non_compliant_lexer.py | 2 +- tests/misc/print_exception.py | 6 +++--- tests/ports/unix/extra_coverage.py | 2 +- tests/ports/unix/extra_coverage.py.exp | 2 +- 61 files changed, 74 insertions(+), 77 deletions(-) diff --git a/docs/pyboard/tutorial/lcd_skin.rst b/docs/pyboard/tutorial/lcd_skin.rst index 4df0041607..9d0ff473e2 100644 --- a/docs/pyboard/tutorial/lcd_skin.rst +++ b/docs/pyboard/tutorial/lcd_skin.rst @@ -29,7 +29,7 @@ Make sure the LCD skin is attached to the pyboard as pictured at the top of this >>> import pyb >>> lcd = pyb.LCD('X') >>> lcd.light(True) - >>> lcd.write('Hello uPy!\n') + >>> lcd.write('Hello MPy!\n') You can make a simple animation using the code:: @@ -38,7 +38,7 @@ You can make a simple animation using the code:: lcd.light(True) for x in range(-80, 128): lcd.fill(0) - lcd.text('Hello uPy!', x, 10, 1) + lcd.text('Hello MPy!', x, 10, 1) lcd.show() pyb.delay(25) diff --git a/docs/reference/asm_thumb2_index.rst b/docs/reference/asm_thumb2_index.rst index ccf0201489..97b3a8687e 100644 --- a/docs/reference/asm_thumb2_index.rst +++ b/docs/reference/asm_thumb2_index.rst @@ -63,7 +63,7 @@ References - :ref:`Assembler Tutorial ` - `Wiki hints and tips `__ -- `uPy Inline Assembler source-code, +- `MicroPython Inline Assembler source-code, emitinlinethumb.c `__ - `ARM Thumb2 Instruction Set Quick Reference Card `__ diff --git a/extmod/asyncio/core.py b/extmod/asyncio/core.py index 5d46b4b80e..7b70b43bce 100644 --- a/extmod/asyncio/core.py +++ b/extmod/asyncio/core.py @@ -50,7 +50,7 @@ class SingletonGenerator: raise self.exc -# Pause task execution for the given time (integer in milliseconds, uPy extension) +# Pause task execution for the given time (integer in milliseconds, MicroPython extension) # Use a SingletonGenerator to do it without allocating on the heap def sleep_ms(t, sgen=SingletonGenerator()): assert sgen.state is None diff --git a/extmod/modtls_mbedtls.c b/extmod/modtls_mbedtls.c index 5863425732..e2f7254f79 100644 --- a/extmod/modtls_mbedtls.c +++ b/extmod/modtls_mbedtls.c @@ -304,7 +304,7 @@ static mp_obj_t ssl_context_make_new(const mp_obj_type_t *type_in, size_t n_args psa_crypto_init(); #endif - const byte seed[] = "upy"; + const byte seed[] = "mpy"; int ret = mbedtls_ctr_drbg_seed(&self->ctr_drbg, mbedtls_entropy_func, &self->entropy, seed, sizeof(seed)); if (ret != 0) { mbedtls_raise_error(ret); diff --git a/extmod/vfs.c b/extmod/vfs.c index aebf5ed295..d2a7af5de0 100644 --- a/extmod/vfs.c +++ b/extmod/vfs.c @@ -96,7 +96,7 @@ mp_vfs_mount_t *mp_vfs_lookup_path(const char *path, const char **path_out) { return MP_STATE_VM(vfs_cur); } -// Version of mp_vfs_lookup_path that takes and returns uPy string objects. +// Version of mp_vfs_lookup_path that takes and returns MicroPython string objects. static mp_vfs_mount_t *lookup_path(mp_obj_t path_in, mp_obj_t *path_out) { const char *path = mp_obj_str_get_str(path_in); const char *p_out; diff --git a/ports/esp32/machine_hw_spi.c b/ports/esp32/machine_hw_spi.c index 6eb83fc09c..dcf8b3942a 100644 --- a/ports/esp32/machine_hw_spi.c +++ b/ports/esp32/machine_hw_spi.c @@ -38,10 +38,10 @@ #include "soc/spi_pins.h" // SPI mappings by device, naming used by IDF old/new -// upython | ESP32 | ESP32S2 | ESP32S3 | ESP32C3 | ESP32C6 -// ----------+-----------+-----------+---------+---------+--------- -// SPI(id=1) | HSPI/SPI2 | FSPI/SPI2 | SPI2 | SPI2 | SPI2 -// SPI(id=2) | VSPI/SPI3 | HSPI/SPI3 | SPI3 | err | err +// MicroPython | ESP32 | ESP32S2 | ESP32S3 | ESP32C3 | ESP32C6 +// ------------+-----------+-----------+---------+---------+--------- +// SPI(id=1) | HSPI/SPI2 | FSPI/SPI2 | SPI2 | SPI2 | SPI2 +// SPI(id=2) | VSPI/SPI3 | HSPI/SPI3 | SPI3 | err | err // Number of available hardware SPI peripherals. #if SOC_SPI_PERIPH_NUM > 2 diff --git a/ports/webassembly/asyncio/core.py b/ports/webassembly/asyncio/core.py index 9d07bd7b85..eeffa253bc 100644 --- a/ports/webassembly/asyncio/core.py +++ b/ports/webassembly/asyncio/core.py @@ -47,7 +47,7 @@ class SingletonGenerator: raise self.exc -# Pause task execution for the given time (integer in milliseconds, uPy extension) +# Pause task execution for the given time (integer in milliseconds, MicroPython extension) # Use a SingletonGenerator to do it without allocating on the heap def sleep_ms(t, sgen=SingletonGenerator()): assert sgen.state is None diff --git a/ports/windows/msvc/paths.props b/ports/windows/msvc/paths.props index 767772a1aa..a88182f4c9 100644 --- a/ports/windows/msvc/paths.props +++ b/ports/windows/msvc/paths.props @@ -31,7 +31,7 @@ $(PyWinDir)variants\$(PyVariant)\ $(PyBuildDir) - + $(PyIncDirs);$(PyBaseDir);$(PyWinDir);$(PyBuildDir);$(PyWinDir)msvc;$(PyVariantDir)