Skip to content

Commit 924bcf3

Browse files
authored
Merge pull request #2939 from seleniumbase/uc-refactoring-and-dependencies
Refactor UC Mode and refresh dependencies
2 parents 83d08d1 + 1bd7c1b commit 924bcf3

File tree

6 files changed

+63
-38
lines changed

6 files changed

+63
-38
lines changed

mkdocs_build/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
regex>=2024.5.15
55
pymdown-extensions>=10.8.1
6-
pipdeptree>=2.23.0
6+
pipdeptree>=2.23.1
77
python-dateutil>=2.8.2
88
Markdown==3.6
9-
markdown2==2.4.13
9+
markdown2==2.5.0
1010
MarkupSafe==2.1.5
1111
Jinja2==3.1.4
1212
click==8.1.7
@@ -20,7 +20,7 @@ lxml==5.2.2
2020
pyquery==2.0.0
2121
readtime==3.0.0
2222
mkdocs==1.6.0
23-
mkdocs-material==9.5.28
23+
mkdocs-material==9.5.29
2424
mkdocs-exclude-search==0.6.6
2525
mkdocs-simple-hooks==0.1.5
2626
mkdocs-material-extensions==1.3.1

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ charset-normalizer==3.3.2
2525
urllib3>=1.26.19,<2;python_version<"3.10"
2626
urllib3>=1.26.19,<2.3.0;python_version>="3.10"
2727
requests==2.31.0
28-
pynose==1.5.1
28+
pynose==1.5.2
2929
sniffio==1.3.1
3030
h11==0.14.0
3131
outcome==1.3.0.post0
@@ -64,8 +64,8 @@ beautifulsoup4==4.12.3
6464
pygments==2.17.2;python_version<"3.8"
6565
pygments==2.18.0;python_version>="3.8"
6666
pyreadline3==3.4.1;platform_system=="Windows"
67-
tabcompleter==1.3.0
68-
pdbp==1.5.1
67+
tabcompleter==1.3.3
68+
pdbp==1.5.3
6969
colorama==0.4.6
7070
pyotp==2.9.0
7171
python-xlib==0.33;platform_system=="Linux"
@@ -78,7 +78,7 @@ rich==13.7.1
7878
# ("pip install -r requirements.txt" also installs this, but "pip install -e ." won't.)
7979

8080
coverage==7.2.7;python_version<"3.8"
81-
coverage>=7.5.4;python_version>="3.8"
81+
coverage>=7.6.0;python_version>="3.8"
8282
pytest-cov==4.1.0;python_version<"3.8"
8383
pytest-cov>=5.0.0;python_version>="3.8"
8484
flake8==5.0.4;python_version<"3.9"

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.28.5"
2+
__version__ = "4.28.6"

seleniumbase/core/browser_launcher.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,29 @@ def install_pyautogui_if_missing(driver):
586586
shared_utils.pip_install(
587587
"pyautogui", version=constants.PyAutoGUI.VER
588588
)
589+
try:
590+
import pyautogui
591+
except Exception:
592+
if (
593+
IS_LINUX
594+
and hasattr(sb_config, "xvfb")
595+
and hasattr(sb_config, "headed")
596+
and hasattr(sb_config, "headless")
597+
and hasattr(sb_config, "headless2")
598+
and (not sb_config.headed or sb_config.xvfb)
599+
and not (sb_config.headless or sb_config.headless2)
600+
):
601+
from sbvirtualdisplay import Display
602+
try:
603+
xvfb_display = Display(
604+
visible=True,
605+
size=(1366, 768),
606+
backend="xvfb",
607+
use_xauth=True,
608+
)
609+
xvfb_display.start()
610+
except Exception:
611+
pass
589612

590613

591614
def get_configured_pyautogui(pyautogui_copy):

seleniumbase/fixtures/base_case.py

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13788,31 +13788,33 @@ def __activate_virtual_display_as_needed(self):
1378813788
which is the default mode on Linux unless using another arg."""
1378913789
if "linux" in sys.platform and (not self.headed or self.xvfb):
1379013790
from sbvirtualdisplay import Display
13791-
if self.undetectable and not (self.headless or self.headless2):
13792-
import Xlib.display
13793-
try:
13794-
self._xvfb_display = Display(
13795-
visible=True,
13796-
size=(1366, 768),
13797-
backend="xvfb",
13798-
use_xauth=True,
13799-
)
13800-
self._xvfb_display.start()
13801-
if "DISPLAY" not in os.environ.keys():
13791+
pip_find_lock = fasteners.InterProcessLock(
13792+
constants.PipInstall.FINDLOCK
13793+
)
13794+
with pip_find_lock: # Prevent issues with multiple processes
13795+
if self.undetectable and not (self.headless or self.headless2):
13796+
import Xlib.display
13797+
try:
13798+
self._xvfb_display = Display(
13799+
visible=True,
13800+
size=(1366, 768),
13801+
backend="xvfb",
13802+
use_xauth=True,
13803+
)
13804+
self._xvfb_display.start()
13805+
if "DISPLAY" not in os.environ.keys():
13806+
print(
13807+
"\nX11 display failed! Will use regular xvfb!"
13808+
)
13809+
self.__activate_standard_virtual_display()
13810+
except Exception as e:
13811+
if hasattr(e, "msg"):
13812+
print("\n" + str(e.msg))
13813+
else:
13814+
print(e)
1380213815
print("\nX11 display failed! Will use regular xvfb!")
1380313816
self.__activate_standard_virtual_display()
13804-
except Exception as e:
13805-
if hasattr(e, "msg"):
13806-
print("\n" + str(e.msg))
13807-
else:
13808-
print(e)
13809-
print("\nX11 display failed! Will use regular xvfb!")
13810-
self.__activate_standard_virtual_display()
13811-
return
13812-
pip_find_lock = fasteners.InterProcessLock(
13813-
constants.PipInstall.FINDLOCK
13814-
)
13815-
with pip_find_lock: # Prevent issues with multiple processes
13817+
return
1381613818
pyautogui_is_installed = False
1381713819
try:
1381813820
import pyautogui
@@ -13854,8 +13856,8 @@ def __activate_virtual_display_as_needed(self):
1385413856
print("\n" + str(e.msg))
1385513857
else:
1385613858
print(e)
13857-
else:
13858-
self.__activate_standard_virtual_display()
13859+
else:
13860+
self.__activate_standard_virtual_display()
1385913861

1386013862
def __ad_block_as_needed(self):
1386113863
"""This is an internal method for handling ad-blocking.

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
'urllib3>=1.26.19,<2;python_version<"3.10"',
174174
'urllib3>=1.26.19,<2.3.0;python_version>="3.10"',
175175
'requests==2.31.0',
176-
"pynose==1.5.1",
176+
"pynose==1.5.2",
177177
'sniffio==1.3.1',
178178
'h11==0.14.0',
179179
'outcome==1.3.0.post0',
@@ -212,8 +212,8 @@
212212
'pygments==2.17.2;python_version<"3.8"',
213213
'pygments==2.18.0;python_version>="3.8"',
214214
'pyreadline3==3.4.1;platform_system=="Windows"',
215-
"tabcompleter==1.3.0",
216-
"pdbp==1.5.1",
215+
"tabcompleter==1.3.3",
216+
"pdbp==1.5.3",
217217
'colorama==0.4.6',
218218
'pyotp==2.9.0',
219219
'python-xlib==0.33;platform_system=="Linux"',
@@ -235,7 +235,7 @@
235235
# Usage: coverage run -m pytest; coverage html; coverage report
236236
"coverage": [
237237
'coverage==7.2.7;python_version<"3.8"',
238-
'coverage>=7.5.4;python_version>="3.8"',
238+
'coverage>=7.6.0;python_version>="3.8"',
239239
'pytest-cov==4.1.0;python_version<"3.8"',
240240
'pytest-cov>=5.0.0;python_version>="3.8"',
241241
],
@@ -308,7 +308,7 @@
308308
'kaitaistruct==0.10',
309309
'pyasn1==0.5.1;python_version<"3.8"',
310310
'pyasn1==0.6.0;python_version>="3.8"',
311-
'zstandard==0.22.0',
311+
'zstandard==0.23.0',
312312
],
313313
},
314314
packages=[

0 commit comments

Comments
 (0)