Skip to content

Commit 78714f1

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent b70b4f0 commit 78714f1

35 files changed

+41
-6
lines changed

myst_nb/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""A docutils/sphinx parser for Jupyter Notebooks."""
2+
23
__version__ = "1.1.0"
34

45

myst_nb/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""A basic CLI for quickstart of a myst_nb project."""
2+
23
from __future__ import annotations
34

45
import argparse

myst_nb/core/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Configuration for myst-nb."""
2+
23
import dataclasses as dc
34
from enum import Enum
45
from typing import Any, Callable, Dict, Iterable, Literal, Optional, Sequence, Tuple

myst_nb/core/execute/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module for executing notebooks."""
2+
23
from __future__ import annotations
34

45
from pathlib import Path

myst_nb/core/execute/cache.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Execute a notebook from the cache."""
2+
23
from __future__ import annotations
34

45
from contextlib import nullcontext, suppress

myst_nb/core/execute/direct.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Execute a notebook directly."""
2+
23
from __future__ import annotations
34

45
from contextlib import nullcontext

myst_nb/core/execute/inline.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Execute a notebook inline."""
2+
23
from __future__ import annotations
34

45
import asyncio

myst_nb/core/lexers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Pygments lexers"""
2+
23
from __future__ import annotations
34

45
import re

myst_nb/core/loggers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
``logger.warning("message", line=1, subtype="foo")``
1010
1111
"""
12+
1213
import logging
1314
from typing import Union
1415

myst_nb/core/nb_to_tokens.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module for parsing notebooks to Markdown-it tokens."""
2+
23
from __future__ import annotations
34

45
from typing import Any

myst_nb/core/read.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module for reading notebook formats from a string input."""
2+
23
from __future__ import annotations
34

45
import dataclasses as dc

myst_nb/core/render.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Note, this module purposely does not import any Sphinx modules at the top-level,
44
in order for docutils-only use.
55
"""
6+
67
from __future__ import annotations
78

89
from binascii import a2b_base64

myst_nb/core/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Shared utilities."""
2+
23
from __future__ import annotations
34

45
import re

myst_nb/core/variables.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Utilities for rendering code output variables."""
2+
23
from __future__ import annotations
34

45
from ast import literal_eval

myst_nb/docutils_.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The docutils parser implementation for myst-nb."""
2+
23
from __future__ import annotations
34

45
from dataclasses import dataclass, field

myst_nb/ext/eval/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Roles/directives for evaluating variables in the notebook."""
2+
23
from __future__ import annotations
34

45
from functools import partial
@@ -161,9 +162,9 @@ def run(self):
161162
render: dict[str, Any] = {}
162163
for key in ("alt", "height", "width", "scale", "class"):
163164
if key in self.options:
164-
render.setdefault("image", {})[
165-
key.replace("classes", "class")
166-
] = self.options[key]
165+
render.setdefault("image", {})[key.replace("classes", "class")] = (
166+
self.options[key]
167+
)
167168

168169
mime_nodes = render_variable_outputs(
169170
data, self.document, self.line, self.source, render=render

myst_nb/ext/execution_tables.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
which is then replaced by a table of statistics in a post-transformation
55
(once all the documents have been executed and these statistics are available).
66
"""
7+
78
from __future__ import annotations
89

910
from datetime import datetime

myst_nb/ext/glue/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Functionality for storing special data in notebook code cells,
22
which can then be inserted into the document body.
33
"""
4+
45
from __future__ import annotations
56

67
from typing import TYPE_CHECKING, Any

myst_nb/ext/glue/crossref.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Note, we restrict this to a only a subset of mime-types and data -> nodes transforms,
44
since adding these nodes in a post-transform will not apply any transforms to them.
55
"""
6+
67
from __future__ import annotations
78

89
from functools import lru_cache

myst_nb/ext/glue/directives.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
We intentionally do no import sphinx in this module,
44
in order to allow docutils-only use without sphinx installed.
55
"""
6+
67
from typing import TYPE_CHECKING, Any, Dict, List
78

89
from docutils import nodes
@@ -151,9 +152,9 @@ def run(self):
151152
render: Dict[str, Any] = {}
152153
for key in ("alt", "height", "width", "scale", "class"):
153154
if key in self.options:
154-
render.setdefault("image", {})[
155-
key.replace("classes", "class")
156-
] = self.options[key]
155+
render.setdefault("image", {})[key.replace("classes", "class")] = (
156+
self.options[key]
157+
)
157158
paste_nodes = render_variable_outputs(
158159
[data], self.document, self.line, self.source, render=render
159160
)

myst_nb/ext/glue/domain.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
This is required for any directive/role names using `:`.
44
"""
5+
56
from sphinx.domains import Domain
67

78
from .directives import (

myst_nb/ext/glue/roles.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
We intentionally do no import sphinx in this module,
44
in order to allow docutils-only use without sphinx installed.
55
"""
6+
67
from __future__ import annotations
78

89
from docutils import nodes

myst_nb/ext/glue/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
We intentionally do no import sphinx in this module,
44
in order to allow docutils-only use without sphinx installed.
55
"""
6+
67
from __future__ import annotations
78

89
from functools import partial

myst_nb/ext/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
We intentionally do no import sphinx in this module,
44
in order to allow docutils-only use without sphinx installed.
55
"""
6+
67
from __future__ import annotations
78

89
from typing import Any

myst_nb/sphinx_.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The sphinx parser implementation for myst-nb."""
2+
23
from __future__ import annotations
34

45
from collections import defaultdict

myst_nb/sphinx_ext.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Setup for the myst-nb sphinx extension."""
2+
23
from __future__ import annotations
34

45
import contextlib

myst_nb/warnings_.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Central handling of warnings for the myst-nb extension."""
2+
23
from __future__ import annotations
34

45
from enum import Enum

tests/test_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test the quickstart CLI"""
2+
23
import os
34
from pathlib import Path
45

tests/test_codecell_file.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test notebooks containing code cells with the `load` option."""
2+
23
import pytest
34
from sphinx.util.fileutil import copy_asset_file
45

tests/test_docutils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Run parsing tests against the docutils parser."""
2+
23
from io import StringIO
34
import json
45
from pathlib import Path

tests/test_eval.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test the `eval` directives and roles."""
2+
23
import pytest
34

45

tests/test_execute.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test sphinx builds which execute notebooks."""
2+
23
import os
34
from pathlib import Path
45

tests/test_glue.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test the `glue` directives and roles."""
2+
23
from IPython.core.displaypub import DisplayPublisher
34
from IPython.core.interactiveshell import InteractiveShell
45
import nbformat

tests/test_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test parsing of already executed notebooks."""
2+
23
import os
34
from pathlib import Path
45

tests/test_render_outputs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for rendering code cell outputs."""
2+
23
import pytest
34

45
from myst_nb.core.render import EntryPointError, load_renderer

0 commit comments

Comments
 (0)