Skip to content

Add poethepoet config#1976

Open
timrid wants to merge 4 commits intohbldh:developfrom
timrid:poethepoet
Open

Add poethepoet config#1976
timrid wants to merge 4 commits intohbldh:developfrom
timrid:poethepoet

Conversation

@timrid
Copy link
Copy Markdown
Contributor

@timrid timrid commented May 2, 2026

This is an alternative to #1922 that uses poethepoet instead of tox as you suggested.

Some examples of the new commands:

  • uv run poe test-py310: Run pytest on Python 3.10
  • uv run poe test-py310 --bleak-hci-transport=serial:/dev/tty.usbmodem1101: Run integration tests on Python 3.10
  • uv run poe test-all: Run pytest on all Python versions
  • uv run poe test-all --bleak-hci-transport=serial:/dev/tty.usbmodem1101: Run integration tests on all Python versions
  • uv 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 docs

This 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 (pyobjc and rubicon-objc).

It took some time to find a good way to pass the --bleak-hci-transport or --bleak-bluez-vhci options to the pytests. Finally I created nat-n/poethepoet#380 that simplifies this problem an which is now released in poethepoeth v0.45.0.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.26%. Comparing base (058c4e2) to head (b5784fb).
⚠️ Report is 8 commits behind head on develop.

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     
Flag Coverage Δ
bluez-integration-py3.10 ?
bluez-integration-py3.11 ?
bluez-integration-py3.12 ?
bluez-integration-py3.13 ?
bluez-integration-py3.14 ?
bluez-integration-py310 38.45% <ø> (?)
bluez-integration-py311 38.45% <ø> (?)
bluez-integration-py312 38.45% <ø> (?)
bluez-integration-py313 38.45% <ø> (?)
bluez-integration-py314 36.88% <ø> (?)
macos-latest-py3.10 ?
macos-latest-py3.11 ?
macos-latest-py3.12 ?
macos-latest-py3.13 ?
macos-latest-py3.14 ?
macos-latest-py310 19.84% <ø> (?)
macos-latest-py311 19.84% <ø> (?)
macos-latest-py312 19.84% <ø> (?)
macos-latest-py313 19.84% <ø> (?)
macos-latest-py314 19.66% <ø> (?)
ubuntu-latest-py3.10 ?
ubuntu-latest-py3.11 ?
ubuntu-latest-py3.12 ?
ubuntu-latest-py3.13 ?
ubuntu-latest-py3.14 ?
ubuntu-latest-py310 23.80% <ø> (?)
ubuntu-latest-py311 23.80% <ø> (?)
ubuntu-latest-py312 23.80% <ø> (?)
ubuntu-latest-py313 23.80% <ø> (?)
ubuntu-latest-py314 21.85% <ø> (?)
windows-latest-py3.10 ?
windows-latest-py3.11 ?
windows-latest-py3.12 ?
windows-latest-py3.13 ?
windows-latest-py3.14 ?
windows-latest-py310 18.42% <ø> (?)
windows-latest-py311 18.42% <ø> (?)
windows-latest-py312 18.42% <ø> (?)
windows-latest-py313 18.42% <ø> (?)
windows-latest-py314 18.15% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@timrid timrid mentioned this pull request May 2, 2026
Comment thread .github/workflows/build_and_test.yml Outdated

- 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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this make it more verbose since the commands in pyproject.toml also include -v?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. The -v is doubled. I removed the -v in the .yml.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 poethepoet as a development dependency and define shared poe tasks for tests, linting, type checking, and docs.
  • Update GitHub Actions workflows to invoke the new poe tasks 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.

@timrid timrid requested a review from dlech May 2, 2026 20:15
Comment thread .github/workflows/build_and_test.yml Outdated
Comment thread pyproject.toml Outdated
VM_SSH_PORT="2222"
VM_CONSOLE_LOG="vm-console.log"
VM_PACKAGES="bluez openssh uv"
VM_PACKAGES="bluez openssh uv git"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does poe invoke git?

Comment thread pyproject.toml
{ cmd = "flake8 . --count --show-source --statistics", executor = { group = "lint" } },
]
args = [{ name = "checkonly", type = "boolean" }]
executor = { group = "lint" }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have this here, do we need the same on each command in the sequence?

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