[py] chore: enable mypy disallow untyped decorators and update type hints - #17974
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
🟢 Approval recommended
The changes are narrowly scoped to typing/configuration and correctly address the reported mypy untyped-decorator issues without altering WebDriver behavior.
Pull request overview
This PR tightens the Python binding’s type-checking configuration by enabling mypy’s disallow_untyped_decorators, and updates the WebDriver virtual-authenticator decorators to be fully typed so annotated methods don’t become implicitly untyped.
Changes:
- Enable mypy
disallow_untyped_decoratorsinpy/pyproject.toml. - Add
ParamSpec/Concatenate-based typing to_required_chromium_based_browserand_required_virtual_authenticatordecorators to preserve wrapped method signatures and satisfy mypy.
File summaries
| File | Description |
|---|---|
| py/selenium/webdriver/remote/webdriver.py | Types the internal decorators using ParamSpec/Concatenate so decorated WebDriver methods remain typed under stricter mypy settings. |
| py/pyproject.toml | Turns on disallow_untyped_decorators to surface (and now enforce fixing) untyped decorator usage. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🔗 Related Issues
it fixes mypy warnings
💥 What does this PR do?
🔧 Implementation Notes
🤖 AI assistance
💡 Additional Considerations
🔄 Types of changes