platformdirs 4.14.2__tar.gz → 4.14.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {platformdirs-4.14.2 → platformdirs-4.14.4}/PKG-INFO +3 -1
- {platformdirs-4.14.2 → platformdirs-4.14.4}/pyproject.toml +6 -6
- {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/_xdg.py +2 -4
- {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/version.py +2 -2
- {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_unix.py +70 -15
- {platformdirs-4.14.2 → platformdirs-4.14.4}/.gitignore +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/LICENSE +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/__init__.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/__main__.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/android.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/api.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/ios.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/macos.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/py.typed +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/pytest_plugin.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/testing.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/unix.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/windows.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/conftest.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_android.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_api.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_comp_with_appdirs.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_ios.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_macos.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_main.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_pytest_plugin.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_testing.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_windows.py +0 -0
- {platformdirs-4.14.2 → platformdirs-4.14.4}/tox.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: platformdirs
|
|
3
|
-
Version: 4.14.
|
|
3
|
+
Version: 4.14.4
|
|
4
4
|
Import-Name: platformdirs
|
|
5
5
|
Summary: A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`.
|
|
6
6
|
Project-URL: Changelog, https://platformdirs.readthedocs.io/en/latest/changelog.html
|
|
@@ -34,6 +34,8 @@ Description-Content-Type: text/markdown
|
|
|
34
34
|
[](https://pypi.python.org/pypi/platformdirs/)
|
|
35
35
|
[](https://github.com/platformdirs/platformdirs/actions)
|
|
36
36
|
[](https://pepy.tech/project/platformdirs)
|
|
37
|
+
[](https://scorecard.dev/viewer/?uri=github.com/tox-dev/platformdirs)
|
|
38
|
+
[](https://www.bestpractices.dev/projects/16249)
|
|
37
39
|
|
|
38
40
|
A Python package for determining platform-specific directories (e.g. user data, config, cache, logs). Handles the
|
|
39
41
|
differences between macOS, Windows, Linux/Unix, Android, and iOS so you don't have to.
|
|
@@ -111,19 +111,19 @@ pkg-meta = [
|
|
|
111
111
|
"uv>=0.10.7",
|
|
112
112
|
]
|
|
113
113
|
release = [
|
|
114
|
-
"release-creator>=4.
|
|
114
|
+
"release-creator>=4.4",
|
|
115
115
|
"towncrier>=26.9",
|
|
116
116
|
]
|
|
117
117
|
release-news = [
|
|
118
|
-
"release-creator>=4.
|
|
118
|
+
"release-creator>=4.4",
|
|
119
119
|
"towncrier>=26.9",
|
|
120
120
|
]
|
|
121
121
|
release-notes = [
|
|
122
|
-
"release-creator>=4.
|
|
122
|
+
"release-creator>=4.4",
|
|
123
123
|
]
|
|
124
124
|
release-prepare = [
|
|
125
125
|
"prek>=0.5",
|
|
126
|
-
"release-creator>=4.
|
|
126
|
+
"release-creator>=4.4",
|
|
127
127
|
"towncrier>=26.9",
|
|
128
128
|
]
|
|
129
129
|
|
|
@@ -246,5 +246,5 @@ uploaded-prior-to = "P7D"
|
|
|
246
246
|
decision-order = "stable"
|
|
247
247
|
matrix.python = ">=3.15,<3.16"
|
|
248
248
|
matrix.platforms = [ "linux_x86_64" ]
|
|
249
|
-
#
|
|
250
|
-
packages.release-creator.uploaded-prior-to = 2026-
|
|
249
|
+
# release-creator 4.4.0 needs a seven-day cutoff exception through 2026-11-09.
|
|
250
|
+
packages.release-creator.uploaded-prior-to = 2026-11-02T21:45:00Z
|
|
@@ -165,14 +165,12 @@ class XDGMixin(PlatformDirsABC):
|
|
|
165
165
|
|
|
166
166
|
|
|
167
167
|
def _xdg_dir(env_var: str) -> str | None:
|
|
168
|
-
path: Final = os.environ.get(env_var, "")
|
|
168
|
+
path: Final = os.environ.get(env_var, "")
|
|
169
169
|
return path if posixpath.isabs(path) else None
|
|
170
170
|
|
|
171
171
|
|
|
172
172
|
def _xdg_dir_list(env_var: str) -> list[str]:
|
|
173
|
-
return [
|
|
174
|
-
stripped for path in os.environ.get(env_var, "").split(os.pathsep) if posixpath.isabs(stripped := path.strip())
|
|
175
|
-
]
|
|
173
|
+
return [path for path in os.environ.get(env_var, "").split(os.pathsep) if posixpath.isabs(path)]
|
|
176
174
|
|
|
177
175
|
|
|
178
176
|
def _expand_user(path: str) -> str:
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '4.14.
|
|
22
|
-
__version_tuple__ = version_tuple = (4, 14,
|
|
21
|
+
__version__ = version = '4.14.4'
|
|
22
|
+
__version_tuple__ = version_tuple = (4, 14, 4)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -280,15 +280,50 @@ def test_xdg_variable_custom_value(monkeypatch: pytest.MonkeyPatch, dirs_instanc
|
|
|
280
280
|
assert result == "/custom-dir"
|
|
281
281
|
|
|
282
282
|
|
|
283
|
-
@pytest.mark.
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
283
|
+
@pytest.mark.parametrize("dirs_class", [pytest.param(Unix, id="unix"), pytest.param(MacOS, id="macos")])
|
|
284
|
+
@pytest.mark.parametrize(
|
|
285
|
+
"kind",
|
|
286
|
+
[
|
|
287
|
+
pytest.param("data", id="data"),
|
|
288
|
+
pytest.param("config", id="config"),
|
|
289
|
+
pytest.param("cache", id="cache"),
|
|
290
|
+
pytest.param("state", id="state"),
|
|
291
|
+
],
|
|
292
|
+
)
|
|
293
|
+
@pytest.mark.parametrize("whitespace", [pytest.param(" ", id="space"), pytest.param("\t", id="tab")])
|
|
294
|
+
def test_xdg_home_preserves_trailing_whitespace(
|
|
295
|
+
monkeypatch: pytest.MonkeyPatch, dirs_class: type[Unix | MacOS], kind: str, whitespace: str
|
|
296
|
+
) -> None:
|
|
297
|
+
home: typing.Final = f"/xdg-fixture/home{whitespace}"
|
|
298
|
+
monkeypatch.setenv(f"XDG_{kind.upper()}_HOME", home)
|
|
299
|
+
assert getattr(dirs_class(appname="demo"), f"user_{kind}_dir") == f"{home}{os.sep}demo"
|
|
288
300
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
301
|
+
|
|
302
|
+
@pytest.mark.usefixtures("_clear_xdg_env")
|
|
303
|
+
@pytest.mark.parametrize("dirs_class", [pytest.param(Unix, id="unix"), pytest.param(MacOS, id="macos")])
|
|
304
|
+
@pytest.mark.parametrize(
|
|
305
|
+
"kind",
|
|
306
|
+
[
|
|
307
|
+
pytest.param("data", id="data"),
|
|
308
|
+
pytest.param("config", id="config"),
|
|
309
|
+
pytest.param("cache", id="cache"),
|
|
310
|
+
pytest.param("state", id="state"),
|
|
311
|
+
],
|
|
312
|
+
)
|
|
313
|
+
def test_xdg_home_rejects_leading_whitespace(
|
|
314
|
+
monkeypatch: pytest.MonkeyPatch, dirs_class: type[Unix | MacOS], kind: str
|
|
315
|
+
) -> None:
|
|
316
|
+
expected: typing.Final = getattr(dirs_class(appname="demo"), f"user_{kind}_dir")
|
|
317
|
+
monkeypatch.setenv(f"XDG_{kind.upper()}_HOME", " /xdg-fixture/home")
|
|
318
|
+
assert getattr(dirs_class(appname="demo"), f"user_{kind}_dir") == expected
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
@pytest.mark.parametrize("dirs_class", [pytest.param(Unix, id="unix"), pytest.param(MacOS, id="macos")])
|
|
322
|
+
def test_xdg_media_preserves_trailing_whitespace(
|
|
323
|
+
monkeypatch: pytest.MonkeyPatch, dirs_class: type[Unix | MacOS]
|
|
324
|
+
) -> None:
|
|
325
|
+
monkeypatch.setenv("XDG_DOCUMENTS_DIR", "/xdg-fixture/documents ")
|
|
326
|
+
assert dirs_class().user_documents_dir == "/xdg-fixture/documents "
|
|
292
327
|
|
|
293
328
|
|
|
294
329
|
@pytest.mark.usefixtures("_geteuid")
|
|
@@ -1319,18 +1354,38 @@ def test_site_dirs_fall_back_when_xdg_var_has_no_absolute_paths(
|
|
|
1319
1354
|
|
|
1320
1355
|
|
|
1321
1356
|
@pytest.mark.parametrize("dirs_class", [pytest.param(Unix, id="unix"), pytest.param(MacOS, id="macos")])
|
|
1322
|
-
@pytest.mark.parametrize(
|
|
1323
|
-
|
|
1357
|
+
@pytest.mark.parametrize(
|
|
1358
|
+
("prop", "suffix"),
|
|
1359
|
+
[
|
|
1360
|
+
pytest.param("site_data_dir", "foo", id="data"),
|
|
1361
|
+
pytest.param("site_config_dir", "foo", id="config"),
|
|
1362
|
+
pytest.param("site_applications_dir", "applications", id="applications"),
|
|
1363
|
+
],
|
|
1364
|
+
)
|
|
1324
1365
|
def test_site_dirs_filter_relative_entries(
|
|
1325
|
-
monkeypatch: pytest.MonkeyPatch, dirs_class: type[Unix | MacOS], prop: str,
|
|
1366
|
+
monkeypatch: pytest.MonkeyPatch, dirs_class: type[Unix | MacOS], prop: str, suffix: str
|
|
1326
1367
|
) -> None:
|
|
1327
1368
|
value: typing.Final = os.pathsep.join(("relative", "/custom/first", "", "~/relative", " /custom/second "))
|
|
1328
1369
|
monkeypatch.setenv("XDG_DATA_DIRS", value)
|
|
1329
1370
|
monkeypatch.setenv("XDG_CONFIG_DIRS", value)
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1371
|
+
assert getattr(dirs_class(appname="foo", multipath=True), prop) == f"/custom/first{os.sep}{suffix}"
|
|
1372
|
+
|
|
1373
|
+
|
|
1374
|
+
@pytest.mark.parametrize("dirs_class", [pytest.param(Unix, id="unix"), pytest.param(MacOS, id="macos")])
|
|
1375
|
+
@pytest.mark.parametrize(
|
|
1376
|
+
"kind",
|
|
1377
|
+
[
|
|
1378
|
+
pytest.param("data", id="data"),
|
|
1379
|
+
pytest.param("config", id="config"),
|
|
1380
|
+
],
|
|
1381
|
+
)
|
|
1382
|
+
@pytest.mark.parametrize("whitespace", [pytest.param(" ", id="space"), pytest.param("\t", id="tab")])
|
|
1383
|
+
def test_xdg_site_preserves_trailing_whitespace(
|
|
1384
|
+
monkeypatch: pytest.MonkeyPatch, dirs_class: type[Unix | MacOS], kind: str, whitespace: str
|
|
1385
|
+
) -> None:
|
|
1386
|
+
monkeypatch.setenv(f"XDG_{kind.upper()}_DIRS", f"/xdg-fixture/first{whitespace}{os.pathsep}/xdg-fixture/second")
|
|
1387
|
+
assert getattr(dirs_class(appname="demo", multipath=True), f"site_{kind}_dir") == (
|
|
1388
|
+
f"/xdg-fixture/first{whitespace}{os.sep}demo{os.pathsep}/xdg-fixture/second{os.sep}demo"
|
|
1334
1389
|
)
|
|
1335
1390
|
|
|
1336
1391
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|