Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[py] Update supported Python versions 3.9+ #15018

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from
Open

[py] Update supported Python versions 3.9+ #15018

wants to merge 4 commits into from

Conversation

VietND96
Copy link
Member

@VietND96 VietND96 commented Jan 3, 2025

User description

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Following https://endoflife.date/python, https://devguide.python.org/versions/#versions
Python 3.8 ended Security Support on Oct-7, 2024.
Update supported Python versions 3.9+.

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

Enhancement, Documentation


Description

  • Dropped support for Python 3.8 across the project.

  • Updated minimum required Python version to 3.9.

  • Adjusted documentation to reflect updated Python support.

  • Updated configuration files to align with new Python version requirements.


Changes walkthrough 📝

Relevant files
Enhancement
BUILD.bazel
Update supported Python versions in Bazel build file         

py/BUILD.bazel

  • Removed Python 3.8 from supported versions.
  • Added Python 3.13 to supported versions.
  • Updated python_requires to require Python 3.9 or higher.
  • +2/-2     
    pyproject.toml
    Adjust Python version requirements in pyproject.toml         

    py/pyproject.toml

  • Updated requires-python to ~=3.9.
  • Removed Python 3.8 from classifiers.
  • +1/-2     
    Documentation
    index.rst
    Update documentation for supported Python versions             

    py/docs/source/index.rst

  • Updated documentation to reflect Python 3.9+ support.
  • Removed reference to Python 3.8.
  • +1/-1     
    Configuration changes
    tox.ini
    Update tox configuration for Python 3.9+                                 

    py/tox.ini

  • Updated flake8 configuration to require Python 3.9 or higher.
  • Adjusted linting commands to align with new Python version.
  • +2/-2     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link
    Contributor

    qodo-merge-pro bot commented Jan 3, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

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

    Version Compatibility

    Adding Python 3.13 classifier while it's still in alpha/beta stage might be premature. Consider waiting for stable release.

    "Programming Language :: Python :: 3.13",

    Copy link
    Contributor

    qodo-merge-pro bot commented Jan 3, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    General
    Ensure consistent Python version support declarations across configuration files

    Add Python 3.13 classifier to maintain consistency with BUILD.bazel which already
    includes Python 3.13 support.

    py/pyproject.toml [12-25]

     classifiers = [
         "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",
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: The suggestion correctly identifies an inconsistency between BUILD.bazel and pyproject.toml regarding Python 3.13 support. Adding the Python 3.13 classifier in pyproject.toml is important for maintaining version support consistency across project configuration files.

    8

    Copy link
    Member

    @p0deje p0deje left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    You also need to bump in

    selenium/MODULE.bazel

    Lines 112 to 115 in ee8c6f4

    python.toolchain(
    is_default = True,
    python_version = "3.8",
    )

    @p0deje p0deje requested a review from AutomatedTester January 3, 2025 16:22
    @p0deje
    Copy link
    Member

    p0deje commented Jan 3, 2025

    @AutomatedTester What is our approach to EOL Python versions?

    Copy link
    Contributor

    qodo-merge-pro bot commented Jan 3, 2025

    CI Failure Feedback 🧐

    (Checks updated until commit 5ad5136)

    Action: Python / Browser Tests (safari, macos) / Integration Tests (safari, macos)

    Failed stage: Post Setup Bazel with caching [❌]

    Failure summary:

    The action failed during the cache saving process. Specifically:

  • The cache upload operation encountered an error while trying to read a directory
  • The error message indicates "EISDIR: illegal operation on a directory, read"
  • This appears to be an issue with the Bazel cache saving mechanism trying to perform an invalid read
    operation on a directory instead of a file

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  macOS
    ...
    
    601:  //py:test-safari-test/selenium/webdriver/safari/launcher_tests.py        �[0m�[32mPASSED�[0m in 8.6s
    602:  �[0m
    603:  //py:test-safari-test/selenium/webdriver/safari/safari_service_tests.py  �[0m�[32mPASSED�[0m in 1.4s
    604:  Executed 2 out of 2 tests: 2 tests pass.
    605:  There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.
    606:  Post job cleanup.
    607:  ##[group]Save cache for repository
    608:  [command]/opt/homebrew/bin/gtar --posix -cf cache.tzst --exclude cache.tzst -P -C /Users/runner/work/selenium/selenium --files-from manifest.txt --delay-directory-restore --use-compress-program zstdmt
    609:  ##[warning]Failed to save: uploadChunk (start: 469762048, end: 503316479) failed: read ECONNRESET
    610:  Successfully saved cache
    611:  ##[endgroup]
    612:  /Users/runner/work/_actions/bazel-contrib/setup-bazel/0.9.1/dist/node_modules/@actions/cache/lib/internal/cacheHttpClient.js:226
    613:  throw new Error(`Cache upload failed because file read failed with ${error.message}`);
    614:  ^
    615:  Error: Cache upload failed because file read failed with EISDIR: illegal operation on a directory, read
    616:  at ReadStream.<anonymous> (/Users/runner/work/_actions/bazel-contrib/setup-bazel/0.9.1/dist/node_modules/@actions/cache/lib/internal/cacheHttpClient.js:226:1)
    617:  at ReadStream.emit (node:events:519:28)
    618:  at emitErrorNT (node:internal/streams/destroy:169:8)
    619:  at errorOrDestroy (node:internal/streams/destroy:238:7)
    

    ✨ CI feedback usage guide:

    The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
    The tool analyzes the failed checks and provides several feedbacks:

    • Failed stage
    • Failed test name
    • Failure summary
    • Relevant error logs

    In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

    /checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
    

    where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

    Configuration options

    • enable_auto_checks_feedback - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
    • excluded_checks_list - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
    • enable_help_text - if set to true, the tool will provide a help message with the feedback. Default is true.
    • persistent_comment - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
    • final_update_message - if persistent_comment is true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.

    See more information about the checks tool in the docs.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants