-
Notifications
You must be signed in to change notification settings - Fork 350
Add poethepoet config #1976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add poethepoet config #1976
Changes from 4 commits
6425993
f23e4c3
e4860ea
b5784fb
78aeb00
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,6 +59,7 @@ test = [ | |
| "bumble==0.0.226", | ||
| ] | ||
| dev = [ | ||
| "poethepoet>=0.45.0", | ||
| { include-group = "docs" }, | ||
| { include-group = "lint" }, | ||
| { include-group = "test" }, | ||
|
|
@@ -83,6 +84,7 @@ python_version = "3.10" | |
| disable_error_code = ["import-not-found"] | ||
| exclude = "(.venv|kivy|recipes)/" | ||
| mypy_path = "typings" | ||
| packages = ["bleak", "tests", "examples"] | ||
|
|
||
| [tool.pyright] | ||
| typeCheckingMode = "strict" | ||
|
|
@@ -100,7 +102,77 @@ filterwarnings = [ | |
| ] | ||
|
|
||
| addopts = """ | ||
| --import-mode=importlib | ||
| --cov=bleak | ||
| --cov-branch | ||
| --cov-report html | ||
| """ | ||
|
|
||
|
|
||
|
|
||
| [tool.poe.executor] | ||
| type = "uv" | ||
| isolated = true | ||
|
|
||
| [tool.poe.tasks.test-py310] | ||
| help = "Run tests using Python 3.10" | ||
| cmd = "pytest tests -v $POE_EXTRA_ARGS" | ||
| executor = { python = "3.10", group = "test" } | ||
|
|
||
| [tool.poe.tasks.test-py311] | ||
| help = "Run tests using Python 3.11" | ||
| cmd = "pytest tests -v $POE_EXTRA_ARGS" | ||
| executor = { python = "3.11", group = "test" } | ||
|
|
||
| [tool.poe.tasks.test-py312] | ||
| help = "Run tests using Python 3.12" | ||
| cmd = "pytest tests -v $POE_EXTRA_ARGS" | ||
| executor = { python = "3.12", group = "test" } | ||
|
|
||
| [tool.poe.tasks.test-py313] | ||
| help = "Run tests using Python 3.13" | ||
| cmd = "pytest tests -v $POE_EXTRA_ARGS" | ||
| executor = { python = "3.13", group = "test" } | ||
|
|
||
| [tool.poe.tasks.test-py314] | ||
| help = "Run tests using Python 3.14" | ||
| cmd = "pytest tests -v $POE_EXTRA_ARGS" | ||
| executor = { python = "3.14", group = "test" } | ||
|
|
||
| [tool.poe.tasks.test-all] | ||
| help = "Run tests using all supported Python versions" | ||
| sequence = [ | ||
| "test-py310", | ||
| "test-py311", | ||
| "test-py312", | ||
| "test-py313", | ||
| "test-py314", | ||
| ] | ||
|
|
||
| [tool.poe.tasks.typecheck] | ||
| help = "Run type checkers (mypy, pyright)" | ||
|
|
||
| # We want always the latest version of pyright and mypy, to catch | ||
| # any breakage as soon as we can. That is why they are not dev | ||
| # dependencies in the pyproject.toml, because that would lock them to | ||
| # a specific version. Instead we install the latest version as tool. | ||
| sequence = [ | ||
| { cmd = "mypy", executor = { with = "mypy" } }, | ||
| { cmd = "pyright", executor = { with = "pyright" } }, | ||
| ] | ||
|
|
||
| [tool.poe.tasks.lint] | ||
| help = "Run code linters (isort, black, flake8)" | ||
| sequence = [ | ||
| { cmd = "isort . ${checkonly:+--check --diff}", executor = { group = "lint" } }, | ||
| { cmd = "isort docs ${checkonly:+--check --diff}", executor = { group = "lint" } }, | ||
| { cmd = "black . ${checkonly:+--check --diff}", executor = { group = "lint" } }, | ||
| { cmd = "flake8 . --count --show-source --statistics", executor = { group = "lint" } }, | ||
| ] | ||
| args = [{ name = "checkonly", type = "boolean" }] | ||
| executor = { group = "lint" } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The During testing, I also noticed that with the |
||
|
|
||
| [tool.poe.tasks.docs] | ||
| help = "Build the documentation" | ||
| cmd = "sphinx-build -b html -W -d docs/_build/doctrees docs docs/_build/html" | ||
| executor = { python = "3.11", group = "docs" } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
poeinvokegit?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that isn't strictly necessary for
poe. But during the development of my poe PR, I installed poe directly from a Git branch, and that only works if Git is also installed on the system. Since Git is also listed as a prerequisite inCONTRIBUTING.rst, I just left it in there so people don't run into that issue again.