Skip to content

Commit 15bc478

Browse files
fix(skore-local-project)!: Change default workspace location (#2086)
From "cache dir" to "data dir"
1 parent e144b36 commit 15bc478

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

skore-local-project/src/skore_local_project/project.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ class Project:
7979
| The workspace can be shared between all the projects.
8080
| The workspace can be set using kwargs or the environment variable
8181
``SKORE_WORKSPACE``.
82-
| If not, it will be by default set to a ``skore/`` directory in the USER
82+
| If not, it will be by default set to a ``skore/`` directory in the user
8383
cache directory:
8484
8585
- on Windows, usually ``C:\Users\%USER%\AppData\Local\skore``,
86-
- on Linux, usually ``${HOME}/.cache/skore``,
87-
- on macOS, usually ``${HOME}/Library/Caches/skore``.
86+
- on Linux, usually ``${HOME}/.local/share/skore``,
87+
- on macOS, usually ``${HOME}/Library/Application Support/skore``.
8888
"""
8989

9090
@staticmethod
@@ -100,7 +100,7 @@ def __setup_diskcache(
100100
if "SKORE_WORKSPACE" in os.environ:
101101
workspace = Path(os.environ["SKORE_WORKSPACE"])
102102
else:
103-
workspace = Path(platformdirs.user_cache_dir()) / "skore"
103+
workspace = Path(platformdirs.user_data_dir()) / "skore"
104104

105105
for directory in ("projects", "metadata", "artifacts"):
106106
(workspace / directory).mkdir(parents=True, exist_ok=True)

skore-local-project/tests/unit/test_project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def monkeypatch_metrics(monkeypatch, Datetime):
111111
class TestProject:
112112
def test_init(self, monkeypatch, tmp_path):
113113
monkeypatch.setattr(
114-
"skore_local_project.project.platformdirs.user_cache_dir",
114+
"skore_local_project.project.platformdirs.user_data_dir",
115115
lambda: str(tmp_path),
116116
)
117117

skore/src/skore/project/project.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ class Project:
4747
| The workspace can be shared between all the projects.
4848
| The workspace can be set using kwargs or the environment variable
4949
``SKORE_WORKSPACE``.
50-
| If not, it will be by default set to a ``skore/`` directory in the USER
50+
| If not, it will be by default set to a ``skore/`` directory in the user
5151
cache directory:
5252
5353
- on Windows, usually ``C:\Users\%USER%\AppData\Local\skore``,
54-
- on Linux, usually ``${HOME}/.cache/skore``,
55-
- on macOS, usually ``${HOME}/Library/Caches/skore``.
54+
- on Linux, usually ``${HOME}/.local/share/skore``,
55+
- on macOS, usually ``${HOME}/Library/Application Support/skore``.
5656
5757
Refer to the :ref:`project` section of the user guide for more details.
5858
@@ -71,16 +71,6 @@ class Project:
7171
workspace : Path, mode:local only.
7272
The directory where the local project is persisted.
7373
74-
| The workspace can be shared between all the projects.
75-
| The workspace can be set using kwargs or the environment variable
76-
``SKORE_WORKSPACE``.
77-
| If not, it will be by default set to a ``skore/`` directory in the USER
78-
cache directory:
79-
80-
- on Windows, usually ``C:\Users\%USER%\AppData\Local\skore``,
81-
- on Linux, usually ``${HOME}/.cache/skore``,
82-
- on macOS, usually ``${HOME}/Library/Caches/skore``.
83-
8474
Attributes
8575
----------
8676
name : str

0 commit comments

Comments
 (0)