diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 484c7dbf..d004c61c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,7 +41,7 @@ jobs: - os: ubuntu-latest python-version: "3.11" sphinx: "==7.0.0" - myst-parser: "==2.0.0" + myst-parser: "==3.0.0" # Newest known-compatible dependencies - os: ubuntu-latest python-version: "3.12" diff --git a/myst_nb/core/read.py b/myst_nb/core/read.py index 8fc2bb67..9bf6befb 100644 --- a/myst_nb/core/read.py +++ b/myst_nb/core/read.py @@ -57,8 +57,11 @@ def create_nb_reader( :returns: the notebook reader, and the (potentially modified) MdParserConfig, or None if the input cannot be read as a notebook. """ - # the import is here so this module can be loaded without sphinx - from sphinx.util import import_object + + try: + from sphinx.util._importer import import_object + except ImportError: + from sphinx.util import import_object # get all possible readers readers = nb_config.custom_formats.copy() diff --git a/pyproject.toml b/pyproject.toml index 6a62fa0e..b80ede9f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -131,6 +131,7 @@ show_error_codes = true check_untyped_defs = true strict_equality = true no_implicit_optional = true +ignore_missing_imports = true warn_unused_ignores = true [[tool.mypy.overrides]] @@ -149,3 +150,25 @@ ignore = [ [tool.ruff.lint.isort] force-sort-within-sections = true + +[tool.pytest.ini_options] +filterwarnings = [ + 'error', + 'ignore:unclosed database in:ResourceWarning', + # from asyncio triggered by jupyter_client + 'ignore:There is no current event loop:DeprecationWarning', + 'ignore:Parsing dates involving a day of month without a year specified is :DeprecationWarning', + # from jupyter_core + 'ignore:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning', + # nbclient + 'ignore:Parsing dates involving a day of month without a year specified is :DeprecationWarning:nbclient', + # From dateutil in sqlalchemy and jupyter_cache + 'ignore:datetime.datetime.utcnow\(\) is deprecated:DeprecationWarning:sqlalchemy', + 'ignore:datetime.datetime.utcnow\(\) is deprecated:DeprecationWarning:jupyter_cache', + # Windows issues, some may need to be fixed in MyST-NB, others are upstream + 'ignore:Proactor event loop does not implement add_reader:RuntimeWarning:zmq', +] + +markers = [ + "sphinx_params", +]