Skip to content

Commit

Permalink
CI: fix tests (#127)
Browse files Browse the repository at this point in the history
- The latest version of tox was being installed, but there is a bug when expanding enviroment names
- The Python 3.6 image was giving an error, I guess because it's deprecated? I think we should be fine removing it from our test matrix
- Test python 3.11 (updating sphinx-js was required)
- Sphinx 6.x doesn't include jquery, so I'm using the suggestion about conditionally using jQuery from #126 (comment) for now
- Test with sphinx 5 and 6.
  • Loading branch information
stsewd committed Jan 24, 2023
1 parent fa7e607 commit 5432999
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 18 deletions.
22 changes: 12 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ commands:
type: string
sphinx-version:
type: string
default: "1,2,3,4,latest"
default: "1,2,3,4,5,6,latest"
steps:
- browser-tools/install-browser-tools
- checkout
- run: pip install --user tox
# Upgrade tox once https://github.com/tox-dev/tox/issues/2850 is solved.
- run: pip install --user 'tox<4'
- run:
name: Test with Chrome driver
command: tox -e "<<parameters.version>>-sphinx{<<parameters.sphinx-version>>}" -- --driver Chrome
Expand All @@ -24,12 +25,6 @@ commands:
command: tox -e "<<parameters.version>>-sphinx{<<parameters.sphinx-version>>}" -- --driver Firefox

jobs:
py36:
docker:
- image: 'cimg/python:3.6-browsers'
steps:
- run-tox:
version: py36
py37:
docker:
- image: 'cimg/python:3.7-browsers'
Expand All @@ -54,14 +49,21 @@ jobs:
steps:
- run-tox:
version: py310
sphinx-version: 4,latest
sphinx-version: 4,5,6,latest
py311:
docker:
- image: 'cimg/python:3.11-browsers'
steps:
- run-tox:
version: py311
sphinx-version: 4,5,6,latest

workflows:
version: 2
tests:
jobs:
- py311
- py310
- py39
- py38
- py37
- py36
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sphinx-prompt==1.5.0
sphinx-tabs==3.2.0
sphinx-rtd-theme==1.0.0
sphinx-notfound-page==0.8
sphinx-js==3.1
sphinx-js==3.2.1

# sphinx-js pins jinja to a version that doesn't
# pin its version of markupsafe, markupsafe>=2.1
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup_geckodriver.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=v0.28.0
VERSION=v0.32.0
wget -N https://github.com/mozilla/geckodriver/releases/download/${VERSION}/geckodriver-${VERSION}-linux64.tar.gz -P ~/
tar xvzf ~/geckodriver-${VERSION}-linux64.tar.gz -C ~/
rm ~/geckodriver-${VERSION}-linux64.tar.gz
Expand Down
23 changes: 20 additions & 3 deletions sphinx_search/static/js/rtd_sphinx_search.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ const showSearchModal = custom_query => {
// removes previous results (if there are any).
removeResults();

$(".search__outer__wrapper").fadeIn(ANIMATION_TIME, () => {
let show_modal = function () {
// removes the focus from the initial input field
// which as already present in the docs.
let search_bar = getInputField();
Expand All @@ -608,7 +608,17 @@ const showSearchModal = custom_query => {
}
search_outer_input.focus();
}
});
};

if (window.jQuery) {
$(".search__outer__wrapper").fadeIn(ANIMATION_TIME, show_modal);
} else {
let element = document.querySelector(".search__outer__wrapper");
if (element && element.style) {
element.style.display = "block";
}
show_modal();
}
};

/**
Expand All @@ -630,7 +640,14 @@ const removeSearchModal = () => {
// update url (remove 'rtd_search' param)
updateUrl();

$(".search__outer__wrapper").fadeOut(ANIMATION_TIME);
if (window.jQuery) {
$(".search__outer__wrapper").fadeOut(ANIMATION_TIME);
} else {
let element = document.querySelector(".search__outer__wrapper");
if (element && element.style) {
element.style.display = "none";
}
}
};

window.addEventListener("DOMContentLoaded", () => {
Expand Down
2 changes: 1 addition & 1 deletion sphinx_search/static/js/rtd_sphinx_search.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[tox]
minversion = 3.10
envlist =
py{36,37,38,39}-sphinx{1,2,3,4,latest}
py310-sphinx{4,latest}
Expand All @@ -15,6 +14,8 @@ deps =
sphinx2: Sphinx<3.0
sphinx3: Sphinx<4.0
sphinx4: Sphinx<5.0
sphinx5: Sphinx<6.0
sphinx6: Sphinx<7.0
{sphinx1,sphinx2,sphinx3}: docutils<0.18
{sphinx1,sphinx2,sphinx3}: jinja2<3.1
sphinxlatest: Sphinx
Expand Down

0 comments on commit 5432999

Please sign in to comment.