Skip to content

Commit

Permalink
moved persistent hash cache within "hash_cache" subdirectory of the p…
Browse files Browse the repository at this point in the history
…ydra user cache dir
  • Loading branch information
tclose committed Mar 17, 2024
1 parent 1f601e1 commit 7e60c41
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
11 changes: 11 additions & 0 deletions pydra/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pathlib import Path
import platformdirs
from pydra import __version__

user_cache_dir = Path(
platformdirs.user_cache_dir(
appname="pydra",
appauthor="nipype",
version=__version__,
)
)
9 changes: 2 additions & 7 deletions pydra/utils/hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
Set,
)
from filelock import SoftFileLock
import platformdirs
import attrs.exceptions
from fileformats.core import FileSet
from pydra._version import __version__
from . import user_cache_dir

logger = logging.getLogger("pydra")

Expand Down Expand Up @@ -99,11 +98,7 @@ def location_default(cls):
try:
location = os.environ[cls.LOCATION_ENV_VAR]
except KeyError:
location = platformdirs.user_cache_dir(
appname="pydra",
appauthor="nipype",
version=__version__,
)
location = user_cache_dir / "hash_cache"
return location

# the default needs to be an instance method
Expand Down

0 comments on commit 7e60c41

Please sign in to comment.