Skip to content

Commit

Permalink
Fixup typings (#2048)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Oct 1, 2023
1 parent a1fec27 commit 2492a68
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions nbconvert/nbconvertapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ class NbConvertApp(JupyterApp):

version = __version__
name = "jupyter-nbconvert"
aliases = nbconvert_aliases
flags = nbconvert_flags
aliases = nbconvert_aliases # type:ignore[assignment]
flags = nbconvert_flags # type:ignore[assignment]

@default("log_level")
def _log_level_default(self):
Expand Down Expand Up @@ -597,7 +597,7 @@ def document_flag_help(self):
Return a string containing descriptions of all the flags.
"""
flags = "The following flags are defined:\n\n"
for flag, (cfg, fhelp) in self.flags.items():
for flag, (cfg, fhelp) in self.flags.items(): # type:ignore[has-type]
flags += f"{flag}\n"
flags += indent(fill(fhelp, 80)) + "\n\n"
flags += indent(fill("Long Form: " + str(cfg), 80)) + "\n\n"
Expand All @@ -607,7 +607,7 @@ def document_alias_help(self):
"""Return a string containing all of the aliases"""

aliases = "The following aliases are defined:\n\n"
for alias, longname in self.aliases.items():
for alias, longname in self.aliases.items(): # type:ignore[has-type]
aliases += f"\t**{alias}** ({longname})\n\n"
return aliases

Expand Down
2 changes: 1 addition & 1 deletion nbconvert/preprocessors/sanitize.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SanitizeHTML(Preprocessor):
"""A preprocessor to sanitize html."""

# Bleach config.
attributes = Any( # type:ignore[call-overload]
attributes = Any(
config=True,
default_value=ALLOWED_ATTRIBUTES,
help="Allowed HTML tag attributes",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ nowarn = "test -W default {args}"

[tool.hatch.envs.typing]
features = ["test"]
dependencies = ["mypy>=1.5.1", "traitlets>=5.10"]
dependencies = ["mypy>=1.5.1", "traitlets>=5.10.1", "jupyter_core>=5.3.2"]
[tool.hatch.envs.typing.scripts]
test = "mypy --install-types --non-interactive {args}"

Expand Down
2 changes: 2 additions & 0 deletions tests/exporters/test_qtpng.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os

import pytest
from flaky import flaky

from nbconvert.exporters.qt_screenshot import QT_INSTALLED
from nbconvert.exporters.qtpng import QtPNGExporter
Expand All @@ -19,6 +20,7 @@ class TestQtPNGExporter(ExportersTestsBase):

exporter_class = QtPNGExporter # type:ignore

@flaky
def test_export(self):
"""
Can a TemplateExporter export something?
Expand Down

0 comments on commit 2492a68

Please sign in to comment.