From de3b6c9573f075d2bdb93ea0af852c8b31ca03b3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 29 Dec 2023 11:38:41 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- rules/common.smk | 2 ++ scripts/_helpers.py | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/rules/common.smk b/rules/common.smk index a1537c10..2c8cf69c 100644 --- a/rules/common.smk +++ b/rules/common.smk @@ -3,9 +3,11 @@ # SPDX-License-Identifier: MIT import os, sys + sys.path.insert(0, os.path.abspath("scripts")) from _helpers import validate_checksum + def memory(w): factor = 3.0 for o in w.opts.split("-"): diff --git a/scripts/_helpers.py b/scripts/_helpers.py index d906872d..9945f70f 100644 --- a/scripts/_helpers.py +++ b/scripts/_helpers.py @@ -340,8 +340,8 @@ def get_checksum_from_zenodo(file_url): def validate_checksum(file_path, zenodo_url=None, checksum=None): """ Validate file checksum against provided or Zenodo-retrieved checksum. - Calculates the hash of a file using 64KB chunks. Compares it against a given - checksum or one from a Zenodo URL. + Calculates the hash of a file using 64KB chunks. Compares it against a + given checksum or one from a Zenodo URL. Parameters ---------- @@ -360,8 +360,11 @@ def validate_checksum(file_path, zenodo_url=None, checksum=None): Examples -------- - >>> validate_checksum('/path/to/file', checksum='md5:abc123...') - >>> validate_checksum('/path/to/file', zenodo_url='https://zenodo.org/record/12345/files/example.txt') + >>> validate_checksum("/path/to/file", checksum="md5:abc123...") + >>> validate_checksum( + ... "/path/to/file", + ... zenodo_url="https://zenodo.org/record/12345/files/example.txt", + ... ) If the checksum is invalid, an AssertionError will be raised. """