diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f70a3508..14e5240d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,11 +19,11 @@ repos: hooks: - id: tox-toml-fmt - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.24.1" + rev: "v2.25.0" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.15.17" + rev: "v0.15.18" hooks: - id: ruff-format - id: ruff-check @@ -34,7 +34,7 @@ repos: - id: prettier args: ["--print-width=120", "--prose-wrap=always"] - repo: https://github.com/zizmorcore/zizmor-pre-commit - rev: v1.25.2 + rev: v1.26.1 hooks: - id: zizmor - repo: meta diff --git a/src/filelock/_api.py b/src/filelock/_api.py index fc4320f0..2c97e54e 100644 --- a/src/filelock/_api.py +++ b/src/filelock/_api.py @@ -257,7 +257,7 @@ def is_thread_local(self) -> bool: @property def is_singleton(self) -> bool: """ - :returns: a flag indicating if this lock is singleton or not + A flag indicating if this lock is singleton or not. .. versionadded:: 3.13.0 @@ -266,13 +266,13 @@ def is_singleton(self) -> bool: @property def lock_file(self) -> str: - """:returns: path to the lock file""" + """Path to the lock file.""" return self._context.lock_file @property def timeout(self) -> float: """ - :returns: the default timeout value, in seconds + The default timeout value, in seconds. .. versionadded:: 2.0.0 @@ -292,7 +292,7 @@ def timeout(self, value: float | str) -> None: @property def blocking(self) -> bool: """ - :returns: whether the locking is blocking or not + Whether the locking is blocking or not. .. versionadded:: 3.14.0 @@ -312,7 +312,7 @@ def blocking(self, value: bool) -> None: @property def poll_interval(self) -> float: """ - :returns: the default polling interval, in seconds + The default polling interval, in seconds. .. versionadded:: 3.24.0 @@ -332,7 +332,7 @@ def poll_interval(self, value: float) -> None: @property def lifetime(self) -> float | None: """ - :returns: the lock lifetime in seconds, or ``None`` if the lock never expires + The lock lifetime in seconds, or ``None`` if the lock never expires. .. versionadded:: 3.24.0 @@ -351,12 +351,12 @@ def lifetime(self, value: float | None) -> None: @property def mode(self) -> int: - """:returns: the file permissions for the lockfile""" + """The file permissions for the lockfile.""" return 0o644 if self._context.mode == _UNSET_FILE_MODE else self._context.mode @property def has_explicit_mode(self) -> bool: - """:returns: whether the file permissions were explicitly set""" + """Whether the file permissions were explicitly set.""" return self._context.mode != _UNSET_FILE_MODE def _open_mode(self) -> int: @@ -390,7 +390,7 @@ def _release(self) -> None: @property def is_locked(self) -> bool: """ - :returns: A boolean indicating if the lock file is holding the lock currently. + A boolean indicating if the lock file is holding the lock currently. .. versionchanged:: 2.0.0 @@ -401,7 +401,7 @@ def is_locked(self) -> bool: @property def lock_counter(self) -> int: - """:returns: The number of times this lock has been acquired (but not yet released).""" + """The number of times this lock has been acquired (but not yet released).""" return self._context.lock_counter @staticmethod diff --git a/src/filelock/_async_read_write.py b/src/filelock/_async_read_write.py index 09ae0396..4c42d2f6 100644 --- a/src/filelock/_async_read_write.py +++ b/src/filelock/_async_read_write.py @@ -74,27 +74,27 @@ def __init__( # noqa: PLR0913 @property def lock_file(self) -> str: - """:returns: the path to the lock file.""" + """The path to the lock file.""" return self._lock.lock_file @property def timeout(self) -> float: - """:returns: the default timeout.""" + """The default timeout.""" return self._lock.timeout @property def blocking(self) -> bool: - """:returns: whether blocking is enabled by default.""" + """Whether blocking is enabled by default.""" return self._lock.blocking @property def loop(self) -> asyncio.AbstractEventLoop | None: - """:returns: the event loop (or ``None`` for the running loop).""" + """The event loop (or ``None`` for the running loop).""" return self._loop @property def executor(self) -> futures.Executor: - """:returns: the executor used for ``run_in_executor`` (a dedicated single-thread one if none was supplied).""" + """The executor used for ``run_in_executor`` (a dedicated single-thread one if none was supplied).""" return self._executor async def _run(self, func: Callable[..., object], *args: object, **kwargs: object) -> object: diff --git a/src/filelock/_error.py b/src/filelock/_error.py index 629b5707..148a2ccf 100644 --- a/src/filelock/_error.py +++ b/src/filelock/_error.py @@ -19,7 +19,7 @@ def __repr__(self) -> str: @property def lock_file(self) -> str: - """:returns: The path of the file lock.""" + """The path of the file lock.""" return self._lock_file diff --git a/src/filelock/_soft_rw/_async.py b/src/filelock/_soft_rw/_async.py index 8b5ae2ef..493f5ede 100644 --- a/src/filelock/_soft_rw/_async.py +++ b/src/filelock/_soft_rw/_async.py @@ -83,27 +83,27 @@ def __init__( # noqa: PLR0913 @property def lock_file(self) -> str: - """:returns: the path to the lock file passed to the constructor.""" + """The path to the lock file passed to the constructor.""" return self._lock.lock_file @property def timeout(self) -> float: - """:returns: the default timeout applied when ``acquire_read`` / ``acquire_write`` is called without one.""" + """The default timeout applied when ``acquire_read`` / ``acquire_write`` is called without one.""" return self._lock.timeout @property def blocking(self) -> bool: - """:returns: whether ``acquire_*`` defaults to blocking; ``False`` makes contention raise immediately.""" + """Whether ``acquire_*`` defaults to blocking; ``False`` makes contention raise immediately.""" return self._lock.blocking @property def loop(self) -> asyncio.AbstractEventLoop | None: - """:returns: the event loop used for ``run_in_executor``, or ``None`` for the running loop.""" + """The event loop used for ``run_in_executor``, or ``None`` for the running loop.""" return self._loop @property def executor(self) -> futures.Executor | None: - """:returns: the executor used for ``run_in_executor``, or ``None`` for the default executor.""" + """The executor used for ``run_in_executor``, or ``None`` for the default executor.""" return self._executor async def acquire_read( diff --git a/src/filelock/asyncio.py b/src/filelock/asyncio.py index ea56d1cd..0ad78086 100644 --- a/src/filelock/asyncio.py +++ b/src/filelock/asyncio.py @@ -181,12 +181,12 @@ def __init__( # noqa: PLR0913 @property def run_in_executor(self) -> bool: - """:returns: whether run in executor.""" + """Whether run in executor.""" return self._context.run_in_executor @property def executor(self) -> futures.Executor | None: - """:returns: the executor.""" + """The executor.""" return self._context.executor @executor.setter @@ -201,7 +201,7 @@ def executor(self, value: futures.Executor | None) -> None: # pragma: no cover @property def loop(self) -> asyncio.AbstractEventLoop | None: - """:returns: the event loop.""" + """The event loop.""" return self._context.loop async def acquire( # ty: ignore[invalid-method-override]