Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*_config_dir -> "*/Library/Application Support" (macOS), fixes #98 #132

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
platformdirs Changelog
======================

platformdirs 3.0.0 (2023-02-05)
-------------------------------
- **BREAKING** Correct the config directory on OSX/macOS, again: "*/Library/Application Support" (#98)

platformdirs 2.6.2 (2022-12-28)
-------------------------------
- Fix missing ``typing-extensions`` dependency.
Expand Down
8 changes: 4 additions & 4 deletions src/platformdirs/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ def site_data_dir(self) -> str:

@property
def user_config_dir(self) -> str:
""":return: config directory tied to the user, e.g. ``~/Library/Preferences/$appname/$version``"""
return self._append_app_name_and_version(os.path.expanduser("~/Library/Preferences/"))
""":return: config directory tied to the user, e.g. ``~/Library/Application Support/$appname/$version``"""
return self._append_app_name_and_version(os.path.expanduser("~/Library/Application Support/"))

@property
def site_config_dir(self) -> str:
""":return: config directory shared by the users, e.g. ``/Library/Preferences/$appname``"""
return self._append_app_name_and_version("/Library/Preferences")
""":return: config directory shared by the users, e.g. ``/Library/Application Support/$appname/$version``"""
return self._append_app_name_and_version("/Library/Application Support")

@property
def user_cache_dir(self) -> str:
Expand Down
2 changes: 0 additions & 2 deletions tests/test_comp_with_appdirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ def test_compatibility(params: dict[str, Any], func: str) -> None:
if sys.platform == "darwin":
msg = { # pragma: no cover
"user_log_dir": "without appname produces NoneType error",
"site_config_dir": "ignores the version argument",
"user_config_dir": "uses Library/Preferences instead Application Support",
}
if func in msg: # pragma: no cover
pytest.skip(f"`appdirs.{func}` {msg[func]} on macOS") # pragma: no cover
Expand Down