Skip to main content

Adds locks and timeouts to Click entrypoints.

There is only one decorator click_lock.lock which can be applied to click commands and groups:

# example.py
import time
import click
import click_lock

@click.command()
@click_lock.lock
def cmd():
    time.sleep(10)

cmd()

Now you have some additional options:

Usage: example.py [OPTIONS]

Options:
  --lock fname          Path to lock file
  --timeout seconds     Limit script execution time
  --trace / --no-trace  Log traceback in case of timeout  [default: True]
  --help                Show this message and exit.

For example, lock script execution:

python example.py --lock /tmp/example.lck

Limit script execution time:

python example.py --timeout 1

Release files for click-lock 0.6

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

Source distribution (sdist)

Source distribution for click-lock 0.6
File Size Uploaded
click-lock-0.6.tar.gz 2.3 kB Details

Release files / click-lock-0.6.tar.gz

Download URL click-lock-0.6.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
816c413166ffbbd2222a2070e3d30d60c81666a4b2319e19d72e52d424729ab2
BLAKE2b-256 checksum
How to use checksums
22b1a928b2bd706996fa32f158f34738799ce62cacbe9922a8a417acc12a4aa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.6 This release

1 release file

0.5.1

1 release file

0.5

1 release file

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