Skip to content

Commit 3451732

Browse files
authored
Merge pull request #236 from blink1073/cleanup-ci
Clean up CI and drop py3.7
2 parents 6a47a75 + 5d359fb commit 3451732

11 files changed

+58
-76
lines changed

.circleci/config.yml

-32
This file was deleted.

.github/workflows/artifacts.yml

-12
This file was deleted.

.github/workflows/pre-commit.yml

-14
This file was deleted.

.github/workflows/tests.yml

+33-7
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,36 @@
1-
name: continuous-integration
1+
name: tests
22

33
on: [push, pull_request]
44

55
jobs:
66

7+
pre-commit:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-python@v3
12+
with:
13+
python-version: 3.8
14+
- uses: pre-commit/[email protected]
15+
716
tests:
817

918
strategy:
1019
matrix:
11-
python-version: [3.7, 3.8]
20+
python-version: ["3.8", "3.9", "3.10", "3.11", " 3.12"]
1221
os: [ubuntu-latest]
1322
include:
1423
- os: windows-latest
15-
python-version: 3.7
24+
python-version: "3.12"
25+
- os: macos-latest
26+
python-version: "3.12"
1627

1728
runs-on: ${{ matrix.os }}
1829

1930
steps:
20-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v4
2132
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v1
33+
uses: actions/setup-python@v3
2334
with:
2435
python-version: ${{ matrix.python-version }}
2536

@@ -33,6 +44,21 @@ jobs:
3344
- name: Run tests
3445
run: pytest
3546

47+
docs:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v4
51+
- uses: actions/setup-python@v3
52+
- name: Install dependencies
53+
run: |
54+
python -m pip install --upgrade pip
55+
pip install -r requirements.txt
56+
pip install .
57+
- name: Build docs
58+
run: |
59+
cd doc
60+
make html-strict
61+
3662
publish:
3763

3864
name: Publish to PyPi
@@ -42,10 +68,10 @@ jobs:
4268
steps:
4369
- name: Checkout source
4470
uses: actions/checkout@v2
45-
- name: Set up Python 3.7
71+
- name: Set up Python 3.8
4672
uses: actions/setup-python@v1
4773
with:
48-
python-version: 3.7
74+
python-version: 3.8
4975
- name: Build package
5076
run: |
5177
pip install wheel

.readthedocs.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
build:
3+
os: ubuntu-22.04
4+
tools:
5+
python: "3.8"
6+
sphinx:
7+
configuration: doc/source/conf.py
8+
python:
9+
install:
10+
- requirements: requirements.txt

doc/source/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ LaTeX output:
9090
.. jupyter-execute::
9191

9292
from IPython.display import Latex
93-
Latex('\int_{-\infty}^\infty e^{-x²}dx = \sqrt{\pi}')
93+
Latex('\\int_{-\\infty}^\\infty e^{-x²}dx = \\sqrt{\\pi}')
9494

9595
or even full-blown javascript widgets:
9696

readthedocs.yml

-4
This file was deleted.

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sphinx>=2.4.4
1+
sphinx>=7.0
22
ipykernel>=4.5.1
33
ipywidgets>=7.0.0
44
IPython

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
license="BSD",
3030
packages=["jupyter_sphinx"],
3131
install_requires=[
32-
"Sphinx>=2",
32+
"Sphinx>=7",
3333
"ipykernel>=4.5.1",
3434
"ipywidgets>=7.0.0",
3535
"IPython",
3636
"nbconvert>=5.5",
3737
"nbformat",
3838
],
39-
python_requires=">= 3.7",
39+
python_requires=">= 3.8",
4040
package_data={"jupyter_sphinx": ["thebelab/*", "css/*"]},
4141
)

tests/test_execute.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@
1212
from nbformat import from_dict
1313
from sphinx.addnodes import download_reference
1414
from sphinx.errors import ExtensionError
15-
from sphinx.testing.util import SphinxTestApp, assert_node, path
15+
from sphinx.testing.util import SphinxTestApp, assert_node
16+
17+
try:
18+
from sphinx.testing.util import path
19+
except ImportError:
20+
path = None
21+
1622

1723
from jupyter_sphinx.ast import (
1824
JupyterCellNode,
@@ -47,8 +53,10 @@ def doctree(
4753
(src_dir / "index.rst").write_text(source, encoding="utf8")
4854

4955
warnings = StringIO()
56+
if path is not None:
57+
src_dir = path(src_dir.as_posix())
5058
app = SphinxTestApp(
51-
srcdir=path(src_dir.as_posix()),
59+
srcdir=src_dir,
5260
status=StringIO(),
5361
warning=warnings,
5462
buildername=buildername,

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py37
2+
envlist = py38,py39,py310,py311,py312
33

44
[testenv]
55
deps =

0 commit comments

Comments
 (0)