Skip to content

Conversation

@projectgus
Copy link
Contributor

@projectgus projectgus commented Sep 24, 2025

Summary

As suggested by @Josverl in #18057, this PR retires the legacy terms uPy, uPython. and adds codespell configuration to check for them in CI.

(EDIT: Have taken the Codespell changes out as Damien reasonably pointed out that no one is likely to add these terms back any time soon.)

In the last commit of this PR, uPy is bulk replaced with:

  • The abbreviation MPy in contexts where it's contrasted with CPy
  • MicroPython otherwise.

I also made a couple of opportunistic replacements of cPy with the more common CPy.

There is also a commit to change the "Differences to CPython" generation. Previously it generated tables with headings CPy Output and uPy Output. Now it is CPython Output and MicroPython Output. The code block below the heading in each column is always wider than the heading, so there's no need to abbreviate here.

Trade-offs and Alternatives

We could simply not do this.

I don't know if uPy and uPython causes confusion for people new to MicroPython, but potentially it could (one more set of terms to learn). Consistency is good to have.

@projectgus projectgus added the tools Relates to tools/ directory in source, or other tooling label Sep 24, 2025
@projectgus projectgus changed the title Ci/codespell upy all,tools: Retire the terms uPy, uPython. Sep 24, 2025
@projectgus projectgus force-pushed the ci/codespell_upy branch 2 times, most recently from 560e5ab to 0b435ae Compare September 24, 2025 01:50
@projectgus
Copy link
Contributor Author

projectgus commented Sep 24, 2025

There is one place where uPy still appears, as the __file__ property of tests/frozen/frozentest.mpy (which is then printed as part of the extracoverage tests). I don't exactly understand the mechanism here, but it's probably not worth trying to change...

@projectgus
Copy link
Contributor Author

Sorry for the email spams @dlech, I misattributed this request to you and not @Josverl in the original description.

@github-actions
Copy link

github-actions bot commented Sep 24, 2025

Code size report:

  mpy-cross:    +0 +0.000% 
   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@codecov
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.39%. Comparing base (a79e1fd) to head (3ec8b9a).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #18128   +/-   ##
=======================================
  Coverage   98.39%   98.39%           
=======================================
  Files         171      171           
  Lines       22276    22276           
=======================================
  Hits        21918    21918           
  Misses        358      358           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dpgeorge
Copy link
Member

Thanks for doing this! I think it's a good change, there are a quite a lot of places where uPy -> MicroPython is an obvious improvement.

But for the changes where uPy -> MP ... I'm not sure it's always clear what "MP" stands for? Maybe use "MPy"/"MPY"??

There is one place where uPy still appears, as the __file__ property of tests/frozen/frozentest.mpy (which is then printed as part of the extracoverage tests). I don't exactly understand the mechanism here, but it's probably not worth trying to change...

I think we can change this. It's just the first string printed by that test, see tests/frozen/frozentest.py. As long as that string is small enough to be interned, that's all it's testing. See MICROPY_ALLOC_PARSE_INTERN_STRING_LEN which defaults to 10 bytes. In the test it just needs to be a string that's 10 bytes or less in length.

@Josverl
Copy link
Contributor

Josverl commented Sep 24, 2025

I find MPy clearer
for CPy im on the fence as CP is often used for CircuitPython, and so may lead to confusion.

@dhalbert
Copy link
Contributor

In the CircuitPython world we do say "CPy" for CircuitPython, but never in documentation, just on discord, etc., to save typing. Sometimes we say "CircPy" for short. If comparing with MicroPython, "MPy" vs "CPy" is usually clear, in context.

"CPython" is pretty confusing as well, because that name is rarely used by ordinary Python users, especially novices., and sounds like it might be an abbreviation for CircuitPython. So we (or at least I) say "regular Python" a lot when discussing CPython.

@dpgeorge
Copy link
Member

There is one place where uPy still appears, as the __file__ property of tests/frozen/frozentest.mpy

Maybe change "uPy" to "interned" in this test? That makes it clear exactly what it's testing.

Copy link
Member

@dpgeorge dpgeorge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good now, thanks.

I don't know if uPy and uPython causes confusion for people new to MicroPython, but potentially it could (one more set of terms to learn). Consistency is good to have.

IMO this is the strongest argument in favour of this change: a newcomer seeing "uPython" could potentially be confused as to what it refers to (and thinks "is there a difference between uPython and MicroPython?").

Abbreviating these doesn't really save space in the docs, as the code
blocks in the next row are always wider than the column headings.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
@dpgeorge dpgeorge force-pushed the ci/codespell_upy branch 2 times, most recently from cfd991d to d328984 Compare October 3, 2025 13:46
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 <angus@redyak.com.au>
@dpgeorge dpgeorge merged commit 3ec8b9a into micropython:master Oct 3, 2025
75 checks passed
@projectgus projectgus deleted the ci/codespell_upy branch October 7, 2025 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools Relates to tools/ directory in source, or other tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants