Skip to content

Add py.typed markers for PEP 561 typing support#503

Open
konichuvak wants to merge 1 commit intobinance:masterfrom
konichuvak:add-py-typed-markers
Open

Add py.typed markers for PEP 561 typing support#503
konichuvak wants to merge 1 commit intobinance:masterfrom
konichuvak:add-py-typed-markers

Conversation

@konichuvak
Copy link

Summary

This PR adds py.typed markers to binance-common and all Python SDK client packages, and updates each package's build metadata so the marker is included in built distributions.

This marks the packages as typed per PEP 561.

What Changed

  • Added a py.typed file to each published package under its import root
  • Updated each package's pyproject.toml include = [...] list so py.typed is shipped in wheels and source distributions

Scope includes:

  • common
  • all packages under clients/*

Why

These packages already contain inline type annotations in their Python sources.

Without a py.typed marker, type checkers such as mypy treat installed packages as untyped. In downstream projects, that causes imported SDK symbols, especially generated model classes, to degrade to Any even when the source package contains usable type information.

Adding py.typed allows type checkers to consume the inline annotations from installed distributions as intended by PEP 561.

Impact

  • No runtime behavior changes
  • No API changes
  • Improves downstream type-checking support for installed packages

Validation

  • Built representative wheels locally
  • Verified that py.typed is present in wheel contents
  • Verified with mypy that downstream imports resolve concrete model types instead of collapsing to Any

Notes

This PR does not add generated stubs or change runtime code paths.

It only marks the distributed packages as typed so existing inline annotations are visible to downstream type checkers.

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