Skip to content

Commit 7e60c41

Browse files
committed
moved persistent hash cache within "hash_cache" subdirectory of the pydra user cache dir
1 parent 1f601e1 commit 7e60c41

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

pydra/utils/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from pathlib import Path
2+
import platformdirs
3+
from pydra import __version__
4+
5+
user_cache_dir = Path(
6+
platformdirs.user_cache_dir(
7+
appname="pydra",
8+
appauthor="nipype",
9+
version=__version__,
10+
)
11+
)

pydra/utils/hash.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
Set,
1818
)
1919
from filelock import SoftFileLock
20-
import platformdirs
2120
import attrs.exceptions
2221
from fileformats.core import FileSet
23-
from pydra._version import __version__
22+
from . import user_cache_dir
2423

2524
logger = logging.getLogger("pydra")
2625

@@ -99,11 +98,7 @@ def location_default(cls):
9998
try:
10099
location = os.environ[cls.LOCATION_ENV_VAR]
101100
except KeyError:
102-
location = platformdirs.user_cache_dir(
103-
appname="pydra",
104-
appauthor="nipype",
105-
version=__version__,
106-
)
101+
location = user_cache_dir / "hash_cache"
107102
return location
108103

109104
# the default needs to be an instance method

0 commit comments

Comments
 (0)