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.
Files changed (29) hide show
  1. {platformdirs-4.14.2 → platformdirs-4.14.4}/PKG-INFO +3 -1
  2. {platformdirs-4.14.2 → platformdirs-4.14.4}/pyproject.toml +6 -6
  3. {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/_xdg.py +2 -4
  4. {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/version.py +2 -2
  5. {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_unix.py +70 -15
  6. {platformdirs-4.14.2 → platformdirs-4.14.4}/.gitignore +0 -0
  7. {platformdirs-4.14.2 → platformdirs-4.14.4}/LICENSE +0 -0
  8. {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/__init__.py +0 -0
  9. {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/__main__.py +0 -0
  10. {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/android.py +0 -0
  11. {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/api.py +0 -0
  12. {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/ios.py +0 -0
  13. {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/macos.py +0 -0
  14. {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/py.typed +0 -0
  15. {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/pytest_plugin.py +0 -0
  16. {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/testing.py +0 -0
  17. {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/unix.py +0 -0
  18. {platformdirs-4.14.2 → platformdirs-4.14.4}/src/platformdirs/windows.py +0 -0
  19. {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/conftest.py +0 -0
  20. {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_android.py +0 -0
  21. {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_api.py +0 -0
  22. {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_comp_with_appdirs.py +0 -0
  23. {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_ios.py +0 -0
  24. {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_macos.py +0 -0
  25. {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_main.py +0 -0
  26. {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_pytest_plugin.py +0 -0
  27. {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_testing.py +0 -0
  28. {platformdirs-4.14.2 → platformdirs-4.14.4}/tests/test_windows.py +0 -0
  29. {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.2
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
  [![Python versions](https://img.shields.io/pypi/pyversions/platformdirs.svg)](https://pypi.python.org/pypi/platformdirs/)
35
35
  [![CI](https://github.com/tox-dev/platformdirs/actions/workflows/check.yaml/badge.svg)](https://github.com/platformdirs/platformdirs/actions)
36
36
  [![Downloads](https://static.pepy.tech/badge/platformdirs/month)](https://pepy.tech/project/platformdirs)
37
+ [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/tox-dev/platformdirs/badge)](https://scorecard.dev/viewer/?uri=github.com/tox-dev/platformdirs)
38
+ [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/16249/badge)](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.1",
114
+ "release-creator>=4.4",
115
115
  "towncrier>=26.9",
116
116
  ]
117
117
  release-news = [
118
- "release-creator>=4.1",
118
+ "release-creator>=4.4",
119
119
  "towncrier>=26.9",
120
120
  ]
121
121
  release-notes = [
122
- "release-creator>=4.1",
122
+ "release-creator>=4.4",
123
123
  ]
124
124
  release-prepare = [
125
125
  "prek>=0.5",
126
- "release-creator>=4.1",
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
- # temporary, delete after 2026-11-02
250
- packages.release-creator.uploaded-prior-to = 2026-10-26T18:24:46Z
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, "").strip()
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.2'
22
- __version_tuple__ = version_tuple = (4, 14, 2)
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.usefixtures("_geteuid")
284
- def test_xdg_variable_padded_value(monkeypatch: pytest.MonkeyPatch, dirs_instance: Unix, func: str) -> None:
285
- xdg_variable = _func_to_path(func)
286
- if xdg_variable is None:
287
- return
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
- monkeypatch.setenv(xdg_variable.name, " /custom-dir ")
290
- result = getattr(dirs_instance, func)
291
- assert result == "/custom-dir"
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("prop", ["site_data_dir", "site_config_dir", "site_applications_dir"])
1323
- @pytest.mark.parametrize("multipath", [pytest.param(True, id="multipath"), pytest.param(False, id="singlepath")])
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, multipath: bool
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
- suffix: typing.Final = "applications" if prop == "site_applications_dir" else "foo"
1331
- expected: typing.Final = [f"/custom/{name}{os.sep}{suffix}" for name in ("first", "second")]
1332
- assert getattr(dirs_class(appname="foo", multipath=multipath), prop) == (
1333
- os.pathsep.join(expected) if multipath else expected[0]
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