Skip to content

Conversation

@cgoldberg
Copy link
Member

@cgoldberg cgoldberg commented Dec 31, 2025

User description

🔗 Related Issues

#15697

💥 What does this PR do?

This is another cleanup PR:

  • removes deprecated log_path attribute in webkitgtk.Service class
  • moves linting/typechecking/validation dependencies to pyproject.toml to keep them in a central location
  • renames the mypy tox environment to typecheck (more generic name because we might replace mypy)
  • fixes many type annotation issues (we are down to 22 mypy errors)
  • makes docstrings more consistent
  • re-adds tox to dev dependencies that I accidentally removed previously

🔄 Types of changes

  • Cleanup (formatting, renaming)
  • Bug fix (backwards compatible)
  • Breaking change (removed deprecated attribute)

PR Type

Enhancement, Bug fix


Description

  • Fix type annotations across service classes and remove unused imports

  • Centralize linting/typecheck/validation dependencies in pyproject.toml

  • Rename mypy tox environment to typecheck for better generality

  • Remove deprecated log_path attribute from webkitgtk.Service

  • Standardize docstrings across all service classes for consistency

  • Replace ByType with str type hints in element finding methods


Diagram Walkthrough

flowchart LR
  A["Type Annotations<br/>Fixes"] --> B["Service Classes<br/>Consistency"]
  C["Dependencies<br/>Centralization"] --> D["pyproject.toml<br/>Config"]
  E["Deprecated<br/>Attribute Removal"] --> B
  F["Docstring<br/>Standardization"] --> B
  G["ByType to str<br/>Conversion"] --> A
  D --> H["tox.ini<br/>Updates"]
Loading

File Walkthrough

Relevant files
Type annotation fix
8 files
service.py
Convert service_args to list type                                               
+1/-1     
service.py
Remove IOBase import and fix type annotations                       
+7/-15   
browsing_context.py
Replace UNDEFINED type with Sentinel                                         
+2/-2     
service.py
Remove cast calls and fix log_output type hints                   
+8/-8     
shadowroot.py
Remove ByType import and use str type                                       
+2/-3     
webdriver.py
Remove ByType import and use str type                                       
+3/-3     
webelement.py
Remove ByType import and use str type                                       
+3/-3     
service.py
Update type hints and standardize docstring                           
+11/-14 
Documentation
3 files
service.py
Standardize docstring format and parameters                           
+3/-3     
service.py
Move docstring from method to class level                               
+13/-15 
service.py
Standardize docstring format and parameters                           
+3/-3     
Bug fix
1 files
service.py
Remove deprecated log_path and fix types                                 
+12/-21 
Configuration changes
2 files
ci-python.yml
Rename mypy environment to typecheck                                         
+1/-1     
tox.ini
Use dependency_groups and rename mypy environment               
+7/-13   
Dependencies
3 files
pyproject.toml
Add dependency groups for lint/typecheck/validate               
+16/-5   
requirements.txt
Add tox and related dependencies                                                 
+8/-0     
requirements_lock.txt
Update locked versions for new dependencies                           
+58/-1   

@cgoldberg cgoldberg self-assigned this Dec 31, 2025
@selenium-ci selenium-ci added C-py Python Bindings B-build Includes scripting, bazel and CI integrations B-devtools Includes everything BiDi or Chrome DevTools related labels Dec 31, 2025
@cgoldberg cgoldberg changed the title [py] Fix type annotations, make service classes more consistent, centralize dependencies [py] Fix type annotations, make docstrings consistent, centralize dependencies Dec 31, 2025
@cgoldberg cgoldberg marked this pull request as ready for review December 31, 2025 16:11
@SeleniumHQ SeleniumHQ deleted a comment from qodo-code-review bot Dec 31, 2025
@SeleniumHQ SeleniumHQ deleted a comment from qodo-code-review bot Dec 31, 2025
@cgoldberg cgoldberg merged commit 13af249 into SeleniumHQ:trunk Dec 31, 2025
24 checks passed
@cgoldberg cgoldberg deleted the py-fix-types branch December 31, 2025 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-build Includes scripting, bazel and CI integrations B-devtools Includes everything BiDi or Chrome DevTools related C-py Python Bindings Review effort 3/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants