Skip to content

Commit

Permalink
MAINT: appease mypy (#612)
Browse files Browse the repository at this point in the history
* maint: appease MyPy

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* chore: restore ignored type

* ci: disable pre-commit

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
agoose77 and pre-commit-ci[bot] authored Jun 27, 2024
1 parent 3398d2e commit d9556d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@ on:
pull_request:

jobs:
pre-commit:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: pre-commit/[email protected]

tests:

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repos:
additional_dependencies:
- importlib_metadata
- myst-parser~=2.0.0
- "sphinx~=7.0"
- "sphinx~=7.3.7"
- nbclient
- types-PyYAML
files: >
Expand Down
13 changes: 8 additions & 5 deletions myst_nb/sphinx_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,16 @@ def sphinx_setup(app: Sphinx):
for name, default, field in NbParserConfig().as_triple():
if not field.metadata.get("sphinx_exclude"):
# TODO add types?
app.add_config_value(f"nb_{name}", default, "env", Any)
app.add_config_value(f"nb_{name}", default, "env", Any) # type: ignore[arg-type]
if "legacy_name" in field.metadata:
app.add_config_value(
f"{field.metadata['legacy_name']}", _UNSET, "env", Any
f"{field.metadata['legacy_name']}",
_UNSET,
"env",
Any, # type: ignore[arg-type]
)
# Handle non-standard deprecation
app.add_config_value("nb_render_priority", _UNSET, "env", Any)
app.add_config_value("nb_render_priority", _UNSET, "env", Any) # type: ignore[arg-type]

# generate notebook configuration from Sphinx configuration
# this also validates the configuration values
Expand Down Expand Up @@ -130,7 +133,7 @@ def create_mystnb_config(app):
"""Generate notebook configuration from Sphinx configuration"""

# Ignore type checkers because the attribute is dynamically assigned
from sphinx.util.console import bold # type: ignore[attr-defined]
from sphinx.util.console import bold

values = {}
for name, _, field in NbParserConfig().as_triple():
Expand Down Expand Up @@ -227,4 +230,4 @@ def add_per_page_html_resources(
return
js_files = NbMetadataCollector.get_js_files(cast(SphinxEnvType, app.env), pagename)
for path, kwargs in js_files.values():
app.add_js_file(path, **kwargs) # type: ignore
app.add_js_file(path, **kwargs) # type: ignore[arg-type]

0 comments on commit d9556d0

Please sign in to comment.