Skip to content

Commit

Permalink
Revert "[pre-commit.ci] pre-commit autoupdate (#569)" (#642)
Browse files Browse the repository at this point in the history
This reverts commit 8d6e25d.
  • Loading branch information
agoose77 authored Oct 8, 2024
1 parent 8d6e25d commit 8389654
Show file tree
Hide file tree
Showing 69 changed files with 474 additions and 538 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ci:
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v4.5.0
hooks:
- id: check-json
- id: check-yaml
Expand All @@ -28,14 +28,14 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.1.4
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.6.1
hooks:
- id: mypy
args: [--config-file=pyproject.toml]
Expand All @@ -51,7 +51,7 @@ repos:
)$
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.2.6
hooks:
- id: codespell
args: ["-S", "*.ipynb"]
3 changes: 1 addition & 2 deletions docs/render/orphaned_nb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@
],
"source": [
"from myst_nb import glue\n",
"\n",
"glue(\"var_text\", \"My orphaned variable!\")\n",
"glue(\"var_float\", 1.0 / 3.0)"
"glue(\"var_float\", 1.0/3.0)"
]
}
],
Expand Down
1 change: 0 additions & 1 deletion myst_nb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""A docutils/sphinx parser for Jupyter Notebooks."""

__version__ = "1.1.2"


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

from __future__ import annotations

import argparse
Expand Down
1 change: 0 additions & 1 deletion myst_nb/core/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""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: 0 additions & 1 deletion myst_nb/core/execute/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Module for executing notebooks."""

from __future__ import annotations

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

from __future__ import annotations

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

from __future__ import annotations

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

from __future__ import annotations

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

from __future__ import annotations

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

import logging
from typing import Union

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

from __future__ import annotations

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

from __future__ import annotations

import dataclasses as dc
Expand Down
1 change: 0 additions & 1 deletion myst_nb/core/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
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: 0 additions & 1 deletion myst_nb/core/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Shared utilities."""

from __future__ import annotations

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

from __future__ import annotations

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

from __future__ import annotations

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

from __future__ import annotations

from functools import partial
Expand Down Expand Up @@ -162,9 +161,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: 0 additions & 1 deletion myst_nb/ext/execution_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
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: 0 additions & 1 deletion myst_nb/ext/glue/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""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: 0 additions & 1 deletion myst_nb/ext/glue/crossref.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
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: 3 additions & 4 deletions myst_nb/ext/glue/directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
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 @@ -152,9 +151,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: 0 additions & 1 deletion myst_nb/ext/glue/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
This is required for any directive/role names using `:`.
"""

from sphinx.domains import Domain

from .directives import (
Expand Down
1 change: 0 additions & 1 deletion myst_nb/ext/glue/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
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: 0 additions & 1 deletion myst_nb/ext/glue/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
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: 0 additions & 1 deletion myst_nb/ext/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
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: 0 additions & 1 deletion myst_nb/sphinx_.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""The sphinx parser implementation for myst-nb."""

from __future__ import annotations

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

from __future__ import annotations

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

from __future__ import annotations

from enum import Enum
Expand Down
82 changes: 41 additions & 41 deletions tests/notebooks/basic_failing.ipynb
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# a title\n",
"\n",
"some text\n"
]
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# a title\n",
"\n",
"some text\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"source": [
"raise Exception('oopsie!')"
],
"outputs": []
}
],
"metadata": {
"test_name": "notebook1",
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"raise Exception(\"oopsie!\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
},
"test_name": "notebook1"
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit 8389654

Please sign in to comment.