Skip to content

Conversation

@chezou
Copy link
Member

@chezou chezou commented Oct 30, 2025

  • Add type hint
  • Introduce pyright to ensure typing on CI and pre-commit

@chezou chezou marked this pull request as ready for review October 31, 2025 01:30
@chezou chezou requested a review from Copilot October 31, 2025 01:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds comprehensive type hints (PEP 484) to the td-client-python library, improving development experience with static type checkers. The changes include:

  • Addition of type annotations to all public APIs and internal methods
  • Creation of tdclient/types.py module with type aliases and TypedDict classes
  • Addition of py.typed marker file for PEP 561 compliance
  • Configuration for pyright type checker and updates to pre-commit hooks

Reviewed Changes

Copilot reviewed 34 out of 38 changed files in this pull request and generated 64 comments.

Show a summary per file
File Description
tdclient/types.py New module defining type aliases and TypedDict classes for common patterns
tdclient/py.typed PEP 561 marker file for type stub support
tdclient/util.py Added type hints to utility functions for CSV parsing and data processing
tdclient/client.py Added comprehensive type hints to the main Client class
tdclient/api.py Added type hints to HTTP API methods and request handling
tdclient/*_api.py Added type hints to all API endpoint classes
tdclient/*_model.py Added type hints to model classes
tdclient/cursor.py Added type hints to cursor implementation
tdclient/connection.py Added type hints to connection implementation
tdclient/errors.py Added docstrings to exception classes
pyproject.toml Added typing-extensions dependency and pyright configuration
.pre-commit-config.yaml Updated hooks and added pyright check
.github/workflows/pythontest.yml Added pyright execution to CI pipeline
README.rst Added documentation about type hints feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chezou chezou mentioned this pull request Oct 31, 2025
@chezou chezou requested a review from tung-vu-td October 31, 2025 02:33
Copy link
Contributor

@tung-vu-td tung-vu-td left a comment

Choose a reason for hiding this comment

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

LGTM

@chezou chezou merged commit 2558fd2 into master Nov 3, 2025
22 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.

3 participants