From 40635c0904a15d5ccafc72a9034b562e9a68b8f8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:39:09 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- jupyter_cache/base.py | 1 + jupyter_cache/cli/commands/cmd_main.py | 1 + jupyter_cache/entry_points.py | 1 + jupyter_cache/executors/utils.py | 14 ++++++++------ jupyter_cache/readers.py | 1 + 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/jupyter_cache/base.py b/jupyter_cache/base.py index a033fbf..2df9d74 100644 --- a/jupyter_cache/base.py +++ b/jupyter_cache/base.py @@ -3,6 +3,7 @@ API access to the cache should use this interface, with no assumptions about the backend storage/retrieval mechanisms. """ + from abc import ABC, abstractmethod import io from pathlib import Path diff --git a/jupyter_cache/cli/commands/cmd_main.py b/jupyter_cache/cli/commands/cmd_main.py index 1581902..59020e2 100644 --- a/jupyter_cache/cli/commands/cmd_main.py +++ b/jupyter_cache/cli/commands/cmd_main.py @@ -1,4 +1,5 @@ """The main `jcache` click group.""" + import click from jupyter_cache.cli import options diff --git a/jupyter_cache/entry_points.py b/jupyter_cache/entry_points.py index 846768d..22ccd3f 100644 --- a/jupyter_cache/entry_points.py +++ b/jupyter_cache/entry_points.py @@ -1,4 +1,5 @@ """Module for dealing with entry points.""" + from typing import Optional, Set # TODO importlib.metadata was introduced into the standard library in python 3.8 diff --git a/jupyter_cache/executors/utils.py b/jupyter_cache/executors/utils.py index 33f4df8..0a9f492 100644 --- a/jupyter_cache/executors/utils.py +++ b/jupyter_cache/executors/utils.py @@ -94,12 +94,14 @@ def create_cache_bundle( project_nb.nb, project_nb.uri, # TODO retrieve assets that have changed file mtime? - artifacts=NbArtifacts( - [p for p in Path(execdir).glob("**/*") if p not in asset_files], - execdir, - ) - if (execdir is not None and asset_files is not None) - else None, + artifacts=( + NbArtifacts( + [p for p in Path(execdir).glob("**/*") if p not in asset_files], + execdir, + ) + if (execdir is not None and asset_files is not None) + else None + ), data={"execution_seconds": exec_time}, traceback=exec_tb, ) diff --git a/jupyter_cache/readers.py b/jupyter_cache/readers.py index 669198f..a246f68 100644 --- a/jupyter_cache/readers.py +++ b/jupyter_cache/readers.py @@ -1,4 +1,5 @@ """Module for handling different functions to read "notebook-like" files.""" + from typing import Any, Callable, Dict, Set import nbformat as nbf