diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f714430c..1c1eb9ea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,9 +5,6 @@ concurrency: group: ${{ github.head_ref || github.run_id }} cancel-in-progress: true -env: - CONDA_EXE: mamba - on: push: branches: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 026a3f29..fd2fe700 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,18 +33,18 @@ repos: hooks: - id: sort-all - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.1 + rev: v0.3.2 hooks: - id: ruff-format - id: ruff args: [--unsafe-fixes] - repo: https://github.com/dosisod/refurb - rev: v1.28.0 + rev: v2.0.0 hooks: - id: refurb args: [--ignore, FURB126] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 + rev: v1.9.0 hooks: - id: mypy additional_dependencies: [ @@ -80,8 +80,6 @@ repos: - repo: https://github.com/nbQA-dev/nbQA rev: 1.8.4 hooks: - - id: nbqa-black - - id: nbqa-isort - id: nbqa-mypy args: [--ignore-missing-imports] - repo: https://github.com/kynan/nbstripout diff --git a/src/_pytask/_hashlib.py b/src/_pytask/_hashlib.py index a3c4edcf..ceab0134 100644 --- a/src/_pytask/_hashlib.py +++ b/src/_pytask/_hashlib.py @@ -232,5 +232,5 @@ def hash_value(value: Any) -> int | str: if isinstance(value, str): value = value.encode() if isinstance(value, bytes): - return str(hashlib.sha256(value).hexdigest()) + return hashlib.sha256(value).hexdigest() return hash(value) diff --git a/src/_pytask/data_catalog.py b/src/_pytask/data_catalog.py index ec0a6d67..f59c2040 100644 --- a/src/_pytask/data_catalog.py +++ b/src/_pytask/data_catalog.py @@ -99,7 +99,7 @@ def add(self, name: str, node: PNode | None = None) -> None: raise TypeError(msg) if node is None: - filename = str(hashlib.sha256(name.encode()).hexdigest()) + filename = hashlib.sha256(name.encode()).hexdigest() if isinstance(self.default_node, PPathNode): self.entries[name] = self.default_node( name=name, path=self.path / f"{filename}.pkl" diff --git a/tests/conftest.py b/tests/conftest.py index 673d0b04..b15c9aaa 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -55,7 +55,7 @@ class SysPathsSnapshot: """A snapshot for sys.path.""" def __init__(self) -> None: - self.__saved = list(sys.path), list(sys.meta_path) + self.__saved = sys.path.copy(), sys.meta_path.copy() def restore(self) -> None: sys.path[:], sys.meta_path[:] = self.__saved @@ -65,7 +65,7 @@ class SysModulesSnapshot: """A snapshot for sys.modules.""" def __init__(self) -> None: - self.__saved = dict(sys.modules) + self.__saved = sys.modules.copy() def restore(self) -> None: sys.modules.clear()