Conversation
17d100a to
991bed8
Compare
…th MessageType(msgtype) after reading from socket
991bed8 to
31c3f68
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds the "ty" type checker to the aiokdb project and makes several related improvements. The ty type checker is a Python type checking tool that complements mypy. The changes include upgrading the minimum Python version requirement from 3.8 to 3.10, updating deprecated API usage, improving type annotations, and refactoring code to be more type-checker friendly.
Changes:
- Adds ty type checker to the development toolchain and CI pipeline
- Updates minimum Python version requirement from 3.8 to 3.10 and adds support for Python 3.13
- Fixes deprecated
datetime.utcfromtimestamp()calls by replacing them withdatetime.fromtimestamp(..., tz=timezone.utc) - Refactors
HtmlFormatterto use overridable methods instead of constructor parameters for HTML escaping and markup - Improves parameter naming consistency in adapter classes (
item→value,i→index) - Updates asyncio exception handling from
asyncio.exceptions.IncompleteReadErrortoasyncio.IncompleteReadError - Adds explicit
MessageTypecast for better type safety - Improves type annotations for
array.arrayusage
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| requirements.txt | Pinned all dependency versions including new ty==0.0.18; contains invalid pytest-asyncio version |
| requirements.minimal.txt | Added ty and ruff to minimal requirements |
| pyproject.toml | Updated Python version requirements to 3.10+ and added ty configuration |
| check.sh | Added ty check to the validation script |
| .github/workflows/check.yml | Updated CI to test Python 3.10-3.13 and run ty check |
| aiokdb/format.py | Replaced deprecated datetime methods, refactored HtmlFormatter to use methods instead of constructor parameters, improved tuple unpacking |
| aiokdb/server.py | Added MessageType cast and updated asyncio exception handling |
| aiokdb/adapter.py | Improved parameter naming for clarity and consistency |
| aiokdb/init.py | Enhanced type annotations for array.array |
| test/test_format.py | Updated test to use new HtmlFormatter method names |
| README.md | Updated documentation to reflect Python 3.10-3.13 support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the "ty" type checker and makes several improvements to type hints so that it passes. The ty type checker is a Python static type checking tool. The changes include upgrading the minimum Python version requirement from 3.8 to 3.10, updating deprecated API usage, improving type annotations, and refactoring code to be more type-checker friendly.
Changes:
tytype checker to the development toolchain and CI pipelinedatetime.utcfromtimestamp()calls by replacing them withdatetime.fromtimestamp(..., tz=timezone.utc)HtmlFormatterto use overridable methods instead of constructor parameters for HTML escaping and markupasyncio.exceptions.IncompleteReadErrortoasyncio.IncompleteReadErrorMessageTypecast for better type safetyarray.arrayusage