Skip to content

Commit 8389654

Browse files
authored
Revert "[pre-commit.ci] pre-commit autoupdate (#569)" (#642)
This reverts commit 8d6e25d.
1 parent 8d6e25d commit 8389654

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+474
-538
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ci:
1515
repos:
1616

1717
- repo: https://github.com/pre-commit/pre-commit-hooks
18-
rev: v5.0.0
18+
rev: v4.5.0
1919
hooks:
2020
- id: check-json
2121
- id: check-yaml
@@ -28,14 +28,14 @@ repos:
2828
- id: trailing-whitespace
2929

3030
- repo: https://github.com/astral-sh/ruff-pre-commit
31-
rev: v0.6.9
31+
rev: v0.1.4
3232
hooks:
3333
- id: ruff
3434
args: ["--fix", "--show-fixes"]
3535
- id: ruff-format
3636

3737
- repo: https://github.com/pre-commit/mirrors-mypy
38-
rev: v1.11.2
38+
rev: v1.6.1
3939
hooks:
4040
- id: mypy
4141
args: [--config-file=pyproject.toml]
@@ -51,7 +51,7 @@ repos:
5151
)$
5252
5353
- repo: https://github.com/codespell-project/codespell
54-
rev: v2.3.0
54+
rev: v2.2.6
5555
hooks:
5656
- id: codespell
5757
args: ["-S", "*.ipynb"]

docs/render/orphaned_nb.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@
3333
],
3434
"source": [
3535
"from myst_nb import glue\n",
36-
"\n",
3736
"glue(\"var_text\", \"My orphaned variable!\")\n",
38-
"glue(\"var_float\", 1.0 / 3.0)"
37+
"glue(\"var_float\", 1.0/3.0)"
3938
]
4039
}
4140
],

myst_nb/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""A docutils/sphinx parser for Jupyter Notebooks."""
2-
32
__version__ = "1.1.2"
43

54

myst_nb/cli.py

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

54
import argparse

myst_nb/core/config.py

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

myst_nb/core/execute/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Module for executing notebooks."""
2-
32
from __future__ import annotations
43

54
from pathlib import Path

myst_nb/core/execute/cache.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Execute a notebook from the cache."""
2-
32
from __future__ import annotations
43

54
from contextlib import nullcontext, suppress

myst_nb/core/execute/direct.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Execute a notebook directly."""
2-
32
from __future__ import annotations
43

54
from contextlib import nullcontext

myst_nb/core/execute/inline.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Execute a notebook inline."""
2-
32
from __future__ import annotations
43

54
import asyncio

myst_nb/core/lexers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Pygments lexers"""
2-
32
from __future__ import annotations
43

54
import re

myst_nb/core/loggers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
``logger.warning("message", line=1, subtype="foo")``
1010
1111
"""
12-
1312
import logging
1413
from typing import Union
1514

myst_nb/core/nb_to_tokens.py

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

54
from typing import Any

myst_nb/core/read.py

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

54
import dataclasses as dc

myst_nb/core/render.py

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

98
from binascii import a2b_base64

myst_nb/core/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Shared utilities."""
2-
32
from __future__ import annotations
43

54
import re

myst_nb/core/variables.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Utilities for rendering code output variables."""
2-
32
from __future__ import annotations
43

54
from ast import literal_eval

myst_nb/docutils_.py

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

54
from dataclasses import dataclass, field

myst_nb/ext/eval/__init__.py

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

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

169168
mime_nodes = render_variable_outputs(
170169
data, self.document, self.line, self.source, render=render

myst_nb/ext/execution_tables.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
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-
87
from __future__ import annotations
98

109
from datetime import datetime

myst_nb/ext/glue/__init__.py

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

76
from typing import TYPE_CHECKING, Any

myst_nb/ext/glue/crossref.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
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-
76
from __future__ import annotations
87

98
from functools import lru_cache

myst_nb/ext/glue/directives.py

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

98
from docutils import nodes
@@ -152,9 +151,9 @@ def run(self):
152151
render: Dict[str, Any] = {}
153152
for key in ("alt", "height", "width", "scale", "class"):
154153
if key in self.options:
155-
render.setdefault("image", {})[key.replace("classes", "class")] = (
156-
self.options[key]
157-
)
154+
render.setdefault("image", {})[
155+
key.replace("classes", "class")
156+
] = self.options[key]
158157
paste_nodes = render_variable_outputs(
159158
[data], self.document, self.line, self.source, render=render
160159
)

myst_nb/ext/glue/domain.py

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

87
from .directives import (

myst_nb/ext/glue/roles.py

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

98
from docutils import nodes

myst_nb/ext/glue/utils.py

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

98
from functools import partial

myst_nb/ext/utils.py

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

98
from typing import Any

myst_nb/sphinx_.py

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

54
from collections import defaultdict

myst_nb/sphinx_ext.py

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

54
import contextlib

myst_nb/warnings_.py

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

54
from enum import Enum

tests/notebooks/basic_failing.ipynb

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
{
2-
"cells": [
3-
{
4-
"cell_type": "markdown",
5-
"metadata": {},
6-
"source": [
7-
"# a title\n",
8-
"\n",
9-
"some text\n"
10-
]
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# a title\n",
8+
"\n",
9+
"some text\n"
10+
]
11+
},
12+
{
13+
"cell_type": "code",
14+
"execution_count": null,
15+
"metadata": {},
16+
"source": [
17+
"raise Exception('oopsie!')"
18+
],
19+
"outputs": []
20+
}
21+
],
22+
"metadata": {
23+
"test_name": "notebook1",
24+
"kernelspec": {
25+
"display_name": "Python 3",
26+
"language": "python",
27+
"name": "python3"
28+
},
29+
"language_info": {
30+
"codemirror_mode": {
31+
"name": "ipython",
32+
"version": 3
33+
},
34+
"file_extension": ".py",
35+
"mimetype": "text/x-python",
36+
"name": "python",
37+
"nbconvert_exporter": "python",
38+
"pygments_lexer": "ipython3",
39+
"version": "3.6.1"
40+
}
1141
},
12-
{
13-
"cell_type": "code",
14-
"execution_count": null,
15-
"metadata": {},
16-
"outputs": [],
17-
"source": [
18-
"raise Exception(\"oopsie!\")"
19-
]
20-
}
21-
],
22-
"metadata": {
23-
"kernelspec": {
24-
"display_name": "Python 3",
25-
"language": "python",
26-
"name": "python3"
27-
},
28-
"language_info": {
29-
"codemirror_mode": {
30-
"name": "ipython",
31-
"version": 3
32-
},
33-
"file_extension": ".py",
34-
"mimetype": "text/x-python",
35-
"name": "python",
36-
"nbconvert_exporter": "python",
37-
"pygments_lexer": "ipython3",
38-
"version": "3.6.1"
39-
},
40-
"test_name": "notebook1"
41-
},
42-
"nbformat": 4,
43-
"nbformat_minor": 2
42+
"nbformat": 4,
43+
"nbformat_minor": 2
4444
}

0 commit comments

Comments
 (0)