Closed iampopovich closed 1 day ago
β±οΈ Estimated effort to review [1-5] | 1 |
π§ͺ Relevant tests | No |
π Security concerns | No |
β‘ Key issues to review | None |
Category | Suggestion | Score |
Best practice |
Use a version range for the new dependency to allow for minor updates and patches___ **Consider using a version range forwebsocket-client instead of pinning it to a specific version. This can help avoid dependency conflicts and allow for minor updates and patches.** [py/setup.py [80]](https://github.com/SeleniumHQ/selenium/pull/14187/files#diff-722aeeec2821793eb6adf0c529cc7439c4b27ce78937cbb8840e94d4fc1c4017R80-R80) ```diff -"websocket-client==1.8.0", +"websocket-client>=1.8.0,<2.0.0", ``` - [ ] **Apply this suggestion** Suggestion importance[1-10]: 7Why: Using a version range instead of a specific version for dependencies can indeed help in managing minor updates and avoiding conflicts, which is a good practice in dependency management. | 7 |
@titusfortner I also noticed that the build script py/BUILD.bazel
uses a loose requirement for the version of websocket-client
. Should we enforce version 1.8.0 consistently across the entire project?
I agree they should all probably match.
I don't know how python does things. In ruby if it is a transitive dependency, we leave the requirements loose to give the user more flexibility. I'm not sure if that matters here.
I don't know how python does things.
It depends on the build system.
With pip
, if there's a conflict between libraries, the package manager will attempt to install the most suitable dependency that satisfies all requirements and avoids conflicts. Otherwise, developers will need to resolve dependency conflicts manually. In our case bazel uses pip to install requirements as it described here
poetry
, creates groups for dependencies, installing only versions that satisfy its requirements.
The more loose requirements there are, the more flexibility the build system has to assemble a "working" configuration without conflicts. Managing a strictly defined set of dependencies that are tested thoroughly during build and testing phases makes configuration management easier. Updating dependencies becomes a more manageable process.
Potentially, we might encounter version conflicts if other dependencies require websocket-client
>= 1.8.0. I suggest trying to use version 1.8.0 and observing the build results.
@titusfortner cc
I also noticed that the setup.py
file does not include packages introduced after 2011, such as Safari (introduced in 2015). Should we add the missing packages to the packages
section? And webdriver.support introduced twice
Python has had a lot of different fingers in the pot over the years, it is not surprising that there are things that have been missed as different people add things. Yes, please, update the things that make sense. Thanks.
@titusfortner I made changes to match dependencies in setup.py and BUILD.bazel. I think we should freeze dependencies to specific versions separately if needed later on. Right now, there are differences in library versions: for instance, py/BUILD.bazel
uses 'trio~=0.17' in the 'requires' section, but py/requirements.txt
uses 'trio>=0.20.2'. Maybe we should set up a single place for dependencies to get consistent information.
What do you suggest? I wish I knew more about bazel python rules in general.
@titusfortner I propose to accept the current pull request as is. Improvements for the build and dependencies will be considered later in a separate task. I also need to delve deeper into Bazel build rules
@iampopovich do these happen as part of your tooling or work flow?
I can't see the results of the tests whenever an update is made π
@titusfortner I updated the branch to pull in the latest changes from trunk. If it's not necessary, I'll update the branch locally only.
GitHub will automatically squash & rebase for us, so if there aren't any changes that are likely to cause an issue, it isn't needed to keep merging trunk. It's only an issue because I want to merge it and it shows tests haven't run. π
Thanks for the code!
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
according to request in #14184 websocket-client was added to setup.py version of client the same as in py/requirements.txt
Motivation and Context
Types of changes
Checklist
PR Type
Bug fix, Dependencies
Description
websocket-client
version 1.8.0 to theinstall_requires
list insetup.py
.Changes walkthrough π
setup.py
Add websocket-client dependency to setup.py
py/setup.py
websocket-client
version 1.8.0 to theinstall_requires
list.