From 0df795d190edb63d09907a16346054ff0f079b08 Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Fri, 6 Oct 2023 09:36:45 +0300 Subject: [PATCH] try firefox --- doc/sphinxext/contrib_avatars.py | 12 +++++++++--- tools/circleci_bash_env.sh | 3 ++- tools/circleci_dependencies.sh | 4 +++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/doc/sphinxext/contrib_avatars.py b/doc/sphinxext/contrib_avatars.py index a2ed2770ad0..f4e1b29faf3 100644 --- a/doc/sphinxext/contrib_avatars.py +++ b/doc/sphinxext/contrib_avatars.py @@ -3,6 +3,7 @@ from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait +from selenium.common.exceptions import WebDriverException def generate_contrib_avatars(app, config): @@ -10,9 +11,14 @@ def generate_contrib_avatars(app, config): root = Path(app.srcdir) infile = root / "sphinxext" / "_avatar_template.html" outfile = root / "_templates" / "avatars.html" - options = webdriver.ChromeOptions() - options.add_argument("--headless=new") - driver = webdriver.Chrome(options=options) + try: + options = webdriver.FirefoxOptions() + options.add_argument("--headless") + driver = webdriver.Firefox(options=options) + except WebDriverException: + options = webdriver.ChromeOptions() + options.add_argument("--headless=new") + driver = webdriver.Chrome(options=options) driver.get(f"file://{infile}") wait = WebDriverWait(driver, 20) wait.until(lambda d: d.find_element(by=By.ID, value="contributor-avatars")) diff --git a/tools/circleci_bash_env.sh b/tools/circleci_bash_env.sh index f8b70be587a..5404d163835 100755 --- a/tools/circleci_bash_env.sh +++ b/tools/circleci_bash_env.sh @@ -4,7 +4,8 @@ set -e set -o pipefail ./tools/setup_xvfb.sh -sudo apt install -qq graphviz optipng python3.10-venv python3-venv libxft2 ffmpeg chromium chromium-driver +sudo apt install -qq graphviz optipng python3.10-venv python3-venv libxft2 ffmpeg +sudo snap install firefox python3.10 -m venv ~/python_env echo "set -e" >> $BASH_ENV echo "set -o pipefail" >> $BASH_ENV diff --git a/tools/circleci_dependencies.sh b/tools/circleci_dependencies.sh index 677bd5ced22..cfaddd88c56 100755 --- a/tools/circleci_dependencies.sh +++ b/tools/circleci_dependencies.sh @@ -1,4 +1,6 @@ #!/bin/bash -ef python -m pip install --upgrade "pip!=20.3.0" setuptools wheel -python -m pip install --upgrade --progress-bar off --only-binary "numpy,scipy,matplotlib,pandas,statsmodels" -r requirements.txt -r requirements_testing.txt -r requirements_doc.txt PyQt6 git+https://github.com/mne-tools/mne-qt-browser -e . +python -m pip install --upgrade --progress-bar off --only-binary "numpy,scipy,matplotlib,pandas,statsmodels" -r requirements.txt -r requirements_testing.txt -r requirements_doc.txt webdrivermanager PyQt6 git+https://github.com/mne-tools/mne-qt-browser -e . + +webdrivermanager firefox --linkpath AUTO