Skip to content
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 @@ -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
Expand All @@ -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
Expand Down
20 changes: 10 additions & 10 deletions src/filelock/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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:
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/filelock/_async_read_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/filelock/_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
10 changes: 5 additions & 5 deletions src/filelock/_soft_rw/_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions src/filelock/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down