SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.42k stars 8.15k forks source link

[py] moved project metadata from `setup.py` to `pyproject.toml` #14311

Open sandeepsuryaprasad opened 2 months ago

sandeepsuryaprasad commented 2 months ago

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

Motivation and Context

Types of changes

Checklist


PR Type

Enhancement


Description


Changes walkthrough 📝

Relevant files
Enhancement
setup.py
Removed project metadata from `setup.py`.                               

py/setup.py
  • Removed project metadata such as name, version, license, description,
    URLs, classifiers, packages, and dependencies.
  • Retained custom installation command and Rust extensions
    configuration.
  • +0/-57   
    pyproject.toml
    Added project metadata to `pyproject.toml`.                           

    py/pyproject.toml
  • Added project metadata including name, version, license, description,
    readme, Python requirements, classifiers, and dependencies.
  • Defined package inclusion and exclusion rules.
  • Added project URLs for repository, bug tracker, changelog,
    documentation, and source code.
  • +44/-0   

    💡 PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    codiumai-pr-agent-pro[bot] commented 2 months ago

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No key issues to review
    codiumai-pr-agent-pro[bot] commented 2 months ago

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Possible bug
    Correct the format of the RustExtension key to use a string instead of a dictionary ___ **The dictionary key for the RustExtension is incorrectly formatted as a dictionary
    itself. It should be a string representing the name of the extension.** [py/setup.py [32]](https://github.com/SeleniumHQ/selenium/pull/14311/files#diff-722aeeec2821793eb6adf0c529cc7439c4b27ce78937cbb8840e94d4fc1c4017R32-R32) ```diff -RustExtension( - {"selenium-manager": "selenium.webdriver.common.selenium-manager"} +RustExtension("selenium-manager", "selenium.webdriver.common.selenium-manager") ``` - [ ] **Apply this suggestion**
    Suggestion importance[1-10]: 10 Why: The suggestion corrects a potential bug by changing the dictionary key to a string, which is the correct format for the RustExtension.
    10
    Best practice
    Specify a precise Python version range in requires-python to avoid including future, potentially unsupported versions ___ **The requires-python field should specify a range that includes only the supported
    versions, not using the tilde approximation which might unintentionally include
    future, unsupported Python versions.** [py/pyproject.toml [11]](https://github.com/SeleniumHQ/selenium/pull/14311/files#diff-3adb340b5a499e26b04507d972c31f5cf6fc27a6d81e3f7b547bf50e90c43be3R11-R11) ```diff -requires-python = "~=3.8" +requires-python = ">=3.8, <3.13" ``` - [ ] **Apply this suggestion**
    Suggestion importance[1-10]: 8 Why: This suggestion improves the precision of the Python version range, ensuring compatibility and preventing future unsupported versions from being included.
    8
    Adjust the version constraint for urllib3 to allow for minor updates within the same major version ___ **The dependency version for urllib3 should allow for minor updates within a major
    version, rather than restricting to a minor version range.** [py/pyproject.toml [29]](https://github.com/SeleniumHQ/selenium/pull/14311/files#diff-3adb340b5a499e26b04507d972c31f5cf6fc27a6d81e3f7b547bf50e90c43be3R29-R29) ```diff -"urllib3[socks]>=1.26,<3" +"urllib3[socks]>=1.26,<2" ``` - [ ] **Apply this suggestion**
    Suggestion importance[1-10]: 7 Why: Allowing minor updates within the same major version for `urllib3` can improve compatibility and security by including minor updates and patches.
    7
    Enhancement
    Enable namespace packaging if the packages are part of a namespace ___ **The namespace field in the [tool.setuptools.packages.find] section should be set to
    true if the packages are intended to be part of a namespace package.** [py/pyproject.toml [40]](https://github.com/SeleniumHQ/selenium/pull/14311/files#diff-3adb340b5a499e26b04507d972c31f5cf6fc27a6d81e3f7b547bf50e90c43be3R40-R40) ```diff -namespace = false +namespace = true ``` - [ ] **Apply this suggestion**
    Suggestion importance[1-10]: 6 Why: This suggestion is contextually accurate but should be verified if the packages are indeed part of a namespace. If not, this change could introduce issues.
    6
    sandeepsuryaprasad commented 1 month ago

    @AutomatedTester could you review this PR please. Thanks!