Skip to content

feat(python): add typing support - #20

Merged
farhan-syah merged 2 commits into
ml-rust:mainfrom
maxdswain:python-typing
Aug 22, 2026
Merged

feat(python): add typing support#20
farhan-syah merged 2 commits into
ml-rust:mainfrom
maxdswain:python-typing

Conversation

@maxdswain

Copy link
Copy Markdown
Contributor

Resolves #19

Ship a py.typed marker and complete stubs for the public Python API, including tokenizer methods and agent-token constants. Include both typing artifacts in wheels and source distributions.

maxdswain and others added 2 commits August 21, 2026 20:02
Ship a py.typed marker and complete stubs for the public Python API, including tokenizer methods and agent-token constants. Include both typing artifacts in wheels and source distributions.
Move the hand-written API stubs into `_core.pyi` for the compiled
extension module, leaving `__init__.pyi` as a thin re-export list, and
have `generate_agent_tokens.py --update-stub` emit the agent-token
classes and `__all__` there so the package's shipped `py.typed` stubs
stay pinned to the same source of truth as the docs and Rust module.
Add a CI step that runs `stubtest` against the built module to catch
drift a diff cannot.
@farhan-syah
farhan-syah merged commit 76a8a9c into ml-rust:main Aug 22, 2026
17 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.

Feature Request: Add Typing stub file for Python

2 participants