Skip to content

[py] Drop Python 3.10 support - #18236

Open
cgoldberg wants to merge 4 commits into
SeleniumHQ:trunkfrom
cgoldberg:drop-py310
Open

cgoldberg wants to merge 4 commits into
SeleniumHQ:trunkfrom
cgoldberg:drop-py310

Conversation

@cgoldberg

@cgoldberg cgoldberg commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

💥 What does this PR do?

Note: hold off on merging this until we can verify this won't affect a large amount of users trying to upgrade or install.

Python 3.10 is now EOL and will no longer receive security updates. This PR drops support for Python 3.10 in the selenium package and moves the base toolchain for Bazel to 3.11.

Since #18065 was merged to add support for Python 3.15, this change follows our practice of supporting only the five active, non-EOL Python versions (3.11-3.15).

This allows us to upgrade dependencies and tooling to versions that no longer support 3.10. It removes a compatibility constraint on dependency updates and makes it easier to benefit from newer releases, including security fixes.

  • updated packaging to requires-python = ">=3.11"
  • updated rules_python to latest
  • updated all direct runtime and dev dependencies to latest versions supported by 3.11
  • generated new requirements.txt with updated dependencies
  • generated new requirements_lock.txt with pinned dependencies
  • dropped typing_extensions as a runtime dependency and removed the last reference of it in code since all type annotations we use are now included in 3.11+ standard library.

🔧 Implementation Notes

  • the update to rules_python changed the bootstrap's sys.path handling so the Python runtime is added from runfiles rather than from the underlying Bazel repository cache. I updated pdl_to_json to inlude imports = ["."] so it still works.
  • the upgrade to certifi in runtime dependencies guarantees users don't have an older version that contains recently revoked certs.

💡 Additional Considerations

  • Python 3.11 introduced a StrEnum class and now ruff complains we are not using it (UP042). I decided to add that to the ignore rules for now and will possibly fix it with a refactor sometime later. Replacing class Foo(str, Enum) with Foo(StrEnum) can change runtime behavior, particularly the string representation of enum members.

🤖 AI assistance

  • No substantial AI assistance used

🔄 Types of changes

  • Build/CI/packaging

@cgoldberg cgoldberg self-assigned this Oct 24, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@selenium-ci

Copy link
Copy Markdown
Member

/agentic_describe

@selenium-ci

Copy link
Copy Markdown
Member

/agentic_review

@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 Oct 24, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Drop Python 3.10 support and move Bazel to Python 3.11

⚙️ Configuration changes ✨ Enhancement 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Require Python 3.11 or newer across Selenium packaging, Bazel toolchains, and documentation.
• Refresh Python dependencies and tooling, including a newer certifi minimum and regenerated
 lockfile.
• Preserve PDL conversion under updated Bazel Python rules and use the standard-library Self type.
Diagram

graph TD
  A["Bazel module"] --> B["Python toolchains"] --> C["Bazel targets"] --> D["PDL converter"]
  E["Dependency inputs"] --> F["Python lockfile"] --> C
  G["Package metadata"] --> H["Selenium wheel"]
  E --> G
  C --> H
Loading
High-Level Assessment

Coordinating the version floor across package metadata, Bazel toolchains, dependency inputs, and documentation is the appropriate approach; changing packaging alone would leave builds inconsistent. Keeping the existing str/Enum classes avoids a separate runtime-behavior change.

Files changed (11) +137 / -198

Enhancement (1) +1 / -3
webdriver.pyImport Self from the Python standard library +1/-3

Import Self from the Python standard library

• Replaces the typing_extensions import of Self with typing.Self, available at the new Python 3.11 minimum.

py/selenium/webdriver/remote/webdriver.py

Bug fix (1) +1 / -0
BUILD.bazelPreserve local imports for the PDL converter +1/-0

Preserve local imports for the PDL converter

• Adds the converter's package directory to its Bazel import path so it can still import the adjacent pdl module under the updated Python rules.

common/devtools/BUILD.bazel

Documentation (3) +5 / -5
AGENTS.mdSet Python 3.11 as the contributor guidance minimum +3/-3

Set Python 3.11 as the contributor guidance minimum

• Updates compatibility and terminal-command examples to use Python 3.11 or newer.

py/AGENTS.md

index.rstDocument the new supported Python versions +1/-1

Document the new supported Python versions

• Changes the published minimum supported Python version from 3.10 to 3.11.

py/docs/source/index.rst

bidi_enhancements_manifest.pyUpdate BiDi generator compatibility guidance +1/-1

Update BiDi generator compatibility guidance

• Revises the module documentation to specify Python 3.11+ compatibility.

py/private/bidi_enhancements_manifest.py

Other (6) +130 / -190
MODULE.bazelMake Python 3.11 the default Bazel toolchain +2/-4

Make Python 3.11 the default Bazel toolchain

• Upgrades rules_python to 2.4.5, removes the Python 3.10 toolchain and pip resolution, and makes Python 3.11.15 the default.

MODULE.bazel

BUILD.bazelRequire Python 3.11 in Bazel wheel metadata +2/-3

Require Python 3.11 in Bazel wheel metadata

• Removes the Python 3.10 classifier, raises the wheel's Python minimum to 3.11, and raises its certifi minimum to 2026.10.23.

py/BUILD.bazel

pyproject.tomlRaise package and Ruff Python targets to 3.11 +4/-4

Raise package and Ruff Python targets to 3.11

• Raises the package Python and certifi minimums, removes the Python 3.10 classifier, and targets Python 3.11 in Ruff. Suppresses UP042 rather than changing str/Enum inheritance as part of this migration.

py/pyproject.toml

requirements.txtRefresh direct Python development requirements +11/-11

Refresh direct Python development requirements

• Raises version ranges for development and selected platform-specific requirements, including Sphinx, tox, twine, and cryptography, for the Python 3.11 baseline.

py/requirements.txt

requirements_lock.txtRegenerate dependency pins with Python 3.11 +109/-165

Regenerate dependency pins with Python 3.11

• Records Python 3.11 as the resolver version and refreshes pinned packages and hashes. The changes include certifi 2026.10.23 and newer documentation and publishing dependencies.

py/requirements_lock.txt

tox.iniRefresh validation and linting tools +2/-3

Refresh validation and linting tools

• Upgrades validate-pyproject and Ruff, enables validate-pyproject's all extra, and removes the separate packaging pin from the validation environment.

py/tox.ini

@cgoldberg cgoldberg removed the B-devtools Includes everything BiDi or Chrome DevTools related label Oct 24, 2026
@qodo-code-review

qodo-code-review Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Action required

1. Python 3.10 users lose upgrades 📘 Rule violation ≡ Correctness
Description
The package metadata now requires Python 3.11 or newer, removing installation compatibility for
Python 3.10 without a prior deprecation notice or migration alternative. The new requirement appears
in both the project metadata and wheel metadata, so Python 3.10 users are blocked from installing
upgraded Selenium releases.
Code

py/pyproject.toml[12]

+requires-python = ">=3.11"
Evidence
The checklist requires public compatibility to be preserved by default and requires public
functionality slated for removal to be deprecated with an alternative. The PR changes the package
and wheel minimum from Python 3.10 to Python 3.11 and updates the supported-version documentation,
directly removing Python 3.10 support without any deprecation message or alternative.

AGENTS.md: Preserve Public API and ABI Compatibility and Deprecate Before Removal
py/pyproject.toml[12-12]
py/BUILD.bazel[669-669]
py/docs/source/index.rst[33-33]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The package now rejects Python 3.10 through its required Python version metadata, removing public compatibility without first communicating a deprecation and alternative to affected users.

## Fix Focus Areas
- py/pyproject.toml[12-12]
- py/BUILD.bazel[669-669]
- py/docs/source/index.rst[33-33]

## Recommended Fix
Either retain Python 3.10 compatibility for this release, or introduce a prior deprecation release with a clear warning and migration guidance before enforcing the Python 3.11 minimum in package and wheel metadata.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗



Remediation recommended

2. Python 3.11-only releases go unseen ✓ Resolved
Description
pyproject.toml now requires Python 3.11, but renovate.json still configures Python 3.10 with
strict compatibility filtering. When a dependency release requires Python 3.11 or newer, Renovate
can exclude it from automated update proposals even though the package now supports it.
Code

py/pyproject.toml[12]

+requires-python = ">=3.11"
Evidence
The new package floor conflicts with Renovate's configured Python 3.10 constraint. Renovate
documents that strict filtering holds back releases incompatible with the configured language
constraint and that configured constraints can override constraints detected from the project.

py/pyproject.toml[12-12]
renovate.json[19-25]
renovate.json[46-50]
🌐 Strict compatibility filtering can hold back dependency releases based on the language constraint, and manually configured constraints can differ from those declared by the project.
🌐 Renovate describes configured language constraints as taking priority over constraints extracted from repository files during version lookup.

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The package now requires Python 3.11, while Renovate still filters dependency releases using Python 3.10 compatibility and limits Python runtime proposals to versions below 3.11.

## Fix Focus Areas
- py/pyproject.toml[12-12]
- renovate.json[19-25]
- renovate.json[46-50]

## Recommended Fix
Change Renovate's Python constraint and runtime-update limit to reflect the supported Python versions, and update the associated policy description.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: Auto: ⚖️ Balanced: Packaging dependency removal and toolchain updates carry release-impacting risk.

Grey Divider

Tip of the day
💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit c77376b ⚖️ Balanced

Results up to commit 3ea28f0 ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. Python 3.10 users lose upgrades 📘 Rule violation ≡ Correctness
Description
The package metadata now requires Python 3.11 or newer, removing installation compatibility for
Python 3.10 without a prior deprecation notice or migration alternative. The new requirement appears
in both the project metadata and wheel metadata, so Python 3.10 users are blocked from installing
upgraded Selenium releases.
Code

py/pyproject.toml[12]

+requires-python = ">=3.11"
Evidence
The checklist requires public compatibility to be preserved by default and requires public
functionality slated for removal to be deprecated with an alternative. The PR changes the package
and wheel minimum from Python 3.10 to Python 3.11 and updates the supported-version documentation,
directly removing Python 3.10 support without any deprecation message or alternative.

AGENTS.md: Preserve Public API and ABI Compatibility and Deprecate Before Removal
py/pyproject.toml[12-12]
py/BUILD.bazel[669-669]
py/docs/source/index.rst[33-33]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The package now rejects Python 3.10 through its required Python version metadata, removing public compatibility without first communicating a deprecation and alternative to affected users.

## Fix Focus Areas
- py/pyproject.toml[12-12]
- py/BUILD.bazel[669-669]
- py/docs/source/index.rst[33-33]

## Recommended Fix
Either retain Python 3.10 compatibility for this release, or introduce a prior deprecation release with a clear warning and migration guidance before enforcing the Python 3.11 minimum in package and wheel metadata.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗



Remediation recommended
2. Python 3.11-only releases go unseen ✓ Resolved
Description
pyproject.toml now requires Python 3.11, but renovate.json still configures Python 3.10 with
strict compatibility filtering. When a dependency release requires Python 3.11 or newer, Renovate
can exclude it from automated update proposals even though the package now supports it.
Code

py/pyproject.toml[12]

+requires-python = ">=3.11"
Evidence
The new package floor conflicts with Renovate's configured Python 3.10 constraint. Renovate
documents that strict filtering holds back releases incompatible with the configured language
constraint and that configured constraints can override constraints detected from the project.

py/pyproject.toml[12-12]
renovate.json[19-25]
renovate.json[46-50]
🌐 Strict compatibility filtering can hold back dependency releases based on the language constraint, and manually configured constraints can differ from those declared by the project.
🌐 Renovate describes configured language constraints as taking priority over constraints extracted from repository files during version lookup.

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The package now requires Python 3.11, while Renovate still filters dependency releases using Python 3.10 compatibility and limits Python runtime proposals to versions below 3.11.

## Fix Focus Areas
- py/pyproject.toml[12-12]
- renovate.json[19-25]
- renovate.json[46-50]

## Recommended Fix
Change Renovate's Python constraint and runtime-update limit to reflect the supported Python versions, and update the associated policy description.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Results up to commit 3ba1e07 🚀 Fast


No changes from previous review

Results up to commit 1f82a13 🚀 Fast


No changes from previous review

Grey Divider

Qodo Logo

Comment thread py/pyproject.toml
Comment thread py/pyproject.toml
@selenium-ci

Copy link
Copy Markdown
Member

/agentic_review

@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 3ba1e07

@selenium-ci

Copy link
Copy Markdown
Member

/agentic_review

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 1f82a13

@selenium-ci

Copy link
Copy Markdown
Member

/agentic_review

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit c77376b

@cgoldberg cgoldberg changed the title Drop Python 3.10 support [py] Drop Python 3.10 support Oct 25, 2026

This branch has not been deployed

No deployments
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 C-py Python Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants