diff options
Diffstat (limited to 'src/pip/_vendor/platformdirs/unix.py')
-rw-r--r-- | src/pip/_vendor/platformdirs/unix.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/pip/_vendor/platformdirs/unix.py b/src/pip/_vendor/platformdirs/unix.py index 9aca5a030..17d355da9 100644 --- a/src/pip/_vendor/platformdirs/unix.py +++ b/src/pip/_vendor/platformdirs/unix.py @@ -24,7 +24,8 @@ class Unix(PlatformDirsABC): `appname <platformdirs.api.PlatformDirsABC.appname>`, `version <platformdirs.api.PlatformDirsABC.version>`, `multipath <platformdirs.api.PlatformDirsABC.multipath>`, - `opinion <platformdirs.api.PlatformDirsABC.opinion>`. + `opinion <platformdirs.api.PlatformDirsABC.opinion>`, + `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. """ @property @@ -94,6 +95,13 @@ class Unix(PlatformDirsABC): return self._append_app_name_and_version(path) @property + def site_cache_dir(self) -> str: + """ + :return: cache directory shared by users, e.g. ``/var/tmp/$appname/$version`` + """ + return self._append_app_name_and_version("/var/tmp") + + @property def user_state_dir(self) -> str: """ :return: state directory tied to the user, e.g. ``~/.local/state/$appname/$version`` or @@ -148,6 +156,11 @@ class Unix(PlatformDirsABC): """:return: config path shared by the users. Only return first item, even if ``multipath`` is set to ``True``""" return self._first_item_as_path_if_multipath(self.site_config_dir) + @property + def site_cache_path(self) -> Path: + """:return: cache path shared by users. Only return first item, even if ``multipath`` is set to ``True``""" + return self._first_item_as_path_if_multipath(self.site_cache_dir) + def _first_item_as_path_if_multipath(self, directory: str) -> Path: if self.multipath: # If multipath is True, the first path is returned. |