Skip to content

Commit

Permalink
Merge pull request #2939 from seleniumbase/uc-refactoring-and-depende…
Browse files Browse the repository at this point in the history
…ncies

Refactor UC Mode and refresh dependencies
  • Loading branch information
mdmintz authored Jul 19, 2024
2 parents 83d08d1 + 1bd7c1b commit 924bcf3
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 38 deletions.
6 changes: 3 additions & 3 deletions mkdocs_build/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

regex>=2024.5.15
pymdown-extensions>=10.8.1
pipdeptree>=2.23.0
pipdeptree>=2.23.1
python-dateutil>=2.8.2
Markdown==3.6
markdown2==2.4.13
markdown2==2.5.0
MarkupSafe==2.1.5
Jinja2==3.1.4
click==8.1.7
Expand All @@ -20,7 +20,7 @@ lxml==5.2.2
pyquery==2.0.0
readtime==3.0.0
mkdocs==1.6.0
mkdocs-material==9.5.28
mkdocs-material==9.5.29
mkdocs-exclude-search==0.6.6
mkdocs-simple-hooks==0.1.5
mkdocs-material-extensions==1.3.1
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ charset-normalizer==3.3.2
urllib3>=1.26.19,<2;python_version<"3.10"
urllib3>=1.26.19,<2.3.0;python_version>="3.10"
requests==2.31.0
pynose==1.5.1
pynose==1.5.2
sniffio==1.3.1
h11==0.14.0
outcome==1.3.0.post0
Expand Down Expand Up @@ -64,8 +64,8 @@ beautifulsoup4==4.12.3
pygments==2.17.2;python_version<"3.8"
pygments==2.18.0;python_version>="3.8"
pyreadline3==3.4.1;platform_system=="Windows"
tabcompleter==1.3.0
pdbp==1.5.1
tabcompleter==1.3.3
pdbp==1.5.3
colorama==0.4.6
pyotp==2.9.0
python-xlib==0.33;platform_system=="Linux"
Expand All @@ -78,7 +78,7 @@ rich==13.7.1
# ("pip install -r requirements.txt" also installs this, but "pip install -e ." won't.)

coverage==7.2.7;python_version<"3.8"
coverage>=7.5.4;python_version>="3.8"
coverage>=7.6.0;python_version>="3.8"
pytest-cov==4.1.0;python_version<"3.8"
pytest-cov>=5.0.0;python_version>="3.8"
flake8==5.0.4;python_version<"3.9"
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "4.28.5"
__version__ = "4.28.6"
23 changes: 23 additions & 0 deletions seleniumbase/core/browser_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,29 @@ def install_pyautogui_if_missing(driver):
shared_utils.pip_install(
"pyautogui", version=constants.PyAutoGUI.VER
)
try:
import pyautogui
except Exception:
if (
IS_LINUX
and hasattr(sb_config, "xvfb")
and hasattr(sb_config, "headed")
and hasattr(sb_config, "headless")
and hasattr(sb_config, "headless2")
and (not sb_config.headed or sb_config.xvfb)
and not (sb_config.headless or sb_config.headless2)
):
from sbvirtualdisplay import Display
try:
xvfb_display = Display(
visible=True,
size=(1366, 768),
backend="xvfb",
use_xauth=True,
)
xvfb_display.start()
except Exception:
pass


def get_configured_pyautogui(pyautogui_copy):
Expand Down
52 changes: 27 additions & 25 deletions seleniumbase/fixtures/base_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -13788,31 +13788,33 @@ def __activate_virtual_display_as_needed(self):
which is the default mode on Linux unless using another arg."""
if "linux" in sys.platform and (not self.headed or self.xvfb):
from sbvirtualdisplay import Display
if self.undetectable and not (self.headless or self.headless2):
import Xlib.display
try:
self._xvfb_display = Display(
visible=True,
size=(1366, 768),
backend="xvfb",
use_xauth=True,
)
self._xvfb_display.start()
if "DISPLAY" not in os.environ.keys():
pip_find_lock = fasteners.InterProcessLock(
constants.PipInstall.FINDLOCK
)
with pip_find_lock: # Prevent issues with multiple processes
if self.undetectable and not (self.headless or self.headless2):
import Xlib.display
try:
self._xvfb_display = Display(
visible=True,
size=(1366, 768),
backend="xvfb",
use_xauth=True,
)
self._xvfb_display.start()
if "DISPLAY" not in os.environ.keys():
print(
"\nX11 display failed! Will use regular xvfb!"
)
self.__activate_standard_virtual_display()
except Exception as e:
if hasattr(e, "msg"):
print("\n" + str(e.msg))
else:
print(e)
print("\nX11 display failed! Will use regular xvfb!")
self.__activate_standard_virtual_display()
except Exception as e:
if hasattr(e, "msg"):
print("\n" + str(e.msg))
else:
print(e)
print("\nX11 display failed! Will use regular xvfb!")
self.__activate_standard_virtual_display()
return
pip_find_lock = fasteners.InterProcessLock(
constants.PipInstall.FINDLOCK
)
with pip_find_lock: # Prevent issues with multiple processes
return
pyautogui_is_installed = False
try:
import pyautogui
Expand Down Expand Up @@ -13854,8 +13856,8 @@ def __activate_virtual_display_as_needed(self):
print("\n" + str(e.msg))
else:
print(e)
else:
self.__activate_standard_virtual_display()
else:
self.__activate_standard_virtual_display()

def __ad_block_as_needed(self):
"""This is an internal method for handling ad-blocking.
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
'urllib3>=1.26.19,<2;python_version<"3.10"',
'urllib3>=1.26.19,<2.3.0;python_version>="3.10"',
'requests==2.31.0',
"pynose==1.5.1",
"pynose==1.5.2",
'sniffio==1.3.1',
'h11==0.14.0',
'outcome==1.3.0.post0',
Expand Down Expand Up @@ -212,8 +212,8 @@
'pygments==2.17.2;python_version<"3.8"',
'pygments==2.18.0;python_version>="3.8"',
'pyreadline3==3.4.1;platform_system=="Windows"',
"tabcompleter==1.3.0",
"pdbp==1.5.1",
"tabcompleter==1.3.3",
"pdbp==1.5.3",
'colorama==0.4.6',
'pyotp==2.9.0',
'python-xlib==0.33;platform_system=="Linux"',
Expand All @@ -235,7 +235,7 @@
# Usage: coverage run -m pytest; coverage html; coverage report
"coverage": [
'coverage==7.2.7;python_version<"3.8"',
'coverage>=7.5.4;python_version>="3.8"',
'coverage>=7.6.0;python_version>="3.8"',
'pytest-cov==4.1.0;python_version<"3.8"',
'pytest-cov>=5.0.0;python_version>="3.8"',
],
Expand Down Expand Up @@ -308,7 +308,7 @@
'kaitaistruct==0.10',
'pyasn1==0.5.1;python_version<"3.8"',
'pyasn1==0.6.0;python_version>="3.8"',
'zstandard==0.22.0',
'zstandard==0.23.0',
],
},
packages=[
Expand Down

0 comments on commit 924bcf3

Please sign in to comment.