From 754c19b4fcc9f959b1631f7ce3512d3cc88c2cf4 Mon Sep 17 00:00:00 2001
From: Steven Silvester <steven.silvester@ieee.org>
Date: Mon, 4 Dec 2023 23:22:57 -0600
Subject: [PATCH 1/8] Clean up CI and drop py3.7

---
 .circleci/config.yml             | 32 ----------------------------
 .github/workflows/artifacts.yml  | 12 -----------
 .github/workflows/pre-commit.yml | 14 -------------
 .github/workflows/tests.yml      | 36 ++++++++++++++++++++++++++------
 setup.py                         |  2 +-
 5 files changed, 31 insertions(+), 65 deletions(-)
 delete mode 100644 .circleci/config.yml
 delete mode 100644 .github/workflows/artifacts.yml
 delete mode 100644 .github/workflows/pre-commit.yml

diff --git a/.circleci/config.yml b/.circleci/config.yml
deleted file mode 100644
index 2e13df7..0000000
--- a/.circleci/config.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-version: 2
-jobs:
-  build_docs:
-    docker:
-      - image: circleci/python:3.6-stretch
-    steps:
-      # Get our data and merge with upstream
-      - run: sudo apt-get update
-      - checkout
-
-      # Install
-      - run:
-          name: Install dependencies
-          command: |
-            pip install --user -r requirements.txt
-            pip install --user .
-      - run:
-          name: Build documentation
-          command: |
-            cd doc
-            make html-strict
-
-      - store_artifacts:
-          path: doc/build/html/
-          destination: html
-
-
-workflows:
-  version: 2
-  build_docs:
-    jobs:
-      - build_docs
diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml
deleted file mode 100644
index cf5a036..0000000
--- a/.github/workflows/artifacts.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-on: [status]
-
-jobs:
-  circleci_artifacts_redirector_job:
-    runs-on: ubuntu-latest
-    name: Run CircleCI artifacts redirector
-    steps:
-      - name: GitHub Action step
-        uses: larsoner/circleci-artifacts-redirector-action@master
-        with:
-          repo-token: ${{ secrets.GITHUB_TOKEN }}
-          artifact-path: 0/html/index.html
diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml
deleted file mode 100644
index 7233479..0000000
--- a/.github/workflows/pre-commit.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-name: pre-commit
-
-on:
-  pull_request:
-  push:
-    branches: [master]
-
-jobs:
-  pre-commit:
-    runs-on: ubuntu-latest
-    steps:
-    - uses: actions/checkout@v2
-    - uses: actions/setup-python@v2
-    - uses: pre-commit/action@v2.0.0
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index d191c8e..211a239 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -4,22 +4,31 @@ on: [push, pull_request]
 
 jobs:
 
+  pre-commit:
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v4
+    - uses: actions/setup-python@v3
+    - uses: pre-commit/action@v2.0.0
+
   tests:
 
     strategy:
       matrix:
-        python-version: [3.7, 3.8]
+        python-version: ["3.8", "3.11", " 3.12"]
         os: [ubuntu-latest]
         include:
           - os: windows-latest
-            python-version: 3.7
+            python-version: "3.9"
+          - os: macos-latest
+            python-version: "3.10"
 
     runs-on: ${{ matrix.os }}
 
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v4
     - name: Set up Python ${{ matrix.python-version }}
-      uses: actions/setup-python@v1
+      uses: actions/setup-python@v3
       with:
         python-version: ${{ matrix.python-version }}
 
@@ -33,6 +42,21 @@ jobs:
     - name: Run tests
       run: pytest
 
+  docs:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - uses: actions/setup-python@v3
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install -r requirements.txt
+          pip install .
+      - name: Build docs
+        run: |
+          cd doc
+          make html-strict
+
   publish:
 
     name: Publish to PyPi
@@ -42,10 +66,10 @@ jobs:
     steps:
       - name: Checkout source
         uses: actions/checkout@v2
-      - name: Set up Python 3.7
+      - name: Set up Python 3.8
         uses: actions/setup-python@v1
         with:
-          python-version: 3.7
+          python-version: 3.8
       - name: Build package
         run: |
           pip install wheel
diff --git a/setup.py b/setup.py
index 5896c22..da8064d 100644
--- a/setup.py
+++ b/setup.py
@@ -36,6 +36,6 @@
         "nbconvert>=5.5",
         "nbformat",
     ],
-    python_requires=">= 3.7",
+    python_requires=">= 3.8",
     package_data={"jupyter_sphinx": ["thebelab/*", "css/*"]},
 )

From 3408091902d6e05e7cafcc85a5c6d289e67c71e2 Mon Sep 17 00:00:00 2001
From: Steven Silvester <steven.silvester@ieee.org>
Date: Mon, 4 Dec 2023 23:31:32 -0600
Subject: [PATCH 2/8] Fix tests and readthedocs config

---
 .github/workflows/tests.yml |  2 ++
 .readthedocs.yml            | 10 ++++++++++
 readthedocs.yml             |  4 ----
 requirements.txt            |  2 +-
 setup.py                    |  2 +-
 tests/test_execute.py       |  4 ++--
 tox.ini                     |  2 +-
 7 files changed, 17 insertions(+), 9 deletions(-)
 create mode 100644 .readthedocs.yml
 delete mode 100644 readthedocs.yml

diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 211a239..2ca8fe1 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -9,6 +9,8 @@ jobs:
     steps:
     - uses: actions/checkout@v4
     - uses: actions/setup-python@v3
+      with:
+        python-version: 3.8
     - uses: pre-commit/action@v2.0.0
 
   tests:
diff --git a/.readthedocs.yml b/.readthedocs.yml
new file mode 100644
index 0000000..baf18d9
--- /dev/null
+++ b/.readthedocs.yml
@@ -0,0 +1,10 @@
+version: 2
+build:
+  os: ubuntu-22.04
+  tools:
+    python: "3.8"
+sphinx:
+  configuration: docs/source/conf.py
+python:
+  install:
+    - requirements: requirements.txt
diff --git a/readthedocs.yml b/readthedocs.yml
deleted file mode 100644
index a842177..0000000
--- a/readthedocs.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-python:
-  version: 3.8
-  install:
-    - requirements: requirements.txt
diff --git a/requirements.txt b/requirements.txt
index 84b0840..20f052c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
-sphinx>=2.4.4
+sphinx>=7.2
 ipykernel>=4.5.1
 ipywidgets>=7.0.0
 IPython
diff --git a/setup.py b/setup.py
index da8064d..f979c56 100644
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,7 @@
     license="BSD",
     packages=["jupyter_sphinx"],
     install_requires=[
-        "Sphinx>=2",
+        "Sphinx>=7.2",
         "ipykernel>=4.5.1",
         "ipywidgets>=7.0.0",
         "IPython",
diff --git a/tests/test_execute.py b/tests/test_execute.py
index 1df4102..da4f2eb 100644
--- a/tests/test_execute.py
+++ b/tests/test_execute.py
@@ -12,7 +12,7 @@
 from nbformat import from_dict
 from sphinx.addnodes import download_reference
 from sphinx.errors import ExtensionError
-from sphinx.testing.util import SphinxTestApp, assert_node, path
+from sphinx.testing.util import SphinxTestApp, assert_node
 
 from jupyter_sphinx.ast import (
     JupyterCellNode,
@@ -48,7 +48,7 @@ def doctree(
 
         warnings = StringIO()
         app = SphinxTestApp(
-            srcdir=path(src_dir.as_posix()),
+            srcdir=src_dir,
             status=StringIO(),
             warning=warnings,
             buildername=buildername,
diff --git a/tox.ini b/tox.ini
index cf43b92..3b045ff 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = py37
+envlist = py38,py39,py310,py311,py312
 
 [testenv]
 deps =

From 687efe83ead970f7b47399d17793726d3662a1ca Mon Sep 17 00:00:00 2001
From: Steven Silvester <steven.silvester@ieee.org>
Date: Mon, 4 Dec 2023 23:32:11 -0600
Subject: [PATCH 3/8] update name

---
 .github/workflows/tests.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 2ca8fe1..a8afd86 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -1,4 +1,4 @@
-name: continuous-integration
+name: tests
 
 on: [push, pull_request]
 

From 07453d64683d8051994f7fe956a258fa291daff5 Mon Sep 17 00:00:00 2001
From: Steven Silvester <steven.silvester@ieee.org>
Date: Mon, 4 Dec 2023 23:37:56 -0600
Subject: [PATCH 4/8] cleanup

---
 doc/source/index.rst | 2 +-
 requirements.txt     | 2 +-
 setup.py             | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/source/index.rst b/doc/source/index.rst
index e251b7d..f7b7b3e 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -90,7 +90,7 @@ LaTeX output:
 .. jupyter-execute::
 
   from IPython.display import Latex
-  Latex('\int_{-\infty}^\infty e^{-x²}dx = \sqrt{\pi}')
+  Latex('\\int_{-\infty}^\infty e^{-x²}dx = \sqrt{\pi}')
 
 or even full-blown javascript widgets:
 
diff --git a/requirements.txt b/requirements.txt
index 20f052c..8d4344f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
-sphinx>=7.2
+sphinx>=7.0
 ipykernel>=4.5.1
 ipywidgets>=7.0.0
 IPython
diff --git a/setup.py b/setup.py
index f979c56..dfb7eff 100644
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,7 @@
     license="BSD",
     packages=["jupyter_sphinx"],
     install_requires=[
-        "Sphinx>=7.2",
+        "Sphinx>=7",
         "ipykernel>=4.5.1",
         "ipywidgets>=7.0.0",
         "IPython",

From 24e25bd7319832e3b0babc0b25a9506f16e9ca4a Mon Sep 17 00:00:00 2001
From: Steven Silvester <steven.silvester@ieee.org>
Date: Mon, 4 Dec 2023 23:44:34 -0600
Subject: [PATCH 5/8] handle older sphinx

---
 tests/test_execute.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/test_execute.py b/tests/test_execute.py
index da4f2eb..437fc0f 100644
--- a/tests/test_execute.py
+++ b/tests/test_execute.py
@@ -13,6 +13,11 @@
 from sphinx.addnodes import download_reference
 from sphinx.errors import ExtensionError
 from sphinx.testing.util import SphinxTestApp, assert_node
+try:
+    from sphinx.testing.util import path
+except ImportError:
+    path = None
+
 
 from jupyter_sphinx.ast import (
     JupyterCellNode,
@@ -47,6 +52,8 @@ def doctree(
         (src_dir / "index.rst").write_text(source, encoding="utf8")
 
         warnings = StringIO()
+        if path is not None:
+            src_dir = path(src_dir.as_posix())
         app = SphinxTestApp(
             srcdir=src_dir,
             status=StringIO(),

From b6d43c77ffdf5972ccdaa1e88be563dd7bbdf37a Mon Sep 17 00:00:00 2001
From: Steven Silvester <steven.silvester@ieee.org>
Date: Mon, 4 Dec 2023 23:46:08 -0600
Subject: [PATCH 6/8] cleanup

---
 doc/source/index.rst  | 2 +-
 tests/test_execute.py | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/source/index.rst b/doc/source/index.rst
index f7b7b3e..336c8a7 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -90,7 +90,7 @@ LaTeX output:
 .. jupyter-execute::
 
   from IPython.display import Latex
-  Latex('\\int_{-\infty}^\infty e^{-x²}dx = \sqrt{\pi}')
+  Latex('\\int_{-\\infty}^\\infty e^{-x²}dx = \\sqrt{\\pi}')
 
 or even full-blown javascript widgets:
 
diff --git a/tests/test_execute.py b/tests/test_execute.py
index 437fc0f..dd7fc90 100644
--- a/tests/test_execute.py
+++ b/tests/test_execute.py
@@ -13,6 +13,7 @@
 from sphinx.addnodes import download_reference
 from sphinx.errors import ExtensionError
 from sphinx.testing.util import SphinxTestApp, assert_node
+
 try:
     from sphinx.testing.util import path
 except ImportError:

From e373c190d055128a0a59129e11e1ebf092e82eb5 Mon Sep 17 00:00:00 2001
From: Steven Silvester <steven.silvester@ieee.org>
Date: Tue, 5 Dec 2023 05:37:39 -0600
Subject: [PATCH 7/8] address review

---
 .github/workflows/tests.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index a8afd86..a7eb393 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -17,13 +17,13 @@ jobs:
 
     strategy:
       matrix:
-        python-version: ["3.8", "3.11", " 3.12"]
+        python-version: ["3.8", "3.9", "3.10", "3.11", " 3.12"]
         os: [ubuntu-latest]
         include:
           - os: windows-latest
-            python-version: "3.9"
+            python-version: "3.12"
           - os: macos-latest
-            python-version: "3.10"
+            python-version: "3.12"
 
     runs-on: ${{ matrix.os }}
 

From 5d359fb88bc17550e535220f69c7eec0dd300926 Mon Sep 17 00:00:00 2001
From: Steven Silvester <steven.silvester@ieee.org>
Date: Tue, 5 Dec 2023 05:39:27 -0600
Subject: [PATCH 8/8] fix sphinx path

---
 .readthedocs.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.readthedocs.yml b/.readthedocs.yml
index baf18d9..188c1aa 100644
--- a/.readthedocs.yml
+++ b/.readthedocs.yml
@@ -4,7 +4,7 @@ build:
   tools:
     python: "3.8"
 sphinx:
-  configuration: docs/source/conf.py
+  configuration: doc/source/conf.py
 python:
   install:
     - requirements: requirements.txt