Skip to main content

lockfile

File-based lock (via fcntl.flock) preventing concurrent runs of the same process — atomic across forked processes, unlike thread-level locks and semaphores.

Installation

pip install entirius-py-lockfile

Usage

from lockfile import LockFile

lock = LockFile("/var/run/my-job.lock")
lock.acquire()          # raises if already held (non-blocking by default)
try:
    ...                 # critical section
finally:
    lock.release()

Pass wait_for_acquire=True to block until the lock is available instead of raising.

Development

make install     # sync dependencies (uv)
make check       # lint + format check (ruff)
make test        # test suite (pytest)

Development and agent instructions: AGENTS.md.

License

Mozilla Public License 2.0 — see LICENSE.

Metadata

Release files for entirius-py-lockfile 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for entirius-py-lockfile 2.0.0
File Size Uploaded
entirius_py_lockfile-2.0.0.tar.gz 21.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for entirius-py-lockfile 2.0.0
File Interpreter ABI Platform
entirius_py_lockfile-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.4 kB

Release files / entirius_py_lockfile-2.0.0.tar.gz

Download URL entirius_py_lockfile-2.0.0.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
38b475f0ee1477eeee418b2f3044d5a167e383db39f880ce8402d83df2b77976
BLAKE2b-256 checksum
How to use checksums
6b8b2a1595aad5ac15f0924ccb75845d54d99ec4c3f4ec428aff46b40b74ff29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / entirius_py_lockfile-2.0.0-py3-none-any.whl

Download URL entirius_py_lockfile-2.0.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
325a72d5bb2d324c874af420bb071747b25f0ca9d75301d8e27e15274fef52a4
BLAKE2b-256 checksum
How to use checksums
aa7536d5f1e28811df95e7dc2365c6cc1d712ea7c4685dcb131c2e52c50543fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page