diff --git a/nbformat/_struct.py b/nbformat/_struct.py index 23aa45f..dfb106f 100644 --- a/nbformat/_struct.py +++ b/nbformat/_struct.py @@ -2,6 +2,7 @@ Can probably be replaced by types.SimpleNamespace from Python 3.3 """ + from __future__ import annotations from typing import Any, Dict diff --git a/nbformat/_version.py b/nbformat/_version.py index 447bf88..a0b02e4 100644 --- a/nbformat/_version.py +++ b/nbformat/_version.py @@ -1,4 +1,5 @@ """The version information for nbformat.""" + # Use "hatchling version xx.yy.zz" to handle version changes from __future__ import annotations diff --git a/nbformat/corpus/words.py b/nbformat/corpus/words.py index 24d7889..043bbbe 100644 --- a/nbformat/corpus/words.py +++ b/nbformat/corpus/words.py @@ -1,4 +1,5 @@ """Generate a corpus id.""" + from __future__ import annotations import uuid diff --git a/nbformat/json_compat.py b/nbformat/json_compat.py index 8385609..3921931 100644 --- a/nbformat/json_compat.py +++ b/nbformat/json_compat.py @@ -2,6 +2,7 @@ Common validator wrapper to provide a uniform usage of other schema validation libraries. """ + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import annotations diff --git a/nbformat/notebooknode.py b/nbformat/notebooknode.py index 8b3d11a..02f1532 100644 --- a/nbformat/notebooknode.py +++ b/nbformat/notebooknode.py @@ -1,4 +1,5 @@ """NotebookNode - adding attribute access to dicts""" + from __future__ import annotations from collections.abc import Mapping diff --git a/nbformat/v2/nbxml.py b/nbformat/v2/nbxml.py index 44e00c6..540cbe1 100644 --- a/nbformat/v2/nbxml.py +++ b/nbformat/v2/nbxml.py @@ -1,5 +1,5 @@ -"""REMOVED: Read and write notebook files as XML. -""" +"""REMOVED: Read and write notebook files as XML.""" + from __future__ import annotations REMOVED_MSG = """\ diff --git a/nbformat/v3/__init__.py b/nbformat/v3/__init__.py index a87f9bd..0f0c96a 100644 --- a/nbformat/v3/__init__.py +++ b/nbformat/v3/__init__.py @@ -1,5 +1,4 @@ -"""The main API for the v3 notebook format. -""" +"""The main API for the v3 notebook format.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/nbformat/validator.py b/nbformat/validator.py index 30ea71a..3344dbe 100644 --- a/nbformat/validator.py +++ b/nbformat/validator.py @@ -1,4 +1,5 @@ """Notebook format validators.""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import annotations diff --git a/nbformat/warnings.py b/nbformat/warnings.py index 4c8d5bf..0b5db21 100644 --- a/nbformat/warnings.py +++ b/nbformat/warnings.py @@ -1,6 +1,7 @@ """ Warnings that can be emitted by nbformat. """ + from __future__ import annotations diff --git a/package.json b/package.json index c11411a..e81603b 100644 --- a/package.json +++ b/package.json @@ -1,25 +1,25 @@ { - "name": "nbformat-schema", - "version": "5.10.3", - "description": "JSON schemata for Jupyter notebook formats", - "main": "index.js", - "files": [ - "nbformat/v3/nbformat.v3.schema.json", - "nbformat/v4/nbformat.v4.schema.json" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/jupyter/nbformat.git" - }, - "keywords": [ - "jupyter", - "notebook", - "json-schema" - ], - "author": "Project Jupyter Contributors", - "license": "BSD-3-Clause", - "bugs": { - "url": "https://github.com/jupyter/nbformat/issues" - }, - "homepage": "https://nbformat.readthedocs.io" + "name": "nbformat-schema", + "version": "5.10.3", + "description": "JSON schemata for Jupyter notebook formats", + "main": "index.js", + "files": [ + "nbformat/v3/nbformat.v3.schema.json", + "nbformat/v4/nbformat.v4.schema.json" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/jupyter/nbformat.git" + }, + "keywords": [ + "jupyter", + "notebook", + "json-schema" + ], + "author": "Project Jupyter Contributors", + "license": "BSD-3-Clause", + "bugs": { + "url": "https://github.com/jupyter/nbformat/issues" + }, + "homepage": "https://nbformat.readthedocs.io" } diff --git a/tests/v4/test_json.py b/tests/v4/test_json.py index a16586a..76d89aa 100644 --- a/tests/v4/test_json.py +++ b/tests/v4/test_json.py @@ -130,6 +130,6 @@ def test_latest_matches_nbformat(self): os.path.join(BASE_PATH, "nbformat.v4.schema.json"), encoding="utf-8" ) as schema_file: schema = json.load(schema_file) - assert schema["description"] == "Jupyter Notebook v{major}.{minor} JSON schema.".format( - major=nbformat, minor=nbformat_minor + assert ( + schema["description"] == f"Jupyter Notebook v{nbformat}.{nbformat_minor} JSON schema." ) diff --git a/tests/v4/test_nbbase.py b/tests/v4/test_nbbase.py index be9d9d1..df21df8 100644 --- a/tests/v4/test_nbbase.py +++ b/tests/v4/test_nbbase.py @@ -1,4 +1,5 @@ """Tests for the Python API for composing notebook elements""" + from __future__ import annotations from nbformat.v4.nbbase import (