From 95a2bed85c80e504c8df0bd375ef80ba6ac8c39f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 23:49:56 +0000 Subject: [PATCH 1/2] chore: update pre-commit hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0) - [github.com/python-jsonschema/check-jsonschema: 0.28.4 → 0.30.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.28.4...0.30.0) - [github.com/executablebooks/mdformat: 0.7.17 → 0.7.19](https://github.com/executablebooks/mdformat/compare/0.7.17...0.7.19) - [github.com/adamchainz/blacken-docs: 1.16.0 → 1.19.1](https://github.com/adamchainz/blacken-docs/compare/1.16.0...1.19.1) - [github.com/pre-commit/mirrors-mypy: v1.10.0 → v1.13.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.0...v1.13.0) - [github.com/astral-sh/ruff-pre-commit: v0.4.7 → v0.8.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.7...v0.8.1) - [github.com/scientific-python/cookie: 2024.04.23 → 2024.08.19](https://github.com/scientific-python/cookie/compare/2024.04.23...2024.08.19) --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 05a3bcf..8f9a1e6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-case-conflict - id: check-ast @@ -21,12 +21,12 @@ repos: - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.28.4 + rev: 0.30.0 hooks: - id: check-github-workflows - repo: https://github.com/executablebooks/mdformat - rev: 0.7.17 + rev: 0.7.19 hooks: - id: mdformat @@ -37,7 +37,7 @@ repos: types_or: [yaml, html, json] - repo: https://github.com/adamchainz/blacken-docs - rev: "1.16.0" + rev: "1.19.1" hooks: - id: blacken-docs additional_dependencies: [black==23.7.0] @@ -56,7 +56,7 @@ repos: - id: rst-inline-touching-normal - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.10.0" + rev: "v1.13.0" hooks: - id: mypy files: "^nbformat" @@ -65,7 +65,7 @@ repos: ["jsonschema>=2.6", "traitlets>=5.13", "jupyter_core>5.4"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.7 + rev: v0.8.1 hooks: - id: ruff types_or: [python, jupyter] @@ -76,7 +76,7 @@ repos: types_or: [python, jupyter] - repo: https://github.com/scientific-python/cookie - rev: "2024.04.23" + rev: "2024.08.19" hooks: - id: sp-repo-review additional_dependencies: ["repo-review[cli]"] From 793c9bc3251bbf1fe9c0db917b76e7c313b3674e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 23:50:19 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- CHANGELOG.md | 10 +++++----- nbformat/__init__.py | 22 +++++++++++----------- nbformat/current.py | 32 ++++++++++++++++---------------- nbformat/json_compat.py | 6 +++--- nbformat/v3/__init__.py | 32 ++++++++++++++++---------------- nbformat/v4/__init__.py | 6 +++--- nbformat/validator.py | 6 +++--- 7 files changed, 57 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9120c4e..c94d03c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -318,11 +318,11 @@ sure to generate valid notebooks. ## 5.0.8 -- Add optional support for using \[fastjsonschema\]{.title-ref} as the +- Add optional support for using [fastjsonschema]{.title-ref} as the JSON validation library. To enable fast validation, install - \[fastjsonschema\]{.title-ref} and set the environment variable - \[NBFORMAT_VALIDATOR\]{.title-ref} to the value - \[fastjsonschema\]{.title-ref}. + [fastjsonschema]{.title-ref} and set the environment variable + [NBFORMAT_VALIDATOR]{.title-ref} to the value + [fastjsonschema]{.title-ref}. ## 5.0.7 @@ -397,7 +397,7 @@ sure to generate valid notebooks. database. - Dict-like objects added to NotebookNode attributes are now transformed to be NotebookNode objects; transformation also works - for \[.update()\]{.title-ref}. + for [.update()]{.title-ref}. ## 4.3 diff --git a/nbformat/__init__.py b/nbformat/__init__.py index d0fcf85..57940fc 100644 --- a/nbformat/__init__.py +++ b/nbformat/__init__.py @@ -16,23 +16,23 @@ from .sentinel import Sentinel __all__ = [ - "versions", - "validate", + "NO_CONVERT", + "NBFormatError", + "NotebookNode", + "Sentinel", "ValidationError", + "__version__", "convert", - "from_dict", - "NotebookNode", "current_nbformat", "current_nbformat_minor", - "NBFormatError", - "NO_CONVERT", - "reads", + "from_dict", "read", - "writes", - "write", + "reads", + "validate", "version_info", - "__version__", - "Sentinel", + "versions", + "write", + "writes", ] versions = { diff --git a/nbformat/current.py b/nbformat/current.py index c5ea4f6..78a9d9d 100644 --- a/nbformat/current.py +++ b/nbformat/current.py @@ -47,32 +47,32 @@ ) __all__ = [ + "NBFormatError", "NotebookNode", + "convert", + "nbformat", + "nbformat_minor", + "nbformat_schema", + "new_author", "new_code_cell", - "new_text_cell", + "new_heading_cell", + "new_metadata", "new_notebook", "new_output", + "new_text_cell", "new_worksheet", "parse_filename", - "new_metadata", - "new_author", - "new_heading_cell", - "nbformat", - "nbformat_minor", - "nbformat_schema", - "to_notebook_json", - "convert", - "validate", - "NBFormatError", "parse_py", + "read", + "reads", "reads_json", - "writes_json", "reads_py", - "writes_py", - "reads", - "writes", - "read", + "to_notebook_json", + "validate", "write", + "writes", + "writes_json", + "writes_py", ] current_nbformat = nbformat diff --git a/nbformat/json_compat.py b/nbformat/json_compat.py index 3921931..ae2b26a 100644 --- a/nbformat/json_compat.py +++ b/nbformat/json_compat.py @@ -16,11 +16,11 @@ from jsonschema.exceptions import ErrorTree, ValidationError __all__ = [ - "ValidationError", - "JsonSchemaValidator", + "VALIDATORS", "FastJsonSchemaValidator", + "JsonSchemaValidator", + "ValidationError", "get_current_validator", - "VALIDATORS", ] diff --git a/nbformat/v3/__init__.py b/nbformat/v3/__init__.py index 0f0c96a..0f2f830 100644 --- a/nbformat/v3/__init__.py +++ b/nbformat/v3/__init__.py @@ -6,30 +6,30 @@ __all__ = [ "NotebookNode", + "downgrade", + "nbformat", + "nbformat_minor", + "nbformat_schema", + "new_author", "new_code_cell", - "new_text_cell", + "new_heading_cell", + "new_metadata", "new_notebook", "new_output", + "new_text_cell", "new_worksheet", - "new_metadata", - "new_author", - "new_heading_cell", - "nbformat", - "nbformat_minor", - "nbformat_schema", - "reads_json", - "writes_json", + "parse_filename", "read_json", - "write_json", - "to_notebook_json", - "reads_py", - "writes_py", "read_py", - "write_py", + "reads_json", + "reads_py", + "to_notebook_json", "to_notebook_py", - "downgrade", "upgrade", - "parse_filename", + "write_json", + "write_py", + "writes_json", + "writes_py", ] import os diff --git a/nbformat/v4/__init__.py b/nbformat/v4/__init__.py index 0653ff4..479976a 100644 --- a/nbformat/v4/__init__.py +++ b/nbformat/v4/__init__.py @@ -5,20 +5,20 @@ from __future__ import annotations __all__ = [ + "downgrade", "nbformat", "nbformat_minor", "nbformat_schema", "new_code_cell", "new_markdown_cell", - "new_raw_cell", "new_notebook", "new_output", + "new_raw_cell", "output_from_msg", "reads", - "writes", "to_notebook", - "downgrade", "upgrade", + "writes", ] from .convert import downgrade, upgrade diff --git a/nbformat/validator.py b/nbformat/validator.py index 3344dbe..c1d61e2 100644 --- a/nbformat/validator.py +++ b/nbformat/validator.py @@ -23,14 +23,14 @@ __all__ = [ + "NotebookValidationError", "ValidationError", + "better_validation_error", "get_validator", "isvalid", - "NotebookValidationError", - "better_validation_error", + "iter_validate", "normalize", "validate", - "iter_validate", ]