Skip to content

Commit

Permalink
try firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
drammock committed Oct 6, 2023
1 parent 321140e commit 0df795d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
12 changes: 9 additions & 3 deletions doc/sphinxext/contrib_avatars.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@
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):
"""Render a template webpage with avatars generated by JS and a GitHub API call."""
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"))
Expand Down
3 changes: 2 additions & 1 deletion tools/circleci_bash_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tools/circleci_dependencies.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0df795d

Please sign in to comment.