Skip to content

add py.type marker and GH actions#3

Merged
ntner merged 2 commits intomasterfrom
pytypt
Mar 31, 2026
Merged

add py.type marker and GH actions#3
ntner merged 2 commits intomasterfrom
pytypt

Conversation

@ntner
Copy link
Copy Markdown
Contributor

@ntner ntner commented Mar 31, 2026

Summary

  • PEP 561 py.typed marker: The package passes mypy --strict but downstream consumers couldn't benefit from the type annotations without this marker file.
  • GitHub Actions CI: Added a unit test + lint workflow on PRs/pushes to master (Python 3.9-3.13 matrix) and a publish-to-PyPI workflow on GitHub release using trusted publishing (OIDC).
  • Public stream() method: The README streaming example referenced client._http.stream() (private API). Added client.stream() as a public passthrough and updated the README to use it.

Changes

src/convox/py.typed

  • New empty marker file for PEP 561 inline type stub support

src/convox/client.py

  • Added ConvoxClient.stream() method that delegates to _http.stream(), with docstring noting the intentional no-raise-on-error behavior for streaming endpoints

README.md

  • Updated streaming example from client._http.stream(...) to client.stream(...)
  • Updated section description to match

.github/workflows/ci.yml

  • Runs on push to master and PRs against master
  • Matrix: Python 3.9, 3.10, 3.11, 3.12, 3.13
  • Steps: ruff check, ruff format --check, mypy src/, pytest tests/ -v

.github/workflows/publish.yml

  • Triggers on GitHub release publish
  • Builds with hatch, publishes via pypa/gh-action-pypi-publish using OIDC trusted publishing (no API token secret needed)

Verification

$ pytest tests/ -v          # 172 passed
$ ruff check .              # All checks passed
$ ruff format --check .     # 46 files already formatted
$ mypy src/                 # Success: no issues found in 19 source files

Notes

  • The publish workflow uses PyPI trusted publishing (OIDC). You'll need to configure the trusted publisher in PyPI settings for the convox package: set the GitHub repo to convox/convox-python, workflow to publish.yml, and environment to (blank/default).
  • No unit test added for client.stream() since it's a one-line passthrough to _http.stream() which is already covered.

@ntner ntner merged commit d71b1a1 into master Mar 31, 2026
5 checks passed
@ntner ntner deleted the pytypt branch March 31, 2026 20:48
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.

1 participant