Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit 5432999

Browse files
authored
CI: fix tests (#127)
- 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.
1 parent fa7e607 commit 5432999

File tree

7 files changed

+38
-18
lines changed

7 files changed

+38
-18
lines changed

.circleci/config.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ commands:
1111
type: string
1212
sphinx-version:
1313
type: string
14-
default: "1,2,3,4,latest"
14+
default: "1,2,3,4,5,6,latest"
1515
steps:
1616
- browser-tools/install-browser-tools
1717
- checkout
18-
- run: pip install --user tox
18+
# Upgrade tox once https://github.com/tox-dev/tox/issues/2850 is solved.
19+
- run: pip install --user 'tox<4'
1920
- run:
2021
name: Test with Chrome driver
2122
command: tox -e "<<parameters.version>>-sphinx{<<parameters.sphinx-version>>}" -- --driver Chrome
@@ -24,12 +25,6 @@ commands:
2425
command: tox -e "<<parameters.version>>-sphinx{<<parameters.sphinx-version>>}" -- --driver Firefox
2526

2627
jobs:
27-
py36:
28-
docker:
29-
- image: 'cimg/python:3.6-browsers'
30-
steps:
31-
- run-tox:
32-
version: py36
3328
py37:
3429
docker:
3530
- image: 'cimg/python:3.7-browsers'
@@ -54,14 +49,21 @@ jobs:
5449
steps:
5550
- run-tox:
5651
version: py310
57-
sphinx-version: 4,latest
52+
sphinx-version: 4,5,6,latest
53+
py311:
54+
docker:
55+
- image: 'cimg/python:3.11-browsers'
56+
steps:
57+
- run-tox:
58+
version: py311
59+
sphinx-version: 4,5,6,latest
5860

5961
workflows:
6062
version: 2
6163
tests:
6264
jobs:
65+
- py311
6366
- py310
6467
- py39
6568
- py38
6669
- py37
67-
- py36

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#
6969
# This is also used if you do content translation via gettext catalogs.
7070
# Usually you set "language" from the command line for these cases.
71-
language = None
71+
language = 'en'
7272

7373
# List of patterns, relative to source directory, that match files and
7474
# directories to ignore when looking for source files.

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sphinx-prompt==1.5.0
33
sphinx-tabs==3.2.0
44
sphinx-rtd-theme==1.0.0
55
sphinx-notfound-page==0.8
6-
sphinx-js==3.1
6+
sphinx-js==3.2.1
77

88
# sphinx-js pins jinja to a version that doesn't
99
# pin its version of markupsafe, markupsafe>=2.1

scripts/setup_geckodriver.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=v0.28.0
1+
VERSION=v0.32.0
22
wget -N https://github.com/mozilla/geckodriver/releases/download/${VERSION}/geckodriver-${VERSION}-linux64.tar.gz -P ~/
33
tar xvzf ~/geckodriver-${VERSION}-linux64.tar.gz -C ~/
44
rm ~/geckodriver-${VERSION}-linux64.tar.gz

sphinx_search/static/js/rtd_sphinx_search.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ const showSearchModal = custom_query => {
586586
// removes previous results (if there are any).
587587
removeResults();
588588

589-
$(".search__outer__wrapper").fadeIn(ANIMATION_TIME, () => {
589+
let show_modal = function () {
590590
// removes the focus from the initial input field
591591
// which as already present in the docs.
592592
let search_bar = getInputField();
@@ -608,7 +608,17 @@ const showSearchModal = custom_query => {
608608
}
609609
search_outer_input.focus();
610610
}
611-
});
611+
};
612+
613+
if (window.jQuery) {
614+
$(".search__outer__wrapper").fadeIn(ANIMATION_TIME, show_modal);
615+
} else {
616+
let element = document.querySelector(".search__outer__wrapper");
617+
if (element && element.style) {
618+
element.style.display = "block";
619+
}
620+
show_modal();
621+
}
612622
};
613623

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

633-
$(".search__outer__wrapper").fadeOut(ANIMATION_TIME);
643+
if (window.jQuery) {
644+
$(".search__outer__wrapper").fadeOut(ANIMATION_TIME);
645+
} else {
646+
let element = document.querySelector(".search__outer__wrapper");
647+
if (element && element.style) {
648+
element.style.display = "none";
649+
}
650+
}
634651
};
635652

636653
window.addEventListener("DOMContentLoaded", () => {

sphinx_search/static/js/rtd_sphinx_search.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[tox]
2-
minversion = 3.10
32
envlist =
43
py{36,37,38,39}-sphinx{1,2,3,4,latest}
54
py310-sphinx{4,latest}
@@ -15,6 +14,8 @@ deps =
1514
sphinx2: Sphinx<3.0
1615
sphinx3: Sphinx<4.0
1716
sphinx4: Sphinx<5.0
17+
sphinx5: Sphinx<6.0
18+
sphinx6: Sphinx<7.0
1819
{sphinx1,sphinx2,sphinx3}: docutils<0.18
1920
{sphinx1,sphinx2,sphinx3}: jinja2<3.1
2021
sphinxlatest: Sphinx

0 commit comments

Comments
 (0)