Installation

Install from PyPI

pip install leasepool

Install from source

From the project root:

pip install -e .

Install documentation dependencies

pip install -r docs/requirements.txt

Build documentation locally

cd docs
make html

Open the generated HTML:

open build/html/index.html

Python support

Python 3.11 to 3.13 only supports:

  • ThreadPoolExecutor

  • ProcessPoolExecutor

Python 3.14+ will support:

  • ThreadPoolExecutor

  • ProcessPoolExecutor

  • InterpreterPoolExecutor

Free-threaded Python

leasepool is pure Python and has been tested on CPython 3.14t free-threaded builds with the GIL disabled.

leasepool manages executor leases, backpressure, shutdown, and WorkGrinder batching under free-threaded Python. User-submitted callables are still responsible for their own thread-safety when they mutate shared state or use non-thread-safe third-party libraries.