[š Feature]: Lint and type-check the Python BiDi modules generated at build time
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- ci-cd, testing-qa
Research direction
Start with py/generate_bidi_protocol.py, py/private/generate_bidi_protocol.bzl, and the py:lint entry point to see how Bazel builds the generated modules and how lint currently runs. Then check the py/pyproject.toml exclusions and the generated errors.py, emulation.py, and common._bidi outputs. Done means the Bazel-built outputs pass ruff check, ruff format --check, and mypy in the lint workflow, with the existing generator output errors fixed.
Written by the indexing model from the issue text.
Description
Description
The common._bidi domain modules generated by py/generate_bidi_protocol.py are never linted or type-checked, in CI or locally. ./go py:lint (the CI Lint job) runs ruff and mypy on the source tree, where those modules are gitignored and absent, and ruff's respect-gitignore = true skips them even after bazel run //py:generate-bidi-protocol writes them there.
While changing which collections.abc names the generator imports, I found that only a unit test of the generator's import logic would catch it emitting an annotation it doesn't import: the modules use from __future__ import annotations, so a missing import doesn't fail at import time either.
What the current output has (ruff 0.17.6):
- 57 ruff errors: 50 RUF036 (
Nonenot last in a union), 6 E501 and 1 I001 inerrors.py. emulation.pyanderrors.pyare notruff formatclean.- mypy passes when the modules are generated into the tree and
//py:mypyis run locally.
The generator's module docstring says "the build applies a format pass", but py/private/generate_bidi_protocol.bzl runs only the generator.
Suggestion: add a check that runs ruff check, ruff format --check and mypy against the Bazel-built //py:create-bidi-protocol-src outputs and include it in ./go py:lint, after fixing the existing errors in the generator so it starts green. The older generated layers (common/bidi, common/devtools) are deliberately excluded from ruff in py/pyproject.toml and are out of scope.
Related: #18378 has the same root cause for the API docs (built from the source tree, so generated modules are never listed).
Have you considered any alternatives or workarounds?
Have ./go py:lint run //py:generate-bidi-protocol first and lint that directory with --no-respect-gitignore. That is smaller, but it checks the working tree rather than what Bazel builds and ships, which is the same gap #18378 describes for the docs.
- Dominant language
- Java
- Stars
- 34.6k
- Forks
- 8.7k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 107
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up ā it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SeleniumHQ/selenium
-
C-py I-defect
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
SeleniumHQ/selenium#18438 Ā·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
SeleniumHQ/selenium#18323 Ā· 1 comment Ā·
Maintainers usually reply within 1 day
-
[š Bug]: Bindings change the user's options when Selenium Manager supplies a browserPossibly taken @Liz-Lian claimed this 2 days ago. OpenC-dotnet C-java C-nodejs C-py C-rb I-defect
Difficulty 4/5 3-5 days Newbie friendliness 45/100
SeleniumHQ/selenium#18428 Ā·
Maintainers usually reply within 1 day
-
[š Bug]: [rust] Selenium Manager can return a browser from the cache before it finishes copyingPossibly taken @Liz-Lian claimed this 2 days ago. OpenC-rust I-defect
Difficulty 3/5 1-2 days Newbie friendliness 65/100
SeleniumHQ/selenium#18427 Ā·
Maintainers usually reply within 1 day
-
C-py D-chrome OS-windows
Difficulty 3/5 1-2 days Newbie friendliness 55/100
SeleniumHQ/selenium#18394 Ā· 1 comment Ā·
Maintainers usually reply within 1 day
All issues in SeleniumHQ/selenium
Similar issues
-
area-integrations
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
? - Needs Triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NVIDIA/cudf-spark-jni#5598 Ā·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
oracle/graalvm-reachability-metadata#12264 Ā·
Maintainers usually reply within 1 day
-
[source-facebook-pages] post stream never returns attachments.media_typePossibly taken @v-k-data claimed this today. Openarea/connectors needs-triage type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
[BUG] AppSync: GetIntrospectionSchema wraps the schema in JSON instead of returning the raw SDL bodyOpen
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
floci-io/floci#10107 Ā· 1 comment Ā·
Maintainers usually reply within 1 day