Skip to content

Commit

Permalink
Update typings and remove dead link (#2056)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Oct 15, 2023
1 parent 4c452c7 commit b758aa1
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,7 @@ raw template
{%- endblock in_prompt -%}
"""


exporter_attr = AttrExporter()
output_attr, _ = exporter_attr.from_notebook_node(nb)
assert "raw template" in output_attr
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ py.test --pyargs nbconvert
## Documentation

- [Documentation for Jupyter nbconvert](https://nbconvert.readthedocs.io/en/latest/)
\[[PDF](https://media.readthedocs.org/pdf/nbconvert/latest/nbconvert.pdf)\]
- [nbconvert examples on GitHub](https://github.com/jupyter/nbconvert-examples)
- [Documentation for Project Jupyter](https://jupyter.readthedocs.io/en/latest/index.html)
\[[PDF](https://media.readthedocs.org/pdf/jupyter/latest/jupyter.pdf)\]

## Technical Support

Expand Down
2 changes: 1 addition & 1 deletion nbconvert/exporters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys

if sys.version_info < (3, 10):
from importlib_metadata import entry_points # type:ignore[import]
from importlib_metadata import entry_points # type:ignore[import-not-found]
else:
from importlib.metadata import entry_points
from nbformat import NotebookNode
Expand Down
11 changes: 7 additions & 4 deletions nbconvert/exporters/qt_screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
import os

try:
from PyQt5 import QtCore # type:ignore[import]
from PyQt5.QtGui import QPageLayout, QPageSize # type:ignore[import]
from PyQt5.QtWebEngineWidgets import QWebEngineSettings, QWebEngineView # type:ignore[import]
from PyQt5.QtWidgets import QApplication # type:ignore[import]
from PyQt5 import QtCore # type:ignore[import-not-found]
from PyQt5.QtGui import QPageLayout, QPageSize # type:ignore[import-not-found]
from PyQt5.QtWebEngineWidgets import ( # type:ignore[import-not-found]
QWebEngineSettings,
QWebEngineView,
)
from PyQt5.QtWidgets import QApplication # type:ignore[import-not-found]

QT_INSTALLED = True
except ModuleNotFoundError:
Expand Down
2 changes: 1 addition & 1 deletion nbconvert/exporters/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys

if sys.version_info < (3, 10):
from importlib_metadata import entry_points # type:ignore[import]
from importlib_metadata import entry_points # type:ignore[import-not-found]
else:
from importlib.metadata import entry_points
from traitlets import Dict, default
Expand Down
2 changes: 1 addition & 1 deletion nbconvert/exporters/webpdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async def main(temp_file):
"""Run main playwright script."""
args = ["--no-sandbox"] if self.disable_sandbox else []
try:
from playwright.async_api import async_playwright # type: ignore[import]
from playwright.async_api import async_playwright # type: ignore[import-not-found]
except ModuleNotFoundError as e:
msg = (
"Playwright is not installed to support Web PDF conversion. "
Expand Down
2 changes: 1 addition & 1 deletion nbconvert/filters/filter_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
import re

from pandocfilters import RawInline, applyJSONFilters, stringify # type:ignore[import]
from pandocfilters import RawInline, applyJSONFilters, stringify # type:ignore[import-untyped]


def resolve_references(source):
Expand Down
2 changes: 1 addition & 1 deletion nbconvert/filters/pandoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
import os

from pandocfilters import Image, applyJSONFilters # type:ignore[import]
from pandocfilters import Image, applyJSONFilters # type:ignore[import-untyped]

from nbconvert.utils.base import NbConvertBase
from nbconvert.utils.pandoc import pandoc
Expand Down
2 changes: 1 addition & 1 deletion nbconvert/filters/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import bleach

# defusedxml does safe(r) parsing of untrusted XML data
from defusedxml import ElementTree # type:ignore[import]
from defusedxml import ElementTree # type:ignore[import-untyped]

from nbconvert.preprocessors.sanitize import _get_default_css_sanitizer

Expand Down
4 changes: 2 additions & 2 deletions nbconvert/preprocessors/csshtmlheader.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
import hashlib
import os

from jupyterlab_pygments import JupyterStyle # type:ignore[import]
from jupyterlab_pygments import JupyterStyle # type:ignore[import-untyped]
from pygments.style import Style
from traitlets import Type, Unicode, Union

from .base import Preprocessor

try:
from notebook import DEFAULT_STATIC_FILES_PATH # type:ignore[import]
from notebook import DEFAULT_STATIC_FILES_PATH # type:ignore[import-not-found]
except ImportError:
DEFAULT_STATIC_FILES_PATH = None

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.11.2", "jupyter_core>=5.3.2"]
dependencies = ["mypy~=1.6", "traitlets>=5.11.2", "jupyter_core>=5.3.2"]
[tool.hatch.envs.typing.scripts]
test = "mypy --install-types --non-interactive {args}"

Expand Down

0 comments on commit b758aa1

Please sign in to comment.