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

Fixup typings #2048

Merged
merged 2 commits into from
Oct 1, 2023
Merged
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
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
Loading