Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.0rc2.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.0rc2-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file setuptools_lean-0.2.0rc2.tar.gz.

File metadata

  • Download URL: setuptools_lean-0.2.0rc2.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.0rc2.tar.gz
Algorithm Hash digest
SHA256 eec7ee31c82d3913e4cabb2b2b21f7b32adc68ab90bb01ca8d022a38725b911c
MD5 f621ef5885c966f0dbae801b01475843
BLAKE2b-256 64d36b6eeb1bba5ebd648f823fe7a85922c5c8b94fdc7a045adbc8c5e37fa645

See more details on using hashes here.

Provenance

The following attestation bundles were made for setuptools_lean-0.2.0rc2.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.0rc2-py3-none-any.whl.

File metadata

File hashes

Hashes for setuptools_lean-0.2.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 a6fed887b0036680128a644fcd491a4415325c7d2392b29834bba5f47d9cfd2d
MD5 48b5c9362dfcfa22992f65321cee8f85
BLAKE2b-256 5e5a3a59111e3f05ecdb812622ebe83e49e282c12fc4d5ab03dccce7ac02c060

See more details on using hashes here.

Provenance

The following attestation bundles were made for setuptools_lean-0.2.0rc2-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