Repository navigation
Env helpers move from displaydev to boarddev (a hard break) - #131
Merged
Merged
Conversation
env_get, env_int, env_float, env_bool and env_set, with _env_raw and the env_set override table, now live in lib/boarddev.py. displaydev keeps no copy and no re-export: from displaydev import env_get raises ImportError. displaydev reads PYDEVICES_FPS, PYDEVICES_FPS_PRINT and PYDEVICES_REFRESH_MS through boarddev, imported where they are read. boarddev still imports nothing at module scope, so there is no cycle. Every caller in this repo moves with it: the desktop, pgdisplay, psdisplay and linux_kms board configs, displaydev.auto, the tests and the docs.
This was referenced Oct 7, 2026
Env helpers come from boarddev (follows pydevices#131's hard break)
PyDevices/pydevices-examples#183
Merged
Hero and docs runtimes take env_set from boarddev (lands with the wasm rebuild)
PyDevices/.github#62
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
env_get,env_int,env_float,env_boolandenv_set(with_env_rawand theenv_setoverride table) move fromdisplaydevtoboarddev. This is a hard break: there is no re-export and no shim, sofrom displaydev import env_getraisesImportErrorafter this merges. Writefrom boarddev import env_getinstead.displaydev still reads
PYDEVICES_FPS,PYDEVICES_FPS_PRINTandPYDEVICES_REFRESH_MS, through boarddev, imported inside the two methods that read them so the names never appear ondisplaydev. boarddev still imports nothing at module scope, so there's no cycle.Every caller in this repo moves with it: the desktop, pgdisplay, psdisplay and linux_kms board configs,
displaydev.auto, the tests,docs/board-configs.md,docs/displaydev.md,docs/newcomers.mdandlib/audiodev/README.md.tests/test_env.pynow also proves the break: every moved name is gone fromdisplaydevand from__all__, and importing it from there fails.test_standalonecopiesboarddev.pybesidedisplaydev, because a driver reads its settings from there when it starts.Merge order
Merge this first, then merge the caller PRs below in the same sitting. A caller importing from boarddev needs this pydevices.
--local-modulesbuilds shadow boarddev tooboarddev.env_set, so it goes after this one.These four wait for a rebuild because they run a frozen pydevices:
What breaks, and until when
pydevices ships to people in three ways, and each one picks this up at a different time. Here's what's broken between steps:
pydevices-desktop.tomlfrom main; the examples CI checks out main): this changes the moment it merges. Old examples that import from displaydev break there until the examples PR merges, which is why both go in one sitting.env_*.bin/micropythonand the other desktop interpreters, the vendored wasm in PyDevices.github.io and workbench, the mpvst engine, firmware built with--modules pydevices): this changes at the next pin move and rebuild. Nothing in this PR builds them. Until the rebuild,bin/micropythonruns the new examples against its frozen old boarddev and fails. So does the examples gallery on pydevices.github.io (it boots the site's vendored wasm), for the examples that set or read env vars: car_cluster, drum_machine, spectrum, roku_remote, lv_test_timer and the Peter Hinch page.Tested
tests/: test_env, test_boarddev, test_standalone, test_autodisplay, test_desktop_board_config, test_displaydev_fps, test_refresh_override, test_lvgl_display_driver, test_portability, test_display_driver, test_displaydev_capabilities, test_backend_isolation, test_displaydev_auto, test_contract_proof, test_board_peripherals_desktop, test_appdev, test_appdev_timers, test_board_peripherals_static, test_needs_refresh, test_pgdisplay_frame_recorder, test_psdisplay_scale, test_wasm_backends, test_wasm_cli, test_desktop_scale, test_displaydev_lifecycle. 169 tests pass.tests/portability_probe.pyunder unix MicroPython 1.29 and CircuitPython 10.x, with thislib/on the path, prints PORTABILITY OK, env checks included.from displaydev import env_getraises ImportError,hasattr(displaydev, "env_get")is False, andboarddev.env_set/env_intround-trip.lv_test_timer.py kitwithPYDEVICES_LV_ROTATION=90 PYDEVICES_REFRESH_MS=50on MicroPython 1.29 and CPython. It rotates to 90 and reportsfps 20.0, so displaydev read the period through boarddev.spectrum.pywithPYDEVICES_FPS_PRINT=1prints its fps line on both.