From 24390bae27e730b8d6ea9e61a1646c259bf9710b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 00:06:14 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit suggestions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0) - [github.com/codespell-project/codespell: v2.2.6 → v2.3.0](https://github.com/codespell-project/codespell/compare/v2.2.6...v2.3.0) - [github.com/psf/black: 23.12.1 → 24.4.2](https://github.com/psf/black/compare/23.12.1...24.4.2) - [github.com/astral-sh/ruff-pre-commit: v0.1.9 → v0.5.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.9...v0.5.0) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 541b1697..6ef6c2f8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace @@ -25,14 +25,14 @@ repos: # args: [--in-place, --wrap-summaries=120, --wrap-descriptions=120] - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell additional_dependencies: [tomli] #args: ["--write-changes"] # uncomment if you want to get automatic fixing - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.4.2 hooks: - id: black name: Black code @@ -46,7 +46,7 @@ repos: - mdformat_frontmatter - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.9 + rev: v0.5.0 hooks: - id: ruff args: ["--fix"] From 250a24e2b4837841ffbe89871de81982aecf5842 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 00:06:23 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- papermill/abs.py | 1 + papermill/adl.py | 1 + papermill/engines.py | 5 ++--- papermill/inspection.py | 1 + papermill/log.py | 1 + papermill/models.py | 1 + 6 files changed, 7 insertions(+), 3 deletions(-) diff --git a/papermill/abs.py b/papermill/abs.py index 665d7f69..0f9d0d15 100644 --- a/papermill/abs.py +++ b/papermill/abs.py @@ -1,4 +1,5 @@ """Utilities for working with Azure blob storage""" + import io import re diff --git a/papermill/adl.py b/papermill/adl.py index 7dd48962..3df13330 100644 --- a/papermill/adl.py +++ b/papermill/adl.py @@ -1,4 +1,5 @@ """Utilities for working with Azure data lake storage""" + import re from azure.datalake.store import core, lib diff --git a/papermill/engines.py b/papermill/engines.py index 4d096ba5..3b7be2d9 100644 --- a/papermill/engines.py +++ b/papermill/engines.py @@ -1,4 +1,5 @@ """Engines to perform different roles""" + import datetime import sys from functools import wraps @@ -169,9 +170,7 @@ def autosave_cell(self): # Autosave is taking too long, so exponentially back off. self.autosave_cell_every *= 2 logger.warning( - "Autosave too slow: {:.2f} sec, over {}% limit. Backing off to {} sec".format( - save_elapsed, self.max_autosave_pct, self.autosave_cell_every - ) + f"Autosave too slow: {save_elapsed:.2f} sec, over {self.max_autosave_pct}% limit. Backing off to {self.autosave_cell_every} sec" ) @catch_nb_assignment diff --git a/papermill/inspection.py b/papermill/inspection.py index 40f6b6c8..d9e8d0b7 100644 --- a/papermill/inspection.py +++ b/papermill/inspection.py @@ -1,4 +1,5 @@ """Deduce parameters of a notebook from the parameters cell.""" + from pathlib import Path import click diff --git a/papermill/log.py b/papermill/log.py index b90225d2..79c7f0d9 100644 --- a/papermill/log.py +++ b/papermill/log.py @@ -1,4 +1,5 @@ """Sets up a logger""" + import logging logger = logging.getLogger('papermill') diff --git a/papermill/models.py b/papermill/models.py index 35c077e5..23bd31dd 100644 --- a/papermill/models.py +++ b/papermill/models.py @@ -1,4 +1,5 @@ """Models used by papermill.""" + from collections import namedtuple Parameter = namedtuple(