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

[pre-commit.ci] pre-commit autoupdate #326

Merged
merged 3 commits into from
Jan 21, 2025
Merged
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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
rev: 0.31.0
hooks:
- id: check-github-workflows
args: ["--verbose"]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies: ["tomli>=2.0.1"]
additional_dependencies: ["tomli>=2.2.1"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.5.0"
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.7.3"
rev: "v0.9.2"
hooks:
- id: ruff-format
- id: ruff
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
- repo: https://github.com/rbubley/mirrors-prettier
rev: "v3.3.3"
rev: "v3.4.2"
hooks:
- id: prettier
args: ["--print-width=120", "--prose-wrap=always"]
Expand Down
15 changes: 7 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build-backend = "hatchling.build"
requires = [
"hatch-vcs>=0.4",
"hatchling>=1.25",
"hatchling>=1.27",
]

[project]
Expand Down Expand Up @@ -47,18 +47,18 @@ dynamic = [
optional-dependencies.docs = [
"furo>=2024.8.6",
"proselint>=0.14",
"sphinx>=8.0.2",
"sphinx-autodoc-typehints>=2.4",
"sphinx>=8.1.3",
"sphinx-autodoc-typehints>=3",
]
optional-dependencies.test = [
"appdirs==1.4.4",
"covdefaults>=2.3",
"pytest>=8.3.2",
"pytest-cov>=5",
"pytest>=8.3.4",
"pytest-cov>=6",
"pytest-mock>=3.14",
]
optional-dependencies.type = [
"mypy>=1.11.2",
"mypy>=1.14.1",
]

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

[tool.ruff]
target-version = "py39"
line-length = 120
format.preview = true
lint.select = [
"ALL",
]
lint.ignore = [
"ANN101", # Missing type annotation for `self` in method
"COM812", # conflict
"CPY", # no copyright notices
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
"D205", # 1 blank line required between summary line and description
Expand Down
40 changes: 20 additions & 20 deletions src/platformdirs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _set_platform_dir_class() -> type[PlatformDirsABC]:

def user_data_dir(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
roaming: bool = False, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -76,7 +76,7 @@ def user_data_dir(

def site_data_dir(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
multipath: bool = False, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -100,7 +100,7 @@ def site_data_dir(

def user_config_dir(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
roaming: bool = False, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -124,7 +124,7 @@ def user_config_dir(

def site_config_dir(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
multipath: bool = False, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -148,7 +148,7 @@ def site_config_dir(

def user_cache_dir(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
opinion: bool = True, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -172,7 +172,7 @@ def user_cache_dir(

def site_cache_dir(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
opinion: bool = True, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -196,7 +196,7 @@ def site_cache_dir(

def user_state_dir(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
roaming: bool = False, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -220,7 +220,7 @@ def user_state_dir(

def user_log_dir(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
opinion: bool = True, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand Down Expand Up @@ -274,7 +274,7 @@ def user_desktop_dir() -> str:

def user_runtime_dir(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
opinion: bool = True, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -298,7 +298,7 @@ def user_runtime_dir(

def site_runtime_dir(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
opinion: bool = True, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -322,7 +322,7 @@ def site_runtime_dir(

def user_data_path(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
roaming: bool = False, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -346,7 +346,7 @@ def user_data_path(

def site_data_path(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
multipath: bool = False, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -370,7 +370,7 @@ def site_data_path(

def user_config_path(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
roaming: bool = False, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -394,7 +394,7 @@ def user_config_path(

def site_config_path(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
multipath: bool = False, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -418,7 +418,7 @@ def site_config_path(

def site_cache_path(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
opinion: bool = True, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -442,7 +442,7 @@ def site_cache_path(

def user_cache_path(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
opinion: bool = True, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -466,7 +466,7 @@ def user_cache_path(

def user_state_path(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
roaming: bool = False, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -490,7 +490,7 @@ def user_state_path(

def user_log_path(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
opinion: bool = True, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand Down Expand Up @@ -544,7 +544,7 @@ def user_desktop_path() -> Path:

def user_runtime_path(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
opinion: bool = True, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand All @@ -568,7 +568,7 @@ def user_runtime_path(

def site_runtime_path(
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
opinion: bool = True, # noqa: FBT001, FBT002
ensure_exists: bool = False, # noqa: FBT001, FBT002
Expand Down
6 changes: 3 additions & 3 deletions src/platformdirs/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Android(PlatformDirsABC):
@property
def user_data_dir(self) -> str:
""":return: data directory tied to the user, e.g. ``/data/user/<userid>/<packagename>/files/<AppName>``"""
return self._append_app_name_and_version(cast(str, _android_folder()), "files")
return self._append_app_name_and_version(cast("str", _android_folder()), "files")

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

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

@property
def site_cache_dir(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion src/platformdirs/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class PlatformDirsABC(ABC): # noqa: PLR0904
def __init__( # noqa: PLR0913, PLR0917
self,
appname: str | None = None,
appauthor: str | None | Literal[False] = None,
appauthor: str | Literal[False] | None = None,
version: str | None = None,
roaming: bool = False, # noqa: FBT001, FBT002
multipath: bool = False, # noqa: FBT001, FBT002
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@

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


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


Expand Down
Loading