diff options
| author | robot-piglet <[email protected]> | 2025-09-10 08:30:07 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2025-09-10 08:42:21 +0300 |
| commit | a4ea9cdc4305504b097dfa8d5d61cda5276cc0c2 (patch) | |
| tree | fb4e30fbb9674fcd49e4b838f09bfe9f68a803f1 /contrib/python/platformdirs | |
| parent | 2e6746c3534a1580f67e056c3ac9b342975c186d (diff) | |
Intermediate changes
commit_hash:b85570988e60ab423b76d1915a6b852a75211494
Diffstat (limited to 'contrib/python/platformdirs')
| -rw-r--r-- | contrib/python/platformdirs/.dist-info/METADATA | 2 | ||||
| -rw-r--r-- | contrib/python/platformdirs/platformdirs/api.py | 2 | ||||
| -rw-r--r-- | contrib/python/platformdirs/platformdirs/macos.py | 18 | ||||
| -rw-r--r-- | contrib/python/platformdirs/platformdirs/version.py | 19 | ||||
| -rw-r--r-- | contrib/python/platformdirs/ya.make | 2 |
5 files changed, 29 insertions, 14 deletions
diff --git a/contrib/python/platformdirs/.dist-info/METADATA b/contrib/python/platformdirs/.dist-info/METADATA index d8668fed1ea..6b0908fb707 100644 --- a/contrib/python/platformdirs/.dist-info/METADATA +++ b/contrib/python/platformdirs/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: platformdirs -Version: 4.3.8 +Version: 4.4.0 Summary: A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`. Project-URL: Changelog, https://github.com/tox-dev/platformdirs/releases Project-URL: Documentation, https://platformdirs.readthedocs.io diff --git a/contrib/python/platformdirs/platformdirs/api.py b/contrib/python/platformdirs/platformdirs/api.py index a352035ec69..251600e6d1b 100644 --- a/contrib/python/platformdirs/platformdirs/api.py +++ b/contrib/python/platformdirs/platformdirs/api.py @@ -95,7 +95,7 @@ class PlatformDirsABC(ABC): # noqa: PLR0904 def _first_item_as_path_if_multipath(self, directory: str) -> Path: if self.multipath: # If multipath is True, the first path is returned. - directory = directory.split(os.pathsep)[0] + directory = directory.partition(os.pathsep)[0] return Path(directory) @property diff --git a/contrib/python/platformdirs/platformdirs/macos.py b/contrib/python/platformdirs/platformdirs/macos.py index e4b0391abd7..30ab3689130 100644 --- a/contrib/python/platformdirs/platformdirs/macos.py +++ b/contrib/python/platformdirs/platformdirs/macos.py @@ -34,13 +34,14 @@ class MacOS(PlatformDirsABC): """ :return: data directory shared by users, e.g. ``/Library/Application Support/$appname/$version``. If we're using a Python binary managed by `Homebrew <https://brew.sh>`_, the directory - will be under the Homebrew prefix, e.g. ``/opt/homebrew/share/$appname/$version``. + will be under the Homebrew prefix, e.g. ``$homebrew_prefix/share/$appname/$version``. If `multipath <platformdirs.api.PlatformDirsABC.multipath>` is enabled, and we're in Homebrew, the response is a multi-path string separated by ":", e.g. - ``/opt/homebrew/share/$appname/$version:/Library/Application Support/$appname/$version`` + ``$homebrew_prefix/share/$appname/$version:/Library/Application Support/$appname/$version`` """ - is_homebrew = sys.prefix.startswith("/opt/homebrew") - path_list = [self._append_app_name_and_version("/opt/homebrew/share")] if is_homebrew else [] + is_homebrew = "/opt/python" in sys.prefix + homebrew_prefix = sys.prefix.split("/opt/python")[0] if is_homebrew else "" + path_list = [self._append_app_name_and_version(f"{homebrew_prefix}/share")] if is_homebrew else [] path_list.append(self._append_app_name_and_version("/Library/Application Support")) if self.multipath: return os.pathsep.join(path_list) @@ -71,13 +72,14 @@ class MacOS(PlatformDirsABC): """ :return: cache directory shared by users, e.g. ``/Library/Caches/$appname/$version``. If we're using a Python binary managed by `Homebrew <https://brew.sh>`_, the directory - will be under the Homebrew prefix, e.g. ``/opt/homebrew/var/cache/$appname/$version``. + will be under the Homebrew prefix, e.g. ``$homebrew_prefix/var/cache/$appname/$version``. If `multipath <platformdirs.api.PlatformDirsABC.multipath>` is enabled, and we're in Homebrew, the response is a multi-path string separated by ":", e.g. - ``/opt/homebrew/var/cache/$appname/$version:/Library/Caches/$appname/$version`` + ``$homebrew_prefix/var/cache/$appname/$version:/Library/Caches/$appname/$version`` """ - is_homebrew = sys.prefix.startswith("/opt/homebrew") - path_list = [self._append_app_name_and_version("/opt/homebrew/var/cache")] if is_homebrew else [] + is_homebrew = "/opt/python" in sys.prefix + homebrew_prefix = sys.prefix.split("/opt/python")[0] if is_homebrew else "" + path_list = [self._append_app_name_and_version(f"{homebrew_prefix}/var/cache")] if is_homebrew else [] path_list.append(self._append_app_name_and_version("/Library/Caches")) if self.multipath: return os.pathsep.join(path_list) diff --git a/contrib/python/platformdirs/platformdirs/version.py b/contrib/python/platformdirs/platformdirs/version.py index 611ac615443..b9451472c3c 100644 --- a/contrib/python/platformdirs/platformdirs/version.py +++ b/contrib/python/platformdirs/platformdirs/version.py @@ -1,7 +1,14 @@ # file generated by setuptools-scm # don't change, don't track in version control -__all__ = ["__version__", "__version_tuple__", "version", "version_tuple"] +__all__ = [ + "__version__", + "__version_tuple__", + "version", + "version_tuple", + "__commit_id__", + "commit_id", +] TYPE_CHECKING = False if TYPE_CHECKING: @@ -9,13 +16,19 @@ if TYPE_CHECKING: from typing import Union VERSION_TUPLE = Tuple[Union[int, str], ...] + COMMIT_ID = Union[str, None] else: VERSION_TUPLE = object + COMMIT_ID = object version: str __version__: str __version_tuple__: VERSION_TUPLE version_tuple: VERSION_TUPLE +commit_id: COMMIT_ID +__commit_id__: COMMIT_ID -__version__ = version = '4.3.8' -__version_tuple__ = version_tuple = (4, 3, 8) +__version__ = version = '4.4.0' +__version_tuple__ = version_tuple = (4, 4, 0) + +__commit_id__ = commit_id = None diff --git a/contrib/python/platformdirs/ya.make b/contrib/python/platformdirs/ya.make index 1a33df4191e..6e7c533983d 100644 --- a/contrib/python/platformdirs/ya.make +++ b/contrib/python/platformdirs/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(4.3.8) +VERSION(4.4.0) LICENSE(MIT) |
