Skip to content

🏷️ types: update return types to use TypedDicts for bangumi, cheese, and ugc_video APIs#626

Merged
SigureMo merged 1 commit intomainfrom
types/update-typed-dict-usage
Jan 10, 2026
Merged

🏷️ types: update return types to use TypedDicts for bangumi, cheese, and ugc_video APIs#626
SigureMo merged 1 commit intomainfrom
types/update-typed-dict-usage

Conversation

@SigureMo
Copy link
Copy Markdown
Member

动机

#619 部分有用的迁移过来,#619 短期是合不了了,减少点冲突

解决方案

类型

  • ✨ feat: 添加新功能
  • 🐛 fix: 修复 bug
  • 📝 docs: 对文档进行修改
  • ♻️ refactor: 代码重构(既不是新增功能,也不是修改 bug 的代码变动)
  • ⚡ perf: 提高性能的代码修改
  • 🧑‍💻 dx: 优化开发体验
  • 🔨 workflow: 工作流变动
  • 🏷️ types: 类型声明修改
  • 🚧 wip: 工作正在进行中
  • ✅ test: 测试用例添加及修改
  • 🔨 build: 影响构建系统或外部依赖关系的更改
  • 👷 ci: 更改 CI 配置文件和脚本
  • ❓ chore: 其它不涉及源码以及测试的修改
  • ⬆️ deps: 依赖项修改
  • 🔖 release: 发布新版本

Copilot AI review requested due to automatic review settings January 10, 2026 12:39
@SigureMo SigureMo merged commit 8f4f019 into main Jan 10, 2026
23 checks passed
@SigureMo SigureMo deleted the types/update-typed-dict-usage branch January 10, 2026 12:42
Copy link
Copy Markdown
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 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-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jan 10, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing types/update-typed-dict-usage (4ae73f2) with main (219799b)

Summary

✅ 32 untouched benchmarks

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.

2 participants