Add poethepoet config#1976
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1976 +/- ##
===========================================
- Coverage 51.26% 51.26% -0.01%
===========================================
Files 39 39
Lines 3938 3940 +2
Branches 488 487 -1
===========================================
+ Hits 2019 2020 +1
- Misses 1791 1794 +3
+ Partials 128 126 -2 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
|
||
| - name: Test with pytest | ||
| run: uv run pytest -v --cov-report=xml --junitxml=junit.xml -o junit_family=legacy | ||
| run: uv run poe test-py${{ matrix.python-version }} -v --cov-report=xml --junitxml=junit.xml -o junit_family=legacy |
There was a problem hiding this comment.
Will this make it more verbose since the commands in pyproject.toml also include -v?
There was a problem hiding this comment.
You are right. The -v is doubled. I removed the -v in the .yml.
There was a problem hiding this comment.
Pull request overview
This PR replaces ad-hoc local/CI developer commands with centralized poethepoet tasks in pyproject.toml, so Bleak’s linting, testing, type checking, and docs workflows can be run consistently through uv run poe ....
Changes:
- Add
poethepoetas a development dependency and define sharedpoetasks for tests, linting, type checking, and docs. - Update GitHub Actions workflows to invoke the new
poetasks instead of duplicating shell commands. - Refresh contributor instructions and Alpine VM setup to support the new task-based workflow.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Locks poethepoet and its transitive dependencies for the dev environment. |
pyproject.toml |
Adds poethepoet, updates mypy/pytest config, and defines the new shared task runners. |
CONTRIBUTING.rst |
Switches contributor guidance to the new uv run poe ... commands. |
.github/workflows/format_and_lint.yml |
Replaces direct lint/docs commands with centralized poe tasks. |
.github/workflows/build_and_test.yml |
Reworks CI test and typecheck execution to use the new poe task definitions. |
.github/alpine-vm/start-alpine-vm.sh |
Adds git to the Alpine VM packages to support the updated CI execution path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| VM_SSH_PORT="2222" | ||
| VM_CONSOLE_LOG="vm-console.log" | ||
| VM_PACKAGES="bluez openssh uv" | ||
| VM_PACKAGES="bluez openssh uv git" |
| { cmd = "flake8 . --count --show-source --statistics", executor = { group = "lint" } }, | ||
| ] | ||
| args = [{ name = "checkonly", type = "boolean" }] | ||
| executor = { group = "lint" } |
There was a problem hiding this comment.
If we have this here, do we need the same on each command in the sequence?
This is an alternative to #1922 that uses
poethepoetinstead oftoxas you suggested.Some examples of the new commands:
uv run poe test-py310: Run pytest on Python 3.10uv run poe test-py310 --bleak-hci-transport=serial:/dev/tty.usbmodem1101: Run integration tests on Python 3.10uv run poe test-all: Run pytest on all Python versionsuv run poe test-all --bleak-hci-transport=serial:/dev/tty.usbmodem1101: Run integration tests on all Python versionsuv run poe lint: Run code linters (isort, black, flake8)uv run poe lint --checkonly: Run code linters (isort, black, flake8) without changing anything (mainly for CI usage)uv run poe typecheck: Run type checkers (mypy, pyright)uv run poe docs: Building the docsThis is only the groundwork for all current functions of bleak. I plan to expand the poethepoet config in #1944 to add "cross-platform" type checking for the new Android backend. And additionaly in #1853 to add type checking for multiple backends (
pyobjcandrubicon-objc).It took some time to find a good way to pass the
--bleak-hci-transportor--bleak-bluez-vhcioptions to the pytests. Finally I created nat-n/poethepoet#380 that simplifies this problem an which is now released in poethepoeth v0.45.0.