Skip to content
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5ee10fe
[py] BiDi Python code generation from CDDL
AutomatedTester Feb 13, 2026
a0d4735
fixup
AutomatedTester Feb 27, 2026
06b33cf
fixup
AutomatedTester Feb 28, 2026
12d7ad7
fixup
AutomatedTester Feb 28, 2026
2eb1931
handle comments
AutomatedTester Mar 2, 2026
5307196
[py] Fix Copilot review: license headers, _BiDiEncoder nested types, …
AutomatedTester Mar 2, 2026
22445dc
fixup
AutomatedTester Mar 7, 2026
7e051f8
remove --version call
AutomatedTester Mar 7, 2026
bd13e21
correct web extensions
AutomatedTester Mar 7, 2026
3b61280
Fix webextension and log from comments
AutomatedTester Mar 7, 2026
9548556
Correct usage of dafault_factory
AutomatedTester Mar 7, 2026
8298088
fixing generating extra pass
AutomatedTester Mar 7, 2026
a7f716d
fix window tests
AutomatedTester Mar 7, 2026
dfd366d
fix window tests
AutomatedTester Mar 7, 2026
2c9c14f
correct checks on method arguments
AutomatedTester Mar 11, 2026
7592933
improve generation so we don't need to run ruffs over it
AutomatedTester Mar 11, 2026
d71f7b2
make sure not to generate F401 ruff errors
AutomatedTester Mar 11, 2026
29fb79f
ruffs and mypy fixes
AutomatedTester Mar 11, 2026
645f5be
fix linting
AutomatedTester Mar 11, 2026
00e4540
Fix auth tests
AutomatedTester Mar 13, 2026
2a2ff5e
sort spacing
AutomatedTester Mar 13, 2026
94ab2b4
linting
AutomatedTester Mar 17, 2026
cd6fbaa
handle comments
AutomatedTester Mar 27, 2026
3250f1b
fix tests
AutomatedTester Apr 1, 2026
9b3a2cf
ruffs updates
AutomatedTester Apr 7, 2026
ad1fd00
Update CDDL files and regenerate python files
AutomatedTester Apr 7, 2026
bca421b
ruffs updates
AutomatedTester Apr 7, 2026
5322480
fix test
AutomatedTester Apr 8, 2026
93dffd9
add assert and add failure to chrome
AutomatedTester Apr 8, 2026
6638195
do ruff format
AutomatedTester Apr 8, 2026
818daba
Use sentinel pattern for set viewport
AutomatedTester Apr 9, 2026
cddfecb
formatting sigh
AutomatedTester Apr 9, 2026
3f3b820
more formatting because ruff format isn't enough
AutomatedTester Apr 9, 2026
86a9f45
correct signature
AutomatedTester Apr 9, 2026
8f954b3
more formatting because ruff and ./go format do different things and …
AutomatedTester Apr 9, 2026
c9fe8a4
[py] Use generated Bidi files instead of hand curated ones
AutomatedTester Mar 27, 2026
c7874ea
making sure we don't commit files to that directory again
AutomatedTester Mar 31, 2026
cf5de9e
delete files again
AutomatedTester Apr 15, 2026
4f30f6b
fix formating
AutomatedTester Apr 16, 2026
7936863
Fix how CDP is picked up
AutomatedTester Apr 17, 2026
f35935b
Merge branch 'trunk' into cddl2py_bazel
cgoldberg Apr 17, 2026
686f115
handle comments
AutomatedTester Apr 18, 2026
b71df83
Add newline to make linter pass
cgoldberg Apr 19, 2026
f9ae8e0
Merge branch 'trunk' into cddl2py_bazel
cgoldberg Apr 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ __pycache__
.tox
*.pyc
dist/
py/selenium/webdriver/common/bidi/
py/selenium/webdriver/common/devtools/**/*
!py/selenium/webdriver/common/devtools/util.py
py/selenium/webdriver/common/linux/
Expand Down
9 changes: 6 additions & 3 deletions py/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,11 @@ py_library(
# BiDi protocol support
py_library(
name = "bidi",
srcs = glob(["selenium/webdriver/common/bidi/**/*.py"]),
data = [":mutation-listener"],
srcs = [],
data = [
":create-bidi-src",
Comment thread
AutomatedTester marked this conversation as resolved.
Outdated
":mutation-listener",
],
imports = ["."],
visibility = ["//visibility:public"],
deps = [
Expand Down Expand Up @@ -617,7 +620,7 @@ generate_devtools_latest(
browser_versions = BROWSER_VERSIONS,
)

# Pilot BiDi code generation from CDDL specification
# Generate BiDi source files from CDDL specification
generate_bidi(
name = "create-bidi-src",
cddl_file = "//common/bidi/spec:all.cddl",
Expand Down
7 changes: 5 additions & 2 deletions py/generate_bidi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1699,9 +1699,12 @@ def main(

logger.info(f"Parsed {len(modules)} modules")

# Clean up existing generated files
# Clean up existing generated files.
# Keep static helper modules that are staged by Bazel (for example cdp.py)
# as part of create-bidi-src.extra_srcs.
preserved_python_files = {"py.typed", "cdp.py"}
Comment thread
AutomatedTester marked this conversation as resolved.
for file_path in output_path.glob("*.py"):
if file_path.name != "py.typed" and not file_path.name.startswith("_"):
if file_path.name not in preserved_python_files and not file_path.name.startswith("_"):
file_path.unlink()
logger.debug(f"Removed: {file_path}")

Expand Down
8 changes: 7 additions & 1 deletion py/private/cdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,13 @@ async def _reader_task(self):
try:
data = json.loads(message)
except json.JSONDecodeError:
raise BrowserError({"code": -32700, "message": "Client received invalid JSON", "data": message})
raise BrowserError(
{
"code": -32700,
"message": "Client received invalid JSON",
"data": message,
}
)
logger.debug("Received message %r", data)
if "sessionId" in data:
session_id = devtools.target.SessionID(data["sessionId"])
Expand Down
43 changes: 0 additions & 43 deletions py/selenium/webdriver/common/bidi/__init__.py

This file was deleted.

180 changes: 0 additions & 180 deletions py/selenium/webdriver/common/bidi/_event_manager.py

This file was deleted.

Loading
Loading