Skip to main content

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

setuptools_lean-0.2.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

setuptools_lean-0.2.0-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

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

Hashes for setuptools_lean-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b7c1b54f2247f3c813727166312e5c9e22478bb2f25edc9267707dbe528fbbad
MD5 07f7fe4be9392c563201b428b119a70a
BLAKE2b-256 de7e4860b343b5aadf1938672d264928ddf1ed4d975603817b83b2aed50c2d3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for setuptools_lean-0.2.0.tar.gz:

Publisher: release.yml on leanprover/setuptools-lean

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for setuptools_lean-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 982db60180d6aa9869bb77de9c37cdfa17617e2ad490bd8cdce1dfb2be316ae0
MD5 3bc8435166eada95fa33d8b2a5fc67d1
BLAKE2b-256 86eccb7a2c4778ae65057f1bac18461d12a74a6178cbdbb6555b2bd3d10ee90d

See more details on using hashes here.

Provenance

The following attestation bundles were made for setuptools_lean-0.2.0-py3-none-any.whl:

Publisher: release.yml on leanprover/setuptools-lean

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page