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 #383

Merged
merged 2 commits into from
Dec 3, 2024
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
rev: 0.30.0
hooks:
- id: check-github-workflows
args: ["--verbose"]
Expand All @@ -24,13 +24,13 @@ repos:
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.8.0"
rev: "v0.8.1"
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" # Use the sha / tag you want to point at
rev: "v3.4.1" # Use the sha / tag you want to point at
hooks:
- id: prettier
additional_dependencies:
Expand Down
4 changes: 2 additions & 2 deletions src/filelock/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def __call__( # noqa: PLR0913
if passed_param != set_param
}
if not non_matching_params:
return cast(BaseFileLock, instance)
return cast("BaseFileLock", instance)

# parameters do not match; raise error
msg = "Singleton lock instances cannot be initialized with differing arguments"
Expand Down Expand Up @@ -136,7 +136,7 @@ def __call__( # noqa: PLR0913
if is_singleton:
cls._instances[str(lock_file)] = instance # type: ignore[attr-defined]

return cast(BaseFileLock, instance)
return cast("BaseFileLock", instance)


class BaseFileLock(contextlib.ContextDecorator, metaclass=FileLockMeta):
Expand Down
2 changes: 1 addition & 1 deletion src/filelock/_unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _release(self) -> None:
# Do not remove the lockfile:
# https://github.com/tox-dev/py-filelock/issues/31
# https://stackoverflow.com/questions/17708885/flock-removing-locked-file-without-race-condition
fd = cast(int, self._context.lock_file_fd)
fd = cast("int", self._context.lock_file_fd)
self._context.lock_file_fd = None
fcntl.flock(fd, fcntl.LOCK_UN)
os.close(fd)
Expand Down
2 changes: 1 addition & 1 deletion src/filelock/_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _acquire(self) -> None:
self._context.lock_file_fd = fd

def _release(self) -> None:
fd = cast(int, self._context.lock_file_fd)
fd = cast("int", self._context.lock_file_fd)
self._context.lock_file_fd = None
msvcrt.locking(fd, msvcrt.LK_UNLCK, 1)
os.close(fd)
Expand Down
2 changes: 1 addition & 1 deletion src/filelock/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def __call__( # type: ignore[override] # noqa: PLR0913
run_in_executor=run_in_executor,
executor=executor,
)
return cast(BaseAsyncFileLock, instance)
return cast("BaseAsyncFileLock", instance)


class BaseAsyncFileLock(BaseFileLock, metaclass=AsyncFileLockMeta):
Expand Down
Loading