-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
fix for conda install of selenium-manager #12536
fix for conda install of selenium-manager #12536
Conversation
I think looking everywhere on PATH for a selenium-manager binary is sub-optimal.
Would it be possible to move the binary to that directory from where conda is putting it? |
I don't really know anything about how conda handles stuff in the background. And I guess there's an issue if But I think forcing people to manually move something is just as bad, or possibly even worse, than searching the path. How would you even alert people that they need to do this? I think a better route would be to remove the newer packages from conda instead, since this is such a mess. It took me hours to finally find something useful about why my code was no longer working (in a new conda environment, which I guess grabbed a newer version of selenium than my other environments). If conda only has the older versions, then this won't be an issue. Also, why do you dislike searching the path? Does it really matter whether selenium-manager was installed via conda or pip or manually? |
Agree about the manual moving not being a valid fix, I guess I was thinking there might be a way for the package to automate that, but I'm sure that's not how it works. As for PATH, thought is if someone downloads an old version and puts it somewhere on PATH it could cause a problem. If we did that, I'd want to be checking the version just to be sure, which seems a pain |
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## trunk #12536 +/- ##
==========================================
+ Coverage 57.26% 57.29% +0.03%
==========================================
Files 86 86
Lines 5335 5339 +4
Branches 198 198
==========================================
+ Hits 3055 3059 +4
Misses 2082 2082
Partials 198 198
☔ View full report in Codecov by Sentry. |
SHOULD work, for now, but it seems like a bit of a hack. I can change it to that if you like it better. As for having conda change how it's installed, I don't know who makes those scripts or how to get them changed. |
@symonk any preferences for this? |
Yes, I want us to log that we've detected a Conda installation and look in a specific place. |
@stevetracvc can you update this PR for that? I'd appreciate it. Want to try to get out a release with bug fixes for all the SM stuff "soon." |
sorry, I tried to rebase but it didn't work for some reason so I tried from github and that merged upstream instead |
conda doesn't seem to properly package selenium-manager, so it needs to be install as a separate package (via conda). But this puts it in the environment's bin folder. This commit checks the path for the selenium-manager executable if it isn't installed in the package's webdriver/common/<platform>/ folder. fixes SeleniumHQ#11234 and SeleniumHQ#12084
28c7687
to
7de1fba
Compare
Sorry, I'm not a developer so I don't rebase much. I think I fixed it 😆 |
Don't worry about the rebasing, Github can manage it; if there's a conflict you need to fix, we can let you know. :) |
This is a useful thing to support Conda users. Many conda users use Selenium to scrape data from the web or automate other tasks. |
@stevetracvc thank you for this! |
No prob @titusfortner Though one thing I thought of this morning, 'selenium-manager' package should either be listed as a requirement on conda, or there needs to be additional info on https://anaconda.org/conda-forge/selenium stating that selenium-manager needs to be installed separately. I'm submitting an issue over at https://github.com/conda-forge/selenium-feedstock/ as I think that's where they do the builds |
Hey folks! 👋
Back to
With the above said, we also try to minimize the number of builds/tests of, specifically, python packages, and the amount of "special" things done at installation time:
The expected location in We're certainly open to other approaches that meet the above pattern, and can mark the Some concrete suggestions:
|
@bollwyvl thanks for coming over here. I probably should have reached out to conda-forge earlier, but I honestly didn't know about conda feedstock until about an hour ago. In regards to your using the PATH, we had a discussion and they're concerned about out-of-sync versions between selenium and selenium-manager. Since conda-forge selenium-manager installs to the environment's bin folder, is there a reason you prefer searching the path instead of using |
Thanks @bollwyvl Caveat: I'm not a python dev and don't really understand conda.
There aren't drivers for those architectures, so selenium itself won't work without manual effort by the user to compile their own things. Can you make inclusion conditional on supported architectures?
Not sure how this works. Does it help if the license is identical to the Selenium package itself?
Would it be easier or harder for conda to use Further, the location of $HOME/.cache will be adjustable by env SE_CACHE_PATH
fwiw, we still consider this a beta feature and do not guarantee backwards compatible API, so on our end we're not worried about how older versions are supported. /shrug I'm hoping that what we have with this PR is a good short term solution and that we can coordinate a better long term solution when we implement the caching. |
It is more akin to a Linux distribution package manager: basically, a (linux) machine needs a compatible
Yep, we can ship a variant (but only two total builds) that does not require
After a
When at all possible, So if cache dirs became the only way to do this, we'd probably patch it to At any rate, if looking at doing this, I highly recommend using something like
In my ideal world, the browser drivers, would, like Practically, of course, this is not the case, especially for the spawn of Chromium. But generally, I really don't like runtime downloading, and will go out of my way to patch around it when it's remotely (har) possible. |
🤣
Our solution needs to be implemented in 5 different languages, and we're trying to keep things as simple as possible across the implementations.
We're using this scheme because it is the XDG specification for user-specific data:
We can't assume that a Selenium user has elevated permissions on the platform.
There's a reason we resisted it for a long time. But our "competitors" don't require extra management when starting to use the project, and Intro to Selenium workshops were a nightmare to get started. Somehow we have to provide an equivalent out of the box experience and this is the best approach we've come up with.
I'm assuming you've seen the new Chrome for Testing binaries that make managing the versions much more straightforward? |
Oh indeed: on
Right,
Right, see above for being able to build reproducible, non-privileged installers.
Yep, broke a bunch of pipelines, and requires yet another language runtime to be used in the documented way, and downloads a bunch of random binaries at runtime. This is large reason I personally have only taken the time to help maintain |
I feel like we're speaking past each other on some of these things. Are we agreed that we can figure out a more sustainable solution for selenium manager in conda if we cache the binary? You seemed to have suggested that You recommended
Sure, except that requires users to adapt to your solution rather than adapting a solution to the users. We're open to exploring alternatives here, but I think our requirements/limitations are different, and I can't tell what exactly we might want to change that works better for both of us. |
@bollwyvl to follow up, we ended up deciding that your third suggestion was the right way for us to go. Selenium 4.13+ will first look for a binary at |
I have some doubts about the 'bin' here, and I'm not sure what I changed, but when I downloaded it, selenium-manager was in another path.
Simply changing 'bin' to 'Scripts' makes it work fine on my term. |
Accessing CONDA_PREFIX in os.environ fails with a KeyError when it is not set. The condition should instead check for the existence of the key, before accessing it in the following codepath Fixes: d4285d1 ("fix for conda install of selenium-manager (SeleniumHQ#12536)")
Description
conda doesn't seem to properly package selenium-manager, so it needs to be install as a separate package (via conda). But this puts it in the environment's bin folder.
This commit checks the path for the selenium-manager executable if it isn't installed in the package's webdriver/common// folder.
Also, I tried running the existing tests but all of the remote tests failed, and two of the browser tests failed for trunk (only one failed for my branch).
Motivation and Context
fixes #11234 and #12084
Types of changes
Checklist