Conversation
…and ugc_video APIs
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves type safety by updating return types to use TypedDict constructor calls for the bangumi, cheese, and ugc_video APIs, along with dependency updates for development tools.
Changes:
- Updated dev dependencies: pyright (1.1.407 → 1.1.408), pytest (9.0.1 → 9.0.2), ruff (0.14.6 → 0.14.11), typos (1.40.0 → 1.42.0)
- Converted dictionary literal returns to TypedDict constructor calls in API modules for better type checking
- Moved commonly used type definitions from TYPE_CHECKING imports to regular imports to support TypedDict constructors
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Updated dependency lock file with new versions of pyright, pytest, ruff, and typos |
| pyproject.toml | Updated minimum version requirements for dev dependencies |
| src/yutto/utils/functional/async_object.py | Removed unnecessary pyright ignore comment |
| src/yutto/utils/asynclib.py | Added types import and isinstance assertion for improved type safety in async_cache |
| src/yutto/input_parser.py | Changed generic urllib import to more explicit urllib.parse |
| src/yutto/exceptions.py | Updated handle_uncaught_exception signature with more accurate types (BaseException, optional traceback, Any return) |
| src/yutto/downloader/downloader.py | Replaced pyright ignore comments with cast() for cleaner type handling |
| src/yutto/api/ugc_video.py | Converted dict returns to TypedDict constructor calls; moved AudioUrlMeta, VideoUrlMeta, MultiLangSubtitle, and ChapterInfoData out of TYPE_CHECKING |
| src/yutto/api/cheese.py | Converted dict returns to TypedDict constructor calls; moved AudioUrlMeta and VideoUrlMeta out of TYPE_CHECKING |
| src/yutto/api/bangumi.py | Converted dict returns to TypedDict constructor calls; moved AudioUrlMeta and VideoUrlMeta out of TYPE_CHECKING |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
|
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.
动机
将 #619 部分有用的迁移过来,#619 短期是合不了了,减少点冲突
解决方案
类型