From 34f179fd07f9bb9636d0b088c561ca66ef9da792 Mon Sep 17 00:00:00 2001 From: Corey Goldberg <1113081+cgoldberg@users.noreply.github.com> Date: Sun, 10 May 2026 19:41:34 -0400 Subject: [PATCH 1/2] [py] fix linting and mypy to properly exclude generated bidi files --- py/docs/source/api.rst | 5 +++++ py/private/ruff_check.py | 2 +- py/private/ruff_format.py | 2 +- py/pyproject.toml | 8 +++++++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/py/docs/source/api.rst b/py/docs/source/api.rst index d4304cbe7320b..9cf96cc40bf44 100644 --- a/py/docs/source/api.rst +++ b/py/docs/source/api.rst @@ -50,6 +50,7 @@ webdriver.common selenium.webdriver.common.action_chains selenium.webdriver.common.alert + selenium.webdriver.common.api_request_context selenium.webdriver.common.by selenium.webdriver.common.desired_capabilities selenium.webdriver.common.driver_finder @@ -91,6 +92,8 @@ webdriver.common.bidi .. autosummary:: :toctree: selenium_webdriver_common_bidi + selenium.webdriver.common.bidi._event_manager + selenium.webdriver.common.bidi.bluetooth selenium.webdriver.common.bidi.browser selenium.webdriver.common.bidi.browsing_context selenium.webdriver.common.bidi.cdp @@ -103,7 +106,9 @@ webdriver.common.bidi selenium.webdriver.common.bidi.permissions selenium.webdriver.common.bidi.script selenium.webdriver.common.bidi.session + selenium.webdriver.common.bidi.speculation selenium.webdriver.common.bidi.storage + selenium.webdriver.common.bidi.user_agent_client_hints selenium.webdriver.common.bidi.webextension webdriver.common.fedcm diff --git a/py/private/ruff_check.py b/py/private/ruff_check.py index 34b9f9fd7d75d..be8a1fe849742 100644 --- a/py/private/ruff_check.py +++ b/py/private/ruff_check.py @@ -28,7 +28,7 @@ from python.runfiles import Runfiles ALL_DIRS = ["py", "scripts", "common", "dotnet", "java", "javascript", "rb"] -EXCLUDES = ["**/node_modules/**", "**/.bundle/**", "**/devtools/**"] +EXCLUDES = ["**/node_modules/**", "**/.bundle/**", "**/bidi/**", "**/devtools/**"] def run_check(ruff, exclude_args, dirs, extra_args): diff --git a/py/private/ruff_format.py b/py/private/ruff_format.py index 3ee4c1c9d9bb2..f6c96e9164e3d 100644 --- a/py/private/ruff_format.py +++ b/py/private/ruff_format.py @@ -28,7 +28,7 @@ from python.runfiles import Runfiles ALL_DIRS = ["py", "scripts", "common", "dotnet", "java", "javascript", "rb"] -EXCLUDES = ["**/node_modules/**", "**/.bundle/**", "**/devtools/**"] +EXCLUDES = ["**/node_modules/**", "**/.bundle/**", "**/bidi/**", "**/devtools/**"] def run_format(ruff, exclude_args, dirs, extra_args): diff --git a/py/pyproject.toml b/py/pyproject.toml index a90499f7d83b0..c265b8e844c89 100644 --- a/py/pyproject.toml +++ b/py/pyproject.toml @@ -108,7 +108,6 @@ testpaths = ["test"] # mypy global options [tool.mypy] -exclude = "selenium/webdriver/common/devtools" # The aim in future is we would be able to turn (most) of these flags on # warn about per-module sections in the config file that do not match any files processed. warn_unused_configs = true @@ -137,6 +136,13 @@ warn_return_any = false # Shows a warning when encountering any code inferred to be unreachable after performing type analysis. warn_unreachable = false +[[tool.mypy.overrides]] +module = [ + "selenium/webdriver/common/devtools.*", + "selenium.webdriver.common.bidi.*", +] +ignore_errors = true + [tool.ruff] extend-exclude = [ "selenium/webdriver/common/devtools/", From 300c8e2de5f15ee97d60bdfb7c81439c0538a9d2 Mon Sep 17 00:00:00 2001 From: Corey Goldberg <1113081+cgoldberg@users.noreply.github.com> Date: Sun, 10 May 2026 19:57:49 -0400 Subject: [PATCH 2/2] Change glob to regex --- py/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/pyproject.toml b/py/pyproject.toml index c265b8e844c89..948aba0c104a8 100644 --- a/py/pyproject.toml +++ b/py/pyproject.toml @@ -138,7 +138,7 @@ warn_unreachable = false [[tool.mypy.overrides]] module = [ - "selenium/webdriver/common/devtools.*", + "selenium.webdriver.common.devtools.*", "selenium.webdriver.common.bidi.*", ] ignore_errors = true