Skip to content

Conversation

cgoldberg
Copy link
Member

@cgoldberg cgoldberg commented Sep 21, 2025

User description

💥 What does this PR do?

This PR adds support for the upcoming Python 3.14 release (expected 10/7/2025): https://docs.python.org/3.14/whatsnew/3.14.html

This PR also drops support for Python 3.9. This version is officially EOL as of 10/31/2025. Some of our dependencies have already dropped support for 3.9 and it is becoming problematic to continue supporting it.

This PR also changes the default version of Python we use in CI to 3.10 and updates all Python dependencies for testing and packaging.

I am marking this as a draft until the official release. Hopefully Bazel's rules_python will be updated soon (https://github.com/bazel-contrib/rules_python) to support this.

💡 Additional Considerations

We only run tests in CI against the oldest supported Python version, so someone should run all tests locally with 3.14 to make sure all tests and dependencies work fine before merging this.

🔄 Types of changes

  • Build/Packaging

PR Type

Enhancement


Description

  • Add Python 3.14 support to Bazel toolchain configuration

  • Update package metadata and classifiers for Python 3.14

  • Modify Python version requirement from ~=3.9 to >=3.9


Diagram Walkthrough

flowchart LR
  A["Python 3.9-3.13"] --> B["Add Python 3.14"]
  B --> C["Update Bazel toolchain"]
  B --> D["Update package metadata"]
  B --> E["Relax version constraint"]
Loading

File Walkthrough

Relevant files
Configuration changes
MODULE.bazel
Add Python 3.14 Bazel toolchain support                                   

MODULE.bazel

  • Add Python 3.14 toolchain configuration
  • Include 3.14 in pip requirements parsing
+2/-0     
BUILD.bazel
Update wheel classifiers for Python 3.14                                 

py/BUILD.bazel

  • Add "Programming Language :: Python :: 3.14" classifier
+1/-0     
pyproject.toml
Update Python version requirements and classifiers             

py/pyproject.toml

  • Change requires-python from "~=3.9" to ">=3.9"
  • Add Python 3.14 classifier
+2/-1     

@cgoldberg cgoldberg marked this pull request as draft September 21, 2025 21:20
@selenium-ci selenium-ci added C-py Python Bindings B-build Includes scripting, bazel and CI integrations labels Sep 21, 2025
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Build Matrix Consistency

Ensure CI/build configurations (Bazel toolchains, pip parse hub, and any test matrix) consistently include Python 3.14 and that the referenced rules_python version actually supports 3.14 to avoid resolution or toolchain selection failures.

python.toolchain(python_version = "3.14")
use_repo(python, "pythons_hub")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")

[
    pip.parse(
        hub_name = "py_dev_requirements",
        python_version = version,
        requirements_lock = "//py:requirements_lock.txt",
    )
    for version in [
        "3.9",
        "3.10",
        "3.11",
        "3.12",
        "3.13",
        "3.14",
    ]
]
Version Constraint Change

Relaxing requires-python to ">=3.9" broadens supported versions; verify this aligns with policy and that packaging/CI wheels and metadata remain correct for all versions, including future 3.x, to avoid unintended installs.

requires-python = ">=3.9"
classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Intended Audience :: Developers",
    "Operating System :: POSIX",
    "Operating System :: Microsoft :: Windows",
    "Operating System :: MacOS :: MacOS X",
    "Topic :: Software Development :: Testing",
    "Topic :: Software Development :: Libraries",
    "Programming Language :: Python",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Programming Language :: Python :: 3.14",
    ]

Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Restrict Python version to avoid issues

Add an upper bound to the requires-python specifier to prevent future
compatibility issues, changing it from ">=3.9" to ">=3.9, <4.0".

py/pyproject.toml [12]

-requires-python = ">=3.9"
+requires-python = ">=3.9, <4.0"
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies that requires-python = ">=3.9" is too permissive and could cause future installation issues with Python 4.0, proposing a safer upper bound which is a packaging best practice.

Low
  • More

@cgoldberg cgoldberg changed the title [py] Support Python 3.14 [py] Support Python 3.14 and drop Python 3.9 Oct 5, 2025
@cgoldberg
Copy link
Member Author

@shbenzer @navin772 Do you see any issues with dropping support for Python 3.9?

@navin772
Copy link
Member

navin772 commented Oct 5, 2025

No issues if the CI passes with 3.10, which it does, there seems to be a minor issue with docs and mypy CI, it is looking for python 3.1 instead of 3.10.

@shbenzer
Copy link
Contributor

shbenzer commented Oct 5, 2025

I agree w/ @navin772, as long as we can fully support the next up I'd like to keep us from supporting anything not supported by the Python project. To answer your question directly though, I am not aware of any issues w/ dropping 3.9 specifically.

@cgoldberg
Copy link
Member Author

it is looking for python 3.1 instead of 3.10.

Fixed.

I'll merge this in a few days after 3.14 is officially released.

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 Review effort 2/5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants