Repository navigation
build: migrate to uv, pytest, ruff and pyrefly - #10
Merged
Merged
Conversation
Replace setup.py/setup.cfg with a pyproject.toml (hatchling backend) managed by uv, and add a dev dependency group with pytest, ruff and pyrefly. - Add a pytest suite that swaps gatt for an in-memory fake, so tests run without dbus, bluetoothd or hardware - Add a gatt type stub that pins pyrefly to the BlueZ backend - Apply ruff formatting and lint fixes; export the public API via __all__ - Guard listener calls in TapTimer.services_resolved(), which crashed when no listener was set, and fix the missing-characteristic error messages, which never interpolated the UUID - holmanctl listeners stop the manager via tap_timer.manager instead of a module global - Add a CI workflow running lint, type check, tests on Python 3.9 and 3.14, and a build - Document the uv workflow in README.md and CLAUDE.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T53VSjKogcDk3z3avG76Ay
Match requires-python, the ruff/pyrefly targets and the CI matrix, and list which newer syntax is unavailable on 3.9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T53VSjKogcDk3z3avG76Ay
This was referenced Oct 15, 2026
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.
Summary
Moves the project from setuptools to uv, and adds a test suite, linting, type checking and CI.
Packaging
setup.pyandsetup.cfgare replaced bypyproject.toml(hatchling backend), managed with uv.uv.lockis committed.gatt>=0.2.7dependency and theholmanctlcommand are unchanged.download_urlis dropped.requires-python = ">=3.9"(the README previously said 3.4+).holman/andholmanctl.py.Tests (
tests/, 27 tests, 81% coverage)gattexits on import withoutpython3-dbus, sotests/conftest.pyswaps in an in-memory fake. Tests need no dbus,bluetoothd, root or hardware.holmanctllisteners and--knownoutput.Lint and types
holman/holman.pyandholmanctl.pyis formatting, including the Python examples inREADME.md.typings/gatt/__init__.pyi.gattpicks its backend at runtime, which the checker can't narrow, so the stub pins it to BlueZ.Bug fixes
TapTimer.services_resolved()calledself.listener.connect_failed()without checking for a listener, so it crashed when a characteristic was missing and no listener was set.Exception("... %s missing", uuid), so the UUID was never inserted into the message.Other changes
holmanctllisteners stop the manager throughtap_timer.managerinstead of a module global.holman/__init__.pydeclares__all__.CI (
.github/workflows/ci.yml)uv build. Every job usesuv sync --locked, so a stale lock file fails CI.Docs
uv venv --system-site-packages --python /usr/bin/python3, so the apt-installeddbusandgiare visible).Test plan
uv run pytestpasses on Python 3.9, 3.12 and 3.14uv run ruff check .anduv run ruff format --check .uv run pyrefly check(0 errors)uv build, with wheel and sdist contents checkedsudo .venv/bin/holmanctl --discoverand--connect <MAC>against a real tap timer🤖 Generated with Claude Code
https://claude.ai/code/session_01T53VSjKogcDk3z3avG76Ay