diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 70ff53f..203a6b2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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"] @@ -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: diff --git a/src/filelock/_api.py b/src/filelock/_api.py index 771a559..8fde69a 100644 --- a/src/filelock/_api.py +++ b/src/filelock/_api.py @@ -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" @@ -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): diff --git a/src/filelock/_unix.py b/src/filelock/_unix.py index 4ae1fbe..04f590d 100644 --- a/src/filelock/_unix.py +++ b/src/filelock/_unix.py @@ -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) diff --git a/src/filelock/_windows.py b/src/filelock/_windows.py index 8db55dc..348251d 100644 --- a/src/filelock/_windows.py +++ b/src/filelock/_windows.py @@ -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) diff --git a/src/filelock/asyncio.py b/src/filelock/asyncio.py index 0fdd8f7..252de20 100644 --- a/src/filelock/asyncio.py +++ b/src/filelock/asyncio.py @@ -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):