Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#383)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/python-jsonschema/check-jsonschema: 0.29.4 → 0.30.0](python-jsonschema/check-jsonschema@0.29.4...0.30.0)
- [github.com/astral-sh/ruff-pre-commit: v0.8.0 → v0.8.1](astral-sh/ruff-pre-commit@v0.8.0...v0.8.1)
- [github.com/rbubley/mirrors-prettier: v3.3.3 → v3.4.1](rbubley/mirrors-prettier@v3.3.3...v3.4.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Dec 3, 2024
1 parent d4feb5a commit 57f488f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
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

0 comments on commit 57f488f

Please sign in to comment.