Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3860 +/- ##
==========================================
- Coverage 93.83% 93.76% -0.07%
==========================================
Files 48 48
Lines 4360 4349 -11
==========================================
- Hits 4091 4078 -13
- Misses 269 271 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request removes Python 3.9 support from the codebase and migrates to Python 3.10+ type annotation syntax. The migration primarily involves replacing Union[X, Y] and Optional[X] with the PEP 604 union syntax X | Y and X | None, updating imports of Callable to use collections.abc, moving TypeAlias, get_args, and get_origin from typing_extensions to the typing module, and removing version-specific compatibility code.
Changes:
- Updated minimum Python version requirement from 3.9 to 3.10 in pyproject.toml and removed Python 3.9 from CI/CD test matrix
- Migrated type annotations throughout the codebase to use PEP 604 union syntax (
X | Yinstead ofUnion[X, Y]) - Updated import statements to use Python 3.10+ standard library locations for
Callable,TypeAlias,get_args, andget_origin - Removed version compatibility checks for Python 3.9 and simplified NONE_TYPES constant
Reviewed changes
Copilot reviewed 55 out of 56 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Updated Python version requirement to >=3.10 and updated ruff/pyright target versions |
| .github/workflows/codecov.yml | Removed Python 3.9 from test matrix |
| nonebot/typing.py | Removed sys.version_info checks for Python 3.9, moved TypeAlias/get_args/get_origin to typing, updated NONE_TYPES |
| nonebot/utils.py | Migrated Union/Optional to new syntax, moved Callable import to collections.abc |
| nonebot/rule.py | Migrated type annotations to new union syntax, removed Optional/Union imports |
| nonebot/plugin/on.py | Migrated type annotations to new union syntax, removed Union import |
| nonebot/plugin/model.py | Migrated Optional annotations to new syntax |
| nonebot/plugin/manager.py | Migrated Optional annotations to new syntax, removed Optional import |
| nonebot/plugin/load.py | Migrated Union/Optional annotations to new syntax, removed imports |
| nonebot/plugin/init.py | Migrated Optional annotations to new syntax |
| nonebot/params.py | Migrated type annotations, moved Callable import, removed Union import |
| nonebot/message.py | Migrated type annotations, moved Callable import, removed Union/Optional imports |
| nonebot/internal/rule.py | Partially migrated - still has mixed Union usage |
| nonebot/internal/permission.py | Partially migrated - still has mixed Union usage |
| nonebot/internal/params.py | Mostly migrated but retains Optional import for legacy usage |
| nonebot/internal/matcher/matcher.py | Migrated type annotations, removed Union import |
| nonebot/internal/matcher/manager.py | Migrated Union annotations, removed Union import from typing |
| nonebot/internal/driver/model.py | Partially migrated - still uses Union for forward references |
| nonebot/internal/driver/combine.py | Migrated Union annotations, removed Union import |
| nonebot/internal/driver/abstract.py | Migrated Union annotations, moved TypeAlias, removed Union import |
| nonebot/internal/driver/_lifespan.py | Migrated type annotations, moved Callable/TypeAlias, removed Union import |
| nonebot/internal/adapter/template.py | Migrated type annotations, moved Callable/TypeAlias, removed Optional/Union imports |
| nonebot/internal/adapter/message.py | Migrated type annotations, removed Optional/Union imports |
| nonebot/internal/adapter/bot.py | Updated one annotation to new syntax (exception type) |
| nonebot/exception.py | Migrated Optional annotations, removed Optional import |
| nonebot/drivers/* | Migrated type annotations, moved Callable imports, removed Union/Optional imports |
| nonebot/dependencies/* | Migrated type annotations, moved Callable import |
| nonebot/config.py | Migrated type annotations, moved TypeAlias, removed Union/Optional imports |
| nonebot/compat.py | Migrated type annotations, moved Callable import, removed Optional/Union imports |
| nonebot/init.py | Migrated type annotations, removed Optional/Union imports |
| tests/* | Migrated type annotations, removed Union/Optional imports, added test for new syntax |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 55 out of 56 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🚀 Deployed to https://deploy-preview-3860--nonebot2.netlify.app |
1ec117c to
9712abd
Compare
No description provided.