Skip to content

Commit

Permalink
chore: update pre-commit hooks (#2134)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Steven Silvester <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and blink1073 authored Apr 1, 2024
1 parent 35fd158 commit 36e1b77
Show file tree
Hide file tree
Showing 28 changed files with 22 additions and 16 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.4
rev: 0.28.1
hooks:
- id: check-github-workflows

Expand Down Expand Up @@ -51,7 +51,7 @@ repos:
args: ["-L", "sur,nd"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.8.0"
rev: "v1.9.0"
hooks:
- id: mypy
files: "^nbconvert"
Expand Down Expand Up @@ -81,7 +81,7 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
rev: v0.3.5
hooks:
- id: ruff
types_or: [python, jupyter]
Expand All @@ -90,7 +90,7 @@ repos:
types_or: [python, jupyter]

- repo: https://github.com/scientific-python/cookie
rev: "2024.01.24"
rev: "2024.03.10"
hooks:
- id: sp-repo-review
additional_dependencies: ["repo-review[cli]"]
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1566,6 +1566,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
1 change: 1 addition & 0 deletions check_requirements.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Verify that the "all" reqs are in sync."""

import sys

from tomli import load
Expand Down
1 change: 1 addition & 0 deletions docs/api_examples/template_path/make_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Note: nbconvert 6.0 changed ``template_path`` to ``template_paths``
"""

import nbformat
from traitlets.config import Config

Expand Down
1 change: 1 addition & 0 deletions docs/autogen_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
jupyter_nbconvert_config.py.
"""

import os.path

from nbconvert.nbconvertapp import NbConvertApp
Expand Down
1 change: 1 addition & 0 deletions hatch_build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Custom build script for hatch backend"""

import os
import sys
from urllib.request import urlopen
Expand Down
1 change: 1 addition & 0 deletions nbconvert/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""nbconvert cli entry point."""

from .nbconvertapp import main

main()
1 change: 1 addition & 0 deletions nbconvert/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""nbconvert version info."""

import re
from typing import List

Expand Down
1 change: 1 addition & 0 deletions nbconvert/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""pytest configuration."""

import asyncio
import os

Expand Down
1 change: 1 addition & 0 deletions nbconvert/exporters/qt_exporter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A qt exporter."""

import os
import sys
import tempfile
Expand Down
1 change: 1 addition & 0 deletions nbconvert/exporters/qt_screenshot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A qt screenshot exporter."""

import os

try:
Expand Down
1 change: 1 addition & 0 deletions nbconvert/filters/filter_links.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""A pandoc filter used in converting notebooks to Latex.
Converts links between notebooks to Latex cross-references.
"""

import re

from pandocfilters import RawInline, applyJSONFilters, stringify # type:ignore[import-untyped]
Expand Down
1 change: 0 additions & 1 deletion nbconvert/filters/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.


import re

try:
Expand Down
1 change: 0 additions & 1 deletion nbconvert/filters/markdown_mistune.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.


import base64
import mimetypes
import os
Expand Down
1 change: 1 addition & 0 deletions nbconvert/filters/pandoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Convert between any two formats using pandoc,
and related filters
"""

import os

from pandocfilters import Image, applyJSONFilters # type:ignore[import-untyped]
Expand Down
1 change: 1 addition & 0 deletions nbconvert/preprocessors/coalescestreams.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Preprocessor for merging consecutive stream outputs for easier handling."""

import re

# Copyright (c) IPython Development Team.
Expand Down
1 change: 0 additions & 1 deletion nbconvert/preprocessors/convertfigures.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.


from traitlets import Unicode

from .base import Preprocessor
Expand Down
3 changes: 1 addition & 2 deletions nbconvert/preprocessors/csshtmlheader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Module that pre-processes the notebook for export to HTML.
"""
"""Module that pre-processes the notebook for export to HTML."""

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
Expand Down
1 change: 1 addition & 0 deletions nbconvert/preprocessors/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

"""Module containing a preprocessor that executes the code cells
and updates outputs"""

from __future__ import annotations

import typing as t
Expand Down
1 change: 0 additions & 1 deletion nbconvert/preprocessors/highlightmagics.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.


import re

from traitlets import Dict
Expand Down
1 change: 0 additions & 1 deletion nbconvert/preprocessors/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# Imports
# -----------------------------------------------------------------------------


from traitlets import List, Unicode

from .base import Preprocessor
Expand Down
1 change: 0 additions & 1 deletion nbconvert/utils/_contextlib_chdir.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Backport of Python 3.11's contextlib.chdir."""


import os
from contextlib import AbstractContextManager

Expand Down
2 changes: 1 addition & 1 deletion nbconvert/utils/iso639_1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" List of ISO639-1 language code"""
"""List of ISO639-1 language code"""

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
Expand Down
1 change: 1 addition & 0 deletions nbconvert/utils/lexers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Deprecated as of 5.0; import from IPython.lib.lexers instead."""

from warnings import warn

warn("nbconvert.utils.lexers is deprecated as of 5.0. Use IPython.lib.lexers", stacklevel=2)
Expand Down
1 change: 0 additions & 1 deletion nbconvert/utils/pandoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.


import re
import shutil
import subprocess
Expand Down
1 change: 1 addition & 0 deletions nbconvert/utils/text.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Text related utils."""

import os
import re

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ disable_error_code = ["no-untyped-def", "no-untyped-call"]
warn_unreachable = true

[tool.ruff]
target-version = "py38"
line-length = 100

[tool.ruff.format]
Expand Down
1 change: 0 additions & 1 deletion tests/filters/test_ansi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.


from nbconvert.filters.ansi import ansi2html, ansi2latex, strip_ansi
from tests.base import TestsBase

Expand Down

0 comments on commit 36e1b77

Please sign in to comment.