setuptools-lean
The setuptools-lean package provides a setuptools plugin for building and bundling Python extensions written in Lean. It uses Nerodia as its Lean backend.
Quick Start
Python modules are configured on the Lean side through Nerodia. For example,
the Lean definition of the Python module mymodule would look something like this:
MyModule.lean
module
import Nerodia
open scoped Nerodia
py_module "mymodule"
This module can then be bundled into a Python package with the following configuration:
pyproject.toml
[project]
name = "mypackage"
version = "1.0.0"
requires-python = ">=3.14"
[tool.setuptools]
# setuptools-lean will generate a Python package for us.
# Without this field, setuptools may assume Lean libraries are Python packages.
# Python packages of your own can be added to this list.
packages = []
[build-system]
requires = ["setuptools", "setuptools-lean"]
build-backend = "setuptools.build_meta"
[[tool.setuptools-lean.ext-modules]]
lean-module = "MyModule"
This package can then be installed locally via pip install ., and the installed Python extension imported via import mymodule. If you are using uv, running Python code that imports mymodule is as simple as running uv run mymoduleuser.py in the same directory as the Python extension (no manual install necessary). setuptools-lean will also locate Nerodia-generated type stubs for the module where they need to be so that type checkers and editors will pick them up. Thus, editing a Python module mymoduleuser will provide all the rich type information and docstrings users might expect from regular Python code.
For a complete example of developing a Python package in Lean, refer to Nerodia.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file setuptools_lean-0.2.0.tar.gz.
File metadata
- Download URL: setuptools_lean-0.2.0.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7c1b54f2247f3c813727166312e5c9e22478bb2f25edc9267707dbe528fbbad
|
|
| MD5 |
07f7fe4be9392c563201b428b119a70a
|
|
| BLAKE2b-256 |
de7e4860b343b5aadf1938672d264928ddf1ed4d975603817b83b2aed50c2d3d
|
Provenance
The following attestation bundles were made for setuptools_lean-0.2.0.tar.gz:
Publisher:
release.yml on leanprover/setuptools-lean
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
setuptools_lean-0.2.0.tar.gz -
Subject digest:
b7c1b54f2247f3c813727166312e5c9e22478bb2f25edc9267707dbe528fbbad - Sigstore transparency entry: 2405629793
- Sigstore integration time:
-
Permalink:
leanprover/setuptools-lean@622b1443d1f3688aaf77184a35d0043ed812c939 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/leanprover
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@622b1443d1f3688aaf77184a35d0043ed812c939 -
Trigger Event:
push
-
Statement type:
File details
Details for the file setuptools_lean-0.2.0-py3-none-any.whl.
File metadata
- Download URL: setuptools_lean-0.2.0-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
982db60180d6aa9869bb77de9c37cdfa17617e2ad490bd8cdce1dfb2be316ae0
|
|
| MD5 |
3bc8435166eada95fa33d8b2a5fc67d1
|
|
| BLAKE2b-256 |
86eccb7a2c4778ae65057f1bac18461d12a74a6178cbdbb6555b2bd3d10ee90d
|
Provenance
The following attestation bundles were made for setuptools_lean-0.2.0-py3-none-any.whl:
Publisher:
release.yml on leanprover/setuptools-lean
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
setuptools_lean-0.2.0-py3-none-any.whl -
Subject digest:
982db60180d6aa9869bb77de9c37cdfa17617e2ad490bd8cdce1dfb2be316ae0 - Sigstore transparency entry: 2405629920
- Sigstore integration time:
-
Permalink:
leanprover/setuptools-lean@622b1443d1f3688aaf77184a35d0043ed812c939 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/leanprover
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@622b1443d1f3688aaf77184a35d0043ed812c939 -
Trigger Event:
push
-
Statement type: