Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 10, 2024
1 parent 4cc26ad commit 5a22035
Show file tree
Hide file tree
Showing 35 changed files with 41 additions and 6 deletions.
1 change: 1 addition & 0 deletions myst_nb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A docutils/sphinx parser for Jupyter Notebooks."""

__version__ = "1.1.0"


Expand Down
1 change: 1 addition & 0 deletions myst_nb/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A basic CLI for quickstart of a myst_nb project."""

from __future__ import annotations

import argparse
Expand Down
1 change: 1 addition & 0 deletions myst_nb/core/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Configuration for myst-nb."""

import dataclasses as dc
from enum import Enum
from typing import Any, Callable, Dict, Iterable, Literal, Optional, Sequence, Tuple
Expand Down
1 change: 1 addition & 0 deletions myst_nb/core/execute/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for executing notebooks."""

from __future__ import annotations

from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions myst_nb/core/execute/cache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Execute a notebook from the cache."""

from __future__ import annotations

from contextlib import nullcontext, suppress
Expand Down
1 change: 1 addition & 0 deletions myst_nb/core/execute/direct.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Execute a notebook directly."""

from __future__ import annotations

from contextlib import nullcontext
Expand Down
1 change: 1 addition & 0 deletions myst_nb/core/execute/inline.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Execute a notebook inline."""

from __future__ import annotations

import asyncio
Expand Down
1 change: 1 addition & 0 deletions myst_nb/core/lexers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Pygments lexers"""

from __future__ import annotations

import re
Expand Down
1 change: 1 addition & 0 deletions myst_nb/core/loggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
``logger.warning("message", line=1, subtype="foo")``
"""

import logging
from typing import Union

Expand Down
1 change: 1 addition & 0 deletions myst_nb/core/nb_to_tokens.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for parsing notebooks to Markdown-it tokens."""

from __future__ import annotations

from typing import Any
Expand Down
1 change: 1 addition & 0 deletions myst_nb/core/read.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for reading notebook formats from a string input."""

from __future__ import annotations

import dataclasses as dc
Expand Down
1 change: 1 addition & 0 deletions myst_nb/core/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Note, this module purposely does not import any Sphinx modules at the top-level,
in order for docutils-only use.
"""

from __future__ import annotations

from binascii import a2b_base64
Expand Down
1 change: 1 addition & 0 deletions myst_nb/core/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Shared utilities."""

from __future__ import annotations

import re
Expand Down
1 change: 1 addition & 0 deletions myst_nb/core/variables.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for rendering code output variables."""

from __future__ import annotations

from ast import literal_eval
Expand Down
1 change: 1 addition & 0 deletions myst_nb/docutils_.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The docutils parser implementation for myst-nb."""

from __future__ import annotations

from dataclasses import dataclass, field
Expand Down
7 changes: 4 additions & 3 deletions myst_nb/ext/eval/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Roles/directives for evaluating variables in the notebook."""

from __future__ import annotations

from functools import partial
Expand Down Expand Up @@ -161,9 +162,9 @@ def run(self):
render: dict[str, Any] = {}
for key in ("alt", "height", "width", "scale", "class"):
if key in self.options:
render.setdefault("image", {})[
key.replace("classes", "class")
] = self.options[key]
render.setdefault("image", {})[key.replace("classes", "class")] = (
self.options[key]
)

mime_nodes = render_variable_outputs(
data, self.document, self.line, self.source, render=render
Expand Down
1 change: 1 addition & 0 deletions myst_nb/ext/execution_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
which is then replaced by a table of statistics in a post-transformation
(once all the documents have been executed and these statistics are available).
"""

from __future__ import annotations

from datetime import datetime
Expand Down
1 change: 1 addition & 0 deletions myst_nb/ext/glue/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Functionality for storing special data in notebook code cells,
which can then be inserted into the document body.
"""

from __future__ import annotations

from typing import TYPE_CHECKING, Any
Expand Down
1 change: 1 addition & 0 deletions myst_nb/ext/glue/crossref.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Note, we restrict this to a only a subset of mime-types and data -> nodes transforms,
since adding these nodes in a post-transform will not apply any transforms to them.
"""

from __future__ import annotations

from functools import lru_cache
Expand Down
7 changes: 4 additions & 3 deletions myst_nb/ext/glue/directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
We intentionally do no import sphinx in this module,
in order to allow docutils-only use without sphinx installed.
"""

from typing import TYPE_CHECKING, Any, Dict, List

from docutils import nodes
Expand Down Expand Up @@ -151,9 +152,9 @@ def run(self):
render: Dict[str, Any] = {}
for key in ("alt", "height", "width", "scale", "class"):
if key in self.options:
render.setdefault("image", {})[
key.replace("classes", "class")
] = self.options[key]
render.setdefault("image", {})[key.replace("classes", "class")] = (
self.options[key]
)
paste_nodes = render_variable_outputs(
[data], self.document, self.line, self.source, render=render
)
Expand Down
1 change: 1 addition & 0 deletions myst_nb/ext/glue/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This is required for any directive/role names using `:`.
"""

from sphinx.domains import Domain

from .directives import (
Expand Down
1 change: 1 addition & 0 deletions myst_nb/ext/glue/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
We intentionally do no import sphinx in this module,
in order to allow docutils-only use without sphinx installed.
"""

from __future__ import annotations

from docutils import nodes
Expand Down
1 change: 1 addition & 0 deletions myst_nb/ext/glue/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
We intentionally do no import sphinx in this module,
in order to allow docutils-only use without sphinx installed.
"""

from __future__ import annotations

from functools import partial
Expand Down
1 change: 1 addition & 0 deletions myst_nb/ext/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
We intentionally do no import sphinx in this module,
in order to allow docutils-only use without sphinx installed.
"""

from __future__ import annotations

from typing import Any
Expand Down
1 change: 1 addition & 0 deletions myst_nb/sphinx_.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The sphinx parser implementation for myst-nb."""

from __future__ import annotations

from collections import defaultdict
Expand Down
1 change: 1 addition & 0 deletions myst_nb/sphinx_ext.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Setup for the myst-nb sphinx extension."""

from __future__ import annotations

import contextlib
Expand Down
1 change: 1 addition & 0 deletions myst_nb/warnings_.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Central handling of warnings for the myst-nb extension."""

from __future__ import annotations

from enum import Enum
Expand Down
1 change: 1 addition & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the quickstart CLI"""

import os
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions tests/test_codecell_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test notebooks containing code cells with the `load` option."""

import pytest
from sphinx.util.fileutil import copy_asset_file

Expand Down
1 change: 1 addition & 0 deletions tests/test_docutils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Run parsing tests against the docutils parser."""

from io import StringIO
import json
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions tests/test_eval.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the `eval` directives and roles."""

import pytest


Expand Down
1 change: 1 addition & 0 deletions tests/test_execute.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test sphinx builds which execute notebooks."""

import os
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions tests/test_glue.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the `glue` directives and roles."""

from IPython.core.displaypub import DisplayPublisher
from IPython.core.interactiveshell import InteractiveShell
import nbformat
Expand Down
1 change: 1 addition & 0 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test parsing of already executed notebooks."""

import os
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions tests/test_render_outputs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for rendering code cell outputs."""

import pytest

from myst_nb.core.render import EntryPointError, load_renderer
Expand Down

0 comments on commit 5a22035

Please sign in to comment.