Skip to content

Packaging & linting fixes and general modernisation pass - #267

Open
Gadgetoid wants to merge 10 commits into
mainfrom
feature/gpiodevice-edge
Open

Packaging & linting fixes and general modernisation pass#267
Gadgetoid wants to merge 10 commits into
mainfrom
feature/gpiodevice-edge

Conversation

@Gadgetoid

Copy link
Copy Markdown
Member

Also switches to gpiodevice's new interrupt handling. Needs a release of gpiodevice for CI not to explode.

Gadgetoid and others added 9 commits August 24, 2026 22:00
- hatchling dynamic optional-dependencies via hatch-requirements-txt
- [dependency-groups] dev; ruff import sorting (drop isort/black)
- pre-commit + editorconfig; uv-based CI and tox qa
- requires-python >= 3.9, classifiers 3.9-3.13
- remove check.sh, requirements-dev.txt, .stickler.yml
'time.time()' uses the system clock, which can jump forwards and
backwards, e.g. because the device syncs with a time server.
'time.monotonic()' is stable and will not jump.

My specific problem is that I have a picture frame which powers on every
so often, fetches another image to display, shows it, and powers off
again. It doesn't keep time when powered off (so powers on with the
clock in the past), then it syncs with an NTP server at some point
shortly after power-on, and the clock jumps forwards. However, this
often happens inside the busy polling loop, which means that the loop
exits straight away with a timeout. This means that we don't want for
the image to be fully displayed before returning.
_refresh_wait arrived with the POF-mid-refresh fix (PR #265) after this
branch's time.monotonic() pass, so it still used time.time(). The 65s
refresh wait is exactly the loop that must survive a clock jump, so put
it on time.monotonic() and give its warnings an explicit stacklevel.
Replaces the raw wait_edge_events + read_edge_events drain in the edge-driven
_busy_wait implementations (inky.py, ssd1683, ssd1608, ac073tc1a, uc8159) with
gpiodevice.wait_for_edge, preserving each driver's timeout semantics (raise vs
warn). Drops the now-unused timedelta import where applicable.
@Gadgetoid
Gadgetoid force-pushed the feature/gpiodevice-edge branch from 79d097d to 9acece6 Compare August 24, 2026 21:03
make check needs an untagged CHANGELOG heading; add 2.4.1.

The nopath fixture stripped /usr/lib to hide tkinter, but uv-managed
interpreters bundle tkinter elsewhere, so import tkinter still succeeded
and the no-tkinter tests hit tkinter.Tk() on a headless runner. Force
ImportError via a None entry in sys.modules instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants