Skip to content

Commit

Permalink
Merge pull request #64 from bollwyvl/add-selenium-manager
Browse files Browse the repository at this point in the history
add selenium-manager dependency from conda-forge
  • Loading branch information
ocefpaf authored Aug 10, 2023
2 parents f62e2a4 + f90ae28 commit 98676a8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
26 changes: 26 additions & 0 deletions recipe/0000-find-manager-on-path.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/selenium/webdriver/common/selenium_manager.py b/selenium/webdriver/common/selenium_manager.py
index d62ffaa..f78f60a 100644
--- a/selenium/webdriver/common/selenium_manager.py
+++ b/selenium/webdriver/common/selenium_manager.py
@@ -39,19 +39,8 @@ class SeleniumManager:

:Returns: The Selenium Manager executable location
"""
- platform = sys.platform
-
- dirs = {
- "darwin": "macos",
- "win32": "windows",
- "cygwin": "windows",
- }
-
- directory = dirs.get(platform) if dirs.get(platform) else platform
-
- file = "selenium-manager.exe" if directory == "windows" else "selenium-manager"
-
- path = Path(__file__).parent.joinpath(directory, file)
+ import shutil
+ path = Path(shutil.which("selenium-manager") or shutil.which("selenium-manager.exe"))

if not path.is_file():
raise WebDriverException(f"Unable to obtain working Selenium Manager binary; {path}")
8 changes: 6 additions & 2 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package:
source:
- url: https://pypi.io/packages/source/s/selenium/selenium-{{ version }}.tar.gz
sha256: 9f9a5ed586280a3594f7461eb1d9dab3eac9d91e28572f365e9b98d9d03e02b5
patches:
- 0000-find-manager-on-path.diff
- fn: LICENSE-selenium-{{ version }}
url:
- https://raw.githubusercontent.com/SeleniumHQ/selenium/selenium-{{ version }}-python/LICENSE
Expand All @@ -20,19 +22,20 @@ source:

build:
noarch: python
number: 0
number: 1
script: {{ PYTHON }} -m pip install . -vv --no-deps

requirements:
host:
- python >=3.7
- pip
run:
- certifi >=2021.10.8
- python >=3.7
- selenium-manager {{ version.split('.')[:2] | join('.') }}.*
- trio >=0.17,<1.dev0
- trio-websocket >=0.9,<1.dev0
- urllib3 >=1.26,<3
- certifi >=2021.10.8
test:
requires:
- pip
Expand All @@ -51,6 +54,7 @@ test:
- selenium.webdriver.support
commands:
- pip check
- python -c "from selenium.webdriver.common.selenium_manager import SeleniumManager; assert SeleniumManager.get_binary().exists()"

about:
home: https://www.selenium.dev
Expand Down

0 comments on commit 98676a8

Please sign in to comment.