Skip to content

Commit d0ab550

Browse files
[pre-commit.ci] pre-commit autoupdate (#326)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/python-jsonschema/check-jsonschema: 0.29.4 → 0.31.0](python-jsonschema/check-jsonschema@0.29.4...0.31.0) - [github.com/astral-sh/ruff-pre-commit: v0.7.3 → v0.9.2](astral-sh/ruff-pre-commit@v0.7.3...v0.9.2) - [github.com/rbubley/mirrors-prettier: v3.3.3 → v3.4.2](rbubley/mirrors-prettier@v3.3.3...v3.4.2) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix failures Signed-off-by: Bernát Gábor <[email protected]> --------- Signed-off-by: Bernát Gábor <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bernát Gábor <[email protected]>
1 parent 8c660e6 commit d0ab550

File tree

6 files changed

+37
-38
lines changed

6 files changed

+37
-38
lines changed

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@ repos:
55
- id: end-of-file-fixer
66
- id: trailing-whitespace
77
- repo: https://github.com/python-jsonschema/check-jsonschema
8-
rev: 0.29.4
8+
rev: 0.31.0
99
hooks:
1010
- id: check-github-workflows
1111
args: ["--verbose"]
1212
- repo: https://github.com/codespell-project/codespell
1313
rev: v2.3.0
1414
hooks:
1515
- id: codespell
16-
additional_dependencies: ["tomli>=2.0.1"]
16+
additional_dependencies: ["tomli>=2.2.1"]
1717
- repo: https://github.com/tox-dev/pyproject-fmt
1818
rev: "v2.5.0"
1919
hooks:
2020
- id: pyproject-fmt
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: "v0.7.3"
22+
rev: "v0.9.2"
2323
hooks:
2424
- id: ruff-format
2525
- id: ruff
2626
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
2727
- repo: https://github.com/rbubley/mirrors-prettier
28-
rev: "v3.3.3"
28+
rev: "v3.4.2"
2929
hooks:
3030
- id: prettier
3131
args: ["--print-width=120", "--prose-wrap=always"]

pyproject.toml

+7-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
build-backend = "hatchling.build"
33
requires = [
44
"hatch-vcs>=0.4",
5-
"hatchling>=1.25",
5+
"hatchling>=1.27",
66
]
77

88
[project]
@@ -47,18 +47,18 @@ dynamic = [
4747
optional-dependencies.docs = [
4848
"furo>=2024.8.6",
4949
"proselint>=0.14",
50-
"sphinx>=8.0.2",
51-
"sphinx-autodoc-typehints>=2.4",
50+
"sphinx>=8.1.3",
51+
"sphinx-autodoc-typehints>=3",
5252
]
5353
optional-dependencies.test = [
5454
"appdirs==1.4.4",
5555
"covdefaults>=2.3",
56-
"pytest>=8.3.2",
57-
"pytest-cov>=5",
56+
"pytest>=8.3.4",
57+
"pytest-cov>=6",
5858
"pytest-mock>=3.14",
5959
]
6060
optional-dependencies.type = [
61-
"mypy>=1.11.2",
61+
"mypy>=1.14.1",
6262
]
6363

6464
urls.Changelog = "https://github.com/tox-dev/platformdirs/releases"
@@ -201,14 +201,13 @@ scripts = { "run" = [
201201
] }
202202

203203
[tool.ruff]
204-
target-version = "py39"
205204
line-length = 120
206205
format.preview = true
207206
lint.select = [
208207
"ALL",
209208
]
210209
lint.ignore = [
211-
"ANN101", # Missing type annotation for `self` in method
210+
"COM812", # conflict
212211
"CPY", # no copyright notices
213212
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
214213
"D205", # 1 blank line required between summary line and description

src/platformdirs/__init__.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def _set_platform_dir_class() -> type[PlatformDirsABC]:
5252

5353
def user_data_dir(
5454
appname: str | None = None,
55-
appauthor: str | None | Literal[False] = None,
55+
appauthor: str | Literal[False] | None = None,
5656
version: str | None = None,
5757
roaming: bool = False, # noqa: FBT001, FBT002
5858
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -76,7 +76,7 @@ def user_data_dir(
7676

7777
def site_data_dir(
7878
appname: str | None = None,
79-
appauthor: str | None | Literal[False] = None,
79+
appauthor: str | Literal[False] | None = None,
8080
version: str | None = None,
8181
multipath: bool = False, # noqa: FBT001, FBT002
8282
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -100,7 +100,7 @@ def site_data_dir(
100100

101101
def user_config_dir(
102102
appname: str | None = None,
103-
appauthor: str | None | Literal[False] = None,
103+
appauthor: str | Literal[False] | None = None,
104104
version: str | None = None,
105105
roaming: bool = False, # noqa: FBT001, FBT002
106106
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -124,7 +124,7 @@ def user_config_dir(
124124

125125
def site_config_dir(
126126
appname: str | None = None,
127-
appauthor: str | None | Literal[False] = None,
127+
appauthor: str | Literal[False] | None = None,
128128
version: str | None = None,
129129
multipath: bool = False, # noqa: FBT001, FBT002
130130
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -148,7 +148,7 @@ def site_config_dir(
148148

149149
def user_cache_dir(
150150
appname: str | None = None,
151-
appauthor: str | None | Literal[False] = None,
151+
appauthor: str | Literal[False] | None = None,
152152
version: str | None = None,
153153
opinion: bool = True, # noqa: FBT001, FBT002
154154
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -172,7 +172,7 @@ def user_cache_dir(
172172

173173
def site_cache_dir(
174174
appname: str | None = None,
175-
appauthor: str | None | Literal[False] = None,
175+
appauthor: str | Literal[False] | None = None,
176176
version: str | None = None,
177177
opinion: bool = True, # noqa: FBT001, FBT002
178178
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -196,7 +196,7 @@ def site_cache_dir(
196196

197197
def user_state_dir(
198198
appname: str | None = None,
199-
appauthor: str | None | Literal[False] = None,
199+
appauthor: str | Literal[False] | None = None,
200200
version: str | None = None,
201201
roaming: bool = False, # noqa: FBT001, FBT002
202202
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -220,7 +220,7 @@ def user_state_dir(
220220

221221
def user_log_dir(
222222
appname: str | None = None,
223-
appauthor: str | None | Literal[False] = None,
223+
appauthor: str | Literal[False] | None = None,
224224
version: str | None = None,
225225
opinion: bool = True, # noqa: FBT001, FBT002
226226
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -274,7 +274,7 @@ def user_desktop_dir() -> str:
274274

275275
def user_runtime_dir(
276276
appname: str | None = None,
277-
appauthor: str | None | Literal[False] = None,
277+
appauthor: str | Literal[False] | None = None,
278278
version: str | None = None,
279279
opinion: bool = True, # noqa: FBT001, FBT002
280280
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -298,7 +298,7 @@ def user_runtime_dir(
298298

299299
def site_runtime_dir(
300300
appname: str | None = None,
301-
appauthor: str | None | Literal[False] = None,
301+
appauthor: str | Literal[False] | None = None,
302302
version: str | None = None,
303303
opinion: bool = True, # noqa: FBT001, FBT002
304304
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -322,7 +322,7 @@ def site_runtime_dir(
322322

323323
def user_data_path(
324324
appname: str | None = None,
325-
appauthor: str | None | Literal[False] = None,
325+
appauthor: str | Literal[False] | None = None,
326326
version: str | None = None,
327327
roaming: bool = False, # noqa: FBT001, FBT002
328328
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -346,7 +346,7 @@ def user_data_path(
346346

347347
def site_data_path(
348348
appname: str | None = None,
349-
appauthor: str | None | Literal[False] = None,
349+
appauthor: str | Literal[False] | None = None,
350350
version: str | None = None,
351351
multipath: bool = False, # noqa: FBT001, FBT002
352352
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -370,7 +370,7 @@ def site_data_path(
370370

371371
def user_config_path(
372372
appname: str | None = None,
373-
appauthor: str | None | Literal[False] = None,
373+
appauthor: str | Literal[False] | None = None,
374374
version: str | None = None,
375375
roaming: bool = False, # noqa: FBT001, FBT002
376376
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -394,7 +394,7 @@ def user_config_path(
394394

395395
def site_config_path(
396396
appname: str | None = None,
397-
appauthor: str | None | Literal[False] = None,
397+
appauthor: str | Literal[False] | None = None,
398398
version: str | None = None,
399399
multipath: bool = False, # noqa: FBT001, FBT002
400400
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -418,7 +418,7 @@ def site_config_path(
418418

419419
def site_cache_path(
420420
appname: str | None = None,
421-
appauthor: str | None | Literal[False] = None,
421+
appauthor: str | Literal[False] | None = None,
422422
version: str | None = None,
423423
opinion: bool = True, # noqa: FBT001, FBT002
424424
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -442,7 +442,7 @@ def site_cache_path(
442442

443443
def user_cache_path(
444444
appname: str | None = None,
445-
appauthor: str | None | Literal[False] = None,
445+
appauthor: str | Literal[False] | None = None,
446446
version: str | None = None,
447447
opinion: bool = True, # noqa: FBT001, FBT002
448448
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -466,7 +466,7 @@ def user_cache_path(
466466

467467
def user_state_path(
468468
appname: str | None = None,
469-
appauthor: str | None | Literal[False] = None,
469+
appauthor: str | Literal[False] | None = None,
470470
version: str | None = None,
471471
roaming: bool = False, # noqa: FBT001, FBT002
472472
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -490,7 +490,7 @@ def user_state_path(
490490

491491
def user_log_path(
492492
appname: str | None = None,
493-
appauthor: str | None | Literal[False] = None,
493+
appauthor: str | Literal[False] | None = None,
494494
version: str | None = None,
495495
opinion: bool = True, # noqa: FBT001, FBT002
496496
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -544,7 +544,7 @@ def user_desktop_path() -> Path:
544544

545545
def user_runtime_path(
546546
appname: str | None = None,
547-
appauthor: str | None | Literal[False] = None,
547+
appauthor: str | Literal[False] | None = None,
548548
version: str | None = None,
549549
opinion: bool = True, # noqa: FBT001, FBT002
550550
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -568,7 +568,7 @@ def user_runtime_path(
568568

569569
def site_runtime_path(
570570
appname: str | None = None,
571-
appauthor: str | None | Literal[False] = None,
571+
appauthor: str | Literal[False] | None = None,
572572
version: str | None = None,
573573
opinion: bool = True, # noqa: FBT001, FBT002
574574
ensure_exists: bool = False, # noqa: FBT001, FBT002

src/platformdirs/android.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Android(PlatformDirsABC):
2323
@property
2424
def user_data_dir(self) -> str:
2525
""":return: data directory tied to the user, e.g. ``/data/user/<userid>/<packagename>/files/<AppName>``"""
26-
return self._append_app_name_and_version(cast(str, _android_folder()), "files")
26+
return self._append_app_name_and_version(cast("str", _android_folder()), "files")
2727

2828
@property
2929
def site_data_dir(self) -> str:
@@ -36,7 +36,7 @@ def user_config_dir(self) -> str:
3636
:return: config directory tied to the user, e.g. \
3737
``/data/user/<userid>/<packagename>/shared_prefs/<AppName>``
3838
"""
39-
return self._append_app_name_and_version(cast(str, _android_folder()), "shared_prefs")
39+
return self._append_app_name_and_version(cast("str", _android_folder()), "shared_prefs")
4040

4141
@property
4242
def site_config_dir(self) -> str:
@@ -46,7 +46,7 @@ def site_config_dir(self) -> str:
4646
@property
4747
def user_cache_dir(self) -> str:
4848
""":return: cache directory tied to the user, e.g.,``/data/user/<userid>/<packagename>/cache/<AppName>``"""
49-
return self._append_app_name_and_version(cast(str, _android_folder()), "cache")
49+
return self._append_app_name_and_version(cast("str", _android_folder()), "cache")
5050

5151
@property
5252
def site_cache_dir(self) -> str:

src/platformdirs/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class PlatformDirsABC(ABC): # noqa: PLR0904
1818
def __init__( # noqa: PLR0913, PLR0917
1919
self,
2020
appname: str | None = None,
21-
appauthor: str | None | Literal[False] = None,
21+
appauthor: str | Literal[False] | None = None,
2222
version: str | None = None,
2323
roaming: bool = False, # noqa: FBT001, FBT002
2424
multipath: bool = False, # noqa: FBT001, FBT002

tests/conftest.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828

2929
@pytest.fixture(params=PROPS)
3030
def func(request: SubRequest) -> str:
31-
return cast(str, request.param)
31+
return cast("str", request.param)
3232

3333

3434
@pytest.fixture(params=PROPS)
3535
def func_path(request: SubRequest) -> str:
36-
prop = cast(str, request.param)
36+
prop = cast("str", request.param)
3737
return prop.replace("_dir", "_path")
3838

3939

0 commit comments

Comments
 (0)