Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
CONDA_EXE: mamba

on:
push:
branches:
Expand Down
8 changes: 3 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/_pytask/_hashlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion src/_pytask/data_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down