Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: fail on warnings #647

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions myst_nb/core/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand All @@ -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",
]