Skip to content

Commit c190d44

Browse files
committed
More updates for new versions
1 parent 981cd26 commit c190d44

9 files changed

Lines changed: 37 additions & 31 deletions

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ jobs:
5353
pillow: "==11.0.0"
5454
# Newest known-compatible dependencies
5555
- os: ubuntu-latest
56-
python-version: "3.12"
57-
sphinx: "==8.0.2"
56+
python-version: "3.13"
57+
sphinx: "~=9.0.2"
5858
myst-parser: "==4.0.0"
5959
pillow: "==11.0.0"
6060

myst_nb/sphinx_.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ def parse(self, inputstring: str, document: nodes.document) -> None:
7070
:param inputstring: The source string to parse
7171
:param document: The root docutils node to add AST elements to
7272
"""
73-
env = getattr(document.settings, "env", self.env)
73+
env = getattr(document.settings, "env", None)
7474
if env is None:
75-
assert self.env is not None, "env not set"
7675
env = self.env
76+
assert env is not None, "env not set"
7777
document_path = env.doc2path(env.docname)
7878

7979
# get a logger for this document

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ filterwarnings = [
177177
# From myst-parser on Sphinx 9
178178
'ignore:.*MystReferenceResolver.app.*:sphinx.deprecation.RemovedInSphinx11Warning',
179179
# Upstream myst-parser still hits env.app deprecations under Sphinx 9
180-
'ignore::sphinx.deprecation.RemovedInSphinx90Warning:myst_parser',
180+
'ignore:.*env\\.app.*:sphinx.deprecation.RemovedInSphinx10Warning:myst_parser',
181181
# Windows issues, some may need to be fixed in MyST-NB, others are upstream
182182
'ignore:Proactor event loop does not implement add_reader:RuntimeWarning:zmq',
183183
]

tests/conftest.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from sphinx.util.console import nocolor
2222

2323
pytest_plugins = "sphinx.testing.fixtures"
24+
LATEST_SPHINX_MAJOR = 9
2425

2526
# -Diff Configuration-#
2627
NB_VERSION = 4
@@ -100,7 +101,9 @@ def invalidate_files(self):
100101
def get_resolved_doctree(self, docname=None):
101102
"""Load and return the built docutils.document, after post-transforms."""
102103
docname = docname or self.files[0]
103-
doctree = self.env.get_and_resolve_doctree(docname, self.app.builder)
104+
doctree = self.env.get_and_resolve_doctree(
105+
docname, self.app.builder, tags=self.app.builder.tags
106+
)
104107
doctree["source"] = docname
105108
return doctree
106109

@@ -287,6 +290,9 @@ def _func(doctree):
287290
# alternatively the resolution of https://github.com/ESSS/pytest-regressions/issues/32
288291
@pytest.fixture()
289292
def file_regression(file_regression):
293+
# Only run regression tests on the latest Sphinx since minor document changes will cause these to break otherwise
294+
if sphinx_version_info[0] < LATEST_SPHINX_MAJOR:
295+
pytest.skip("file-regression checks run only on the latest Sphinx")
290296
return FileRegression(file_regression)
291297

292298

tests/test_execute/test_allow_errors_auto.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"evalue": "oopsie!",
2020
"output_type": "error",
2121
"traceback": [
22-
"\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
23-
"\u001B[0;31mException\u001B[0m Traceback (most recent call last)",
24-
"Cell \u001B[0;32mIn[1], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mException\u001B[39;00m(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124moopsie!\u001B[39m\u001B[38;5;124m\"\u001B[39m)\n",
25-
"\u001B[0;31mException\u001B[0m: oopsie!"
22+
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
23+
"\u001b[31mException\u001b[39m Traceback (most recent call last)",
24+
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[1]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[33m\"\u001b[39m\u001b[33moopsie!\u001b[39m\u001b[33m\"\u001b[39m)\n",
25+
"\u001b[31mException\u001b[39m: oopsie!"
2626
]
2727
}
2828
],
@@ -47,7 +47,7 @@
4747
"name": "python",
4848
"nbconvert_exporter": "python",
4949
"pygments_lexer": "ipython3",
50-
"version": "3.10.12"
50+
"version": "3.13.11"
5151
},
5252
"test_name": "notebook1"
5353
},

tests/test_execute/test_allow_errors_cache.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"evalue": "oopsie!",
2020
"output_type": "error",
2121
"traceback": [
22-
"\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
23-
"\u001B[0;31mException\u001B[0m Traceback (most recent call last)",
24-
"Cell \u001B[0;32mIn[1], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mException\u001B[39;00m(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124moopsie!\u001B[39m\u001B[38;5;124m\"\u001B[39m)\n",
25-
"\u001B[0;31mException\u001B[0m: oopsie!"
22+
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
23+
"\u001b[31mException\u001b[39m Traceback (most recent call last)",
24+
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[1]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[33m\"\u001b[39m\u001b[33moopsie!\u001b[39m\u001b[33m\"\u001b[39m)\n",
25+
"\u001b[31mException\u001b[39m: oopsie!"
2626
]
2727
}
2828
],
@@ -47,7 +47,7 @@
4747
"name": "python",
4848
"nbconvert_exporter": "python",
4949
"pygments_lexer": "ipython3",
50-
"version": "3.10.12"
50+
"version": "3.13.11"
5151
},
5252
"test_name": "notebook1"
5353
},

tests/test_execute/test_basic_failing_auto.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"evalue": "oopsie!",
2020
"output_type": "error",
2121
"traceback": [
22-
"\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
23-
"\u001B[0;31mException\u001B[0m Traceback (most recent call last)",
24-
"Cell \u001B[0;32mIn[1], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mException\u001B[39;00m(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124moopsie!\u001B[39m\u001B[38;5;124m\"\u001B[39m)\n",
25-
"\u001B[0;31mException\u001B[0m: oopsie!"
22+
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
23+
"\u001b[31mException\u001b[39m Traceback (most recent call last)",
24+
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[1]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[33m\"\u001b[39m\u001b[33moopsie!\u001b[39m\u001b[33m\"\u001b[39m)\n",
25+
"\u001b[31mException\u001b[39m: oopsie!"
2626
]
2727
}
2828
],
@@ -47,7 +47,7 @@
4747
"name": "python",
4848
"nbconvert_exporter": "python",
4949
"pygments_lexer": "ipython3",
50-
"version": "3.10.12"
50+
"version": "3.13.11"
5151
},
5252
"test_name": "notebook1"
5353
},

tests/test_execute/test_basic_failing_cache.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"evalue": "oopsie!",
2020
"output_type": "error",
2121
"traceback": [
22-
"\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
23-
"\u001B[0;31mException\u001B[0m Traceback (most recent call last)",
24-
"Cell \u001B[0;32mIn[1], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mException\u001B[39;00m(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124moopsie!\u001B[39m\u001B[38;5;124m\"\u001B[39m)\n",
25-
"\u001B[0;31mException\u001B[0m: oopsie!"
22+
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
23+
"\u001b[31mException\u001b[39m Traceback (most recent call last)",
24+
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[1]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[33m\"\u001b[39m\u001b[33moopsie!\u001b[39m\u001b[33m\"\u001b[39m)\n",
25+
"\u001b[31mException\u001b[39m: oopsie!"
2626
]
2727
}
2828
],
@@ -47,7 +47,7 @@
4747
"name": "python",
4848
"nbconvert_exporter": "python",
4949
"pygments_lexer": "ipython3",
50-
"version": "3.10.12"
50+
"version": "3.13.11"
5151
},
5252
"test_name": "notebook1"
5353
},

tests/test_execute/test_basic_failing_inline.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"evalue": "oopsie!",
2020
"output_type": "error",
2121
"traceback": [
22-
"\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
23-
"\u001B[0;31mException\u001B[0m Traceback (most recent call last)",
24-
"Cell \u001B[0;32mIn[1], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mException\u001B[39;00m(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124moopsie!\u001B[39m\u001B[38;5;124m\"\u001B[39m)\n",
25-
"\u001B[0;31mException\u001B[0m: oopsie!"
22+
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
23+
"\u001b[31mException\u001b[39m Traceback (most recent call last)",
24+
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[1]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[33m\"\u001b[39m\u001b[33moopsie!\u001b[39m\u001b[33m\"\u001b[39m)\n",
25+
"\u001b[31mException\u001b[39m: oopsie!"
2626
]
2727
}
2828
],
@@ -47,7 +47,7 @@
4747
"name": "python",
4848
"nbconvert_exporter": "python",
4949
"pygments_lexer": "ipython3",
50-
"version": "3.10.12"
50+
"version": "3.13.11"
5151
},
5252
"test_name": "notebook1"
5353
},

0 commit comments

Comments
 (0)