Skip to content

dev: mark the package as typed and strengthen mypy checks #896

Description

@0x4e3

The SDK already contains inline type annotations, but the published package does not include a py.typed marker. As a result, type checkers ignore these annotations when the SDK is installed as a dependency.

Proposed changes:

  • Add ydb/py.typed to both wheel and source distributions.
  • Add the Typing :: Typed package classifier.
  • Enable no_implicit_optional and disallow_untyped_decorators in mypy.
  • Fix annotations that fail under these stricter checks.
  • Preserve decorated function signatures instead of exposing them as generic Callable[..., Any].
  • Correct the public scan_query annotations to accept both query strings and ScanQuery objects, with parameters provided as a mapping.
  • Exclude generated protobuf modules from SDK-level mypy checks.

I can take this on and prepare a PR within a few days.

I’d also be happy to work on improving the package’s typing from time to time and gradually address other typing issues as they come up.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions