Skip to content

Fixes from typechecker - #56

Merged
semiversus merged 21 commits into
masterfrom
fixes_from_typechecker
Sep 11, 2026
Merged

Fixes from typechecker#56
semiversus merged 21 commits into
masterfrom
fixes_from_typechecker

Conversation

@flofeurstein

@flofeurstein flofeurstein commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

While introducing ty typechecker in our app, I discovered some inconsistencies in the python-broqer library and decided to extend the mypy typechecking with this pull request.

Additionally, a bug in the timer.py module was discovered and fixed.

CONTRIBUTING.rst, README.rst and setup.py contained some artifacts from earlier releases (supported python versions, tools (e.g. flake, tox) and Travis as CI pipeline). I removed that too.

@semiversus or/and @phettberg could you please review the changes? Should we consider migrating to uv?

@flofeurstein flofeurstein self-assigned this Sep 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The functional fix is covered by new tests and the remaining feedback is limited to small documentation wording/typos.

Pull request overview

This PR tightens type-checking across broqer while fixing a concrete runtime bug in Timer.end_early(), and updates project metadata/docs/CI to reflect the current supported Python/tooling.

Changes:

  • Fix Timer.end_early() to properly cancel the pending handle and reliably invoke the callback, plus add a comprehensive async test suite for Timer.
  • Extend/clean up typing annotations (notably Optional usage and callable signatures) and simplify CI mypy invocation via pyproject.toml.
  • Refresh repository docs and packaging metadata (supported Python versions, lint tooling, CI references) to remove stale release-era artifacts.
File summaries
File Description
tests/test_timer.py Adds async tests covering timer lifecycle, argument passing, cancellation, and end_early() regression scenarios.
broqer/timer.py Fixes end_early() logic and improves callback typing / argument handling defaults.
broqer/publisher.py Improves type annotations (optional params, overloads) and adds TYPE_CHECKING-only operator method declarations.
broqer/value.py Makes who explicitly optional for emit() to satisfy type-checking.
broqer/coro_queue.py Refines coroutine callable typing to better match actual async usage.
broqer/publishers/poll.py Makes type_ explicitly optional for clearer typing.
broqer/subscribers/sink.py Makes decorator/function arguments explicitly optional and avoids truthiness checks for callables.
broqer/op/map_.py Broadens callable typing and makes decorator hooks optional for mypy correctness.
broqer/op/filter_.py Makes optional publisher/predicate parameters explicit for type-checking.
broqer/op/combine_latest.py Makes map_ optional explicitly and updates typing imports accordingly.
pyproject.toml Adds mypy configuration and adjusts ruff config formatting.
.github/workflows/build.yml Simplifies CI type-check invocation to mypy broqer (relying on config).
setup.py Updates supported Python classifiers and sets python_requires>=3.10.
requirements_dev.txt Removes tox from dev requirements.
README.rst Updates supported Python versions and switches lint tool reference to ruff.
CONTRIBUTING.rst Updates contributor workflow steps to ruff/pytest/mypy and modernizes CI/deploy references.
CHANGELOG.md Adds 3.3.0 entry describing the timer bug fix and typing improvements.
Review details
  • Files reviewed: 17/17 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CHANGELOG.md Outdated
Comment thread CONTRIBUTING.rst Outdated
Comment thread README.rst Outdated
flofeurstein and others added 3 commits September 10, 2026 14:19
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread broqer/coro_queue.py Outdated
Comment thread broqer/coro_queue.py
@flofeurstein

Copy link
Copy Markdown
Collaborator Author

@semiversus do you want to review too, or can I merge this PR?

@semiversus

Copy link
Copy Markdown
Owner

Looks fine. I'll merge it. For future reference, you or Patrick can merge it yourself.

@semiversus
semiversus merged commit f09298a into master Sep 11, 2026
5 checks passed
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.

4 participants