Skip to main content

Python package for Lean Environment Management

Project description

LeanUp

一个用于管理 Lean 数学证明语言环境的 Python 工具

English | 简体中文

🎯 功能特性

  • 🔧 elan 管理: 一键安装和管理 Lean 工具链管理器 elan
  • 🌍 跨平台支持: 支持 Linux、macOS 和 Windows
  • 📦 简单易用: 通过 pip install -e /path/to/LeanUp 快速安装
  • 🔄 命令代理: 透明代理所有 elan 命令,无缝体验
  • 📊 状态监控: 实时查看 Lean 环境状态和已安装工具链

🚀 快速开始

安装

# 从源码安装
pip install -e /path/to/LeanUp

# 或者克隆仓库后安装
git clone https://github.com/Lean-zh/LeanUp.git
cd LeanUp
pip install -e .

基础使用

# 查看帮助
leanup --help

# 初始化 Lean 环境(安装 elan 工具链管理器)
leanup init

# 查看状态
leanup status

# 代理执行 elan 命令
leanup elan --help
leanup elan toolchain list
leanup elan toolchain install stable
leanup elan default stable

📖 详细使用指南

初始化环境

# 初始化环境并安装最新版本的 elan
leanup init

# 强制重新初始化
leanup init --force

# 初始化但不修改 shell 配置文件
leanup init --no-modify-path

管理 Lean 工具链

初始化环境后,您可以使用 leanup elan 命令来管理 Lean 工具链:

# 列出所有可用的工具链
leanup elan toolchain list

# 安装稳定版工具链
leanup elan toolchain install stable

# 安装夜间构建版本
leanup elan toolchain install leanprover/lean4:nightly

# 设置默认工具链
leanup elan default stable

# 更新所有工具链
leanup elan update

# 查看当前活动的工具链
leanup elan show

项目管理

# 为项目设置特定的工具链
cd your-lean-project
leanup elan override set stable

# 移除项目的工具链覆盖
leanup elan override unset

🛠️ 开发

环境设置

# 克隆仓库
git clone https://github.com/Lean-zh/LeanUp.git
cd LeanUp

# 安装开发依赖
pip install -r requirements_dev.txt

# 安装项目(可编辑模式)
pip install -e .

运行测试

# 运行所有测试
pytest tests/ -v

# 运行测试并生成覆盖率报告
coverage run -m pytest tests/
coverage report -m

代码质量检查

# 代码风格检查
ruff check .

# 类型检查
mypy .

🌍 跨平台支持

LeanUp 在以下平台上经过测试:

  • Linux: Ubuntu 20.04+, CentOS 7+, Debian 10+
  • macOS: macOS 10.15+(Intel 和 Apple Silicon)
  • Windows: Windows 10+

📊 项目状态

功能 状态 说明
elan 安装 支持自动检测平台和版本
命令代理 透明传递所有 elan 命令
跨平台支持 Linux/macOS/Windows
单元测试 覆盖率 > 85%
CI/CD GitHub Actions 多平台测试

🤝 贡献

欢迎贡献代码!请查看 贡献指南 了解详细信息。

📝 许可证

本项目采用 MIT 许可证。详细信息请查看 LICENSE 文件。

🔗 相关链接

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leanup-0.0.4.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

leanup-0.0.4-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file leanup-0.0.4.tar.gz.

File metadata

  • Download URL: leanup-0.0.4.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for leanup-0.0.4.tar.gz
Algorithm Hash digest
SHA256 a571f1af802c5089b3190d294ab034959e488c17d05eaa00b4b0a04dae71efe0
MD5 3cc0959814933aeee70454e0c7a038da
BLAKE2b-256 e7624a5ce8827580b119cb56fb0fbbd6ea7da409aa5bad766a42f43c7536c683

See more details on using hashes here.

File details

Details for the file leanup-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: leanup-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for leanup-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ada05d5cd613e045239f8bd1bd7609a5e8ff21d567d81c9b78af34b1d15de1a0
MD5 ead1d68c6dd7d7d01892cc483c967448
BLAKE2b-256 49eca80320842194942e557a72000973456cff5ca996d617898b9044026d3043

See more details on using hashes here.

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