Skip to content

py/stream: Use MP_SEEK_xxx constants instead of SEEK_xxx.#19281

Open
dpgeorge wants to merge 3 commits into
micropython:masterfrom
dpgeorge:py-stream-use-mp-seek-constants
Open

py/stream: Use MP_SEEK_xxx constants instead of SEEK_xxx.#19281
dpgeorge wants to merge 3 commits into
micropython:masterfrom
dpgeorge:py-stream-use-mp-seek-constants

Conversation

@dpgeorge
Copy link
Copy Markdown
Member

Summary

The MP_SEEK_xxx constants are defined in py/stream.h exactly for use by py/stream.c so that it doesn't depend on the C library. So use them.

Also remove definitions of SEEK_xxx in custom unistd.h files because they are no longer needed.

This issue was reported when porting MicroPython to the P2: https://forums.parallax.com/discussion/comment/1572778/#Comment_1572778

Testing

Ran unix coverage tests locally. CI will also test.

Generative AI

None used.

dpgeorge added 3 commits May 30, 2026 18:56
The `MP_SEEK_xxx` constants are defined in `py/stream.h` exactly for use
by `py/stream.c` so that it doesn't depend on the C library.

Signed-off-by: Damien George <damien@micropython.org>
Instead of magic numbers + a comment.

Signed-off-by: Damien George <damien@micropython.org>
They are no longer needed.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge added the py-core Relates to py/ directory in source label May 30, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.47%. Comparing base (44a569b) to head (faa1e22).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19281   +/-   ##
=======================================
  Coverage   98.47%   98.47%           
=======================================
  Files         176      176           
  Lines       22845    22845           
=======================================
  Hits        22497    22497           
  Misses        348      348           

☔ 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.

@github-actions
Copy link
Copy Markdown

Code size report:

Reference:  rp2/CMakeLists.txt: Require boards to define PICO_FLASH_SIZE_BYTES. [44a569b]
Comparison: ports: Remove SEEK_xxx constants from custom unistd.h files. [merge of faa1e22]
  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
      esp32:    +0 +0.000% ESP32_GENERIC
     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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

py-core Relates to py/ directory in source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant