lean-interact 0.6.1__tar.gz → 0.6.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lean_interact-0.6.1 → lean_interact-0.6.3}/.github/workflows/update-changelog.yml +5 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/PKG-INFO +2 -2
- {lean_interact-0.6.1 → lean_interact-0.6.3}/README.md +1 -1
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/changelog.md +30 -12
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/index.md +1 -1
- lean_interact-0.6.3/docs/update_changelog.py +156 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/pyproject.toml +2 -2
- {lean_interact-0.6.1 → lean_interact-0.6.3}/src/lean_interact/utils.py +1 -1
- {lean_interact-0.6.1 → lean_interact-0.6.3}/uv.lock +1 -1
- {lean_interact-0.6.1 → lean_interact-0.6.3}/.devcontainer/devcontainer.json +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/.github/workflows/ci.yml +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/.github/workflows/docs.yml +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/.github/workflows/publish-to-pypi.yml +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/.gitignore +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/LICENSE +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/.nojekyll +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/api/config.md +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/api/interface.md +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/api/server.md +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/api/sessioncache.md +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/api/utils.md +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/contributing.md +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/examples.md +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/installation.md +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/troubleshooting.md +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/user-guide/basic-usage.md +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/user-guide/custom-lean-configuration.md +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/user-guide/getting-started.md +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/docs/user-guide/tactic-mode.md +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/examples/beq_plus.py +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/examples/proof_generation_and_autoformalization.py +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/examples/type_check.py +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/mkdocs.yml +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/src/lean_interact/__init__.py +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/src/lean_interact/config.py +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/src/lean_interact/interface.py +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/src/lean_interact/server.py +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/src/lean_interact/sessioncache.py +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/tests/test_concurrency.py +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/tests/test_server.py +0 -0
- {lean_interact-0.6.1 → lean_interact-0.6.3}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lean-interact
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.3
|
|
4
4
|
Summary: LeanInteract is a Python package that allows you to interact with the Lean theorem prover.
|
|
5
5
|
Author-email: Auguste Poiroux <auguste.poiroux@epfl.ch>
|
|
6
6
|
License: MIT License
|
|
@@ -51,7 +51,7 @@ Description-Content-Type: text/markdown
|
|
|
51
51
|
- **🔗 Interactivity**: Execute Lean code and files directly from Python.
|
|
52
52
|
- **🚀 Ease of Use**: LeanInteract abstracts the complexities of Lean setup and interaction.
|
|
53
53
|
- **💻 Cross-platform**: Works on Windows, macOS, and Linux operating systems.
|
|
54
|
-
- **🔧 Compatibility**: Supports all Lean versions between `v4.7.0-rc1` and `v4.
|
|
54
|
+
- **🔧 Compatibility**: Supports all Lean versions between `v4.7.0-rc1` and `v4.22.0-rc2`.
|
|
55
55
|
- We backport the latest features of Lean REPL to older versions of Lean (see [fork](https://github.com/augustepoiroux/repl)).
|
|
56
56
|
- **📦 Temporary Projects**: Easily instantiate temporary Lean environments.
|
|
57
57
|
- Useful for experimenting with benchmarks depending on [Mathlib](https://github.com/leanprover-community/mathlib4) like [ProofNet#](https://huggingface.co/datasets/PAug/ProofNetSharp) and [MiniF2F](https://github.com/yangky11/miniF2F-lean4).
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
- **🔗 Interactivity**: Execute Lean code and files directly from Python.
|
|
14
14
|
- **🚀 Ease of Use**: LeanInteract abstracts the complexities of Lean setup and interaction.
|
|
15
15
|
- **💻 Cross-platform**: Works on Windows, macOS, and Linux operating systems.
|
|
16
|
-
- **🔧 Compatibility**: Supports all Lean versions between `v4.7.0-rc1` and `v4.
|
|
16
|
+
- **🔧 Compatibility**: Supports all Lean versions between `v4.7.0-rc1` and `v4.22.0-rc2`.
|
|
17
17
|
- We backport the latest features of Lean REPL to older versions of Lean (see [fork](https://github.com/augustepoiroux/repl)).
|
|
18
18
|
- **📦 Temporary Projects**: Easily instantiate temporary Lean environments.
|
|
19
19
|
- Useful for experimenting with benchmarks depending on [Mathlib](https://github.com/leanprover-community/mathlib4) like [ProofNet#](https://huggingface.co/datasets/PAug/ProofNetSharp) and [MiniF2F](https://github.com/yangky11/miniF2F-lean4).
|
|
@@ -2,14 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
This page documents the notable changes to LeanInteract.
|
|
4
4
|
|
|
5
|
+
## v0.6.2 (June 30, 2025)
|
|
6
|
+
|
|
7
|
+
## What's Changed
|
|
8
|
+
|
|
9
|
+
- Add support for Lean v4.21.0
|
|
10
|
+
|
|
11
|
+
**Full Changelog**: <https://github.com/augustepoiroux/LeanInteract/compare/v0.6.1...v0.6.2>
|
|
12
|
+
|
|
13
|
+
## v0.6.1 (June 24, 2025)
|
|
14
|
+
|
|
15
|
+
## What's Changed
|
|
16
|
+
|
|
17
|
+
- Fix Lean version inference for `LocalProject` and `GitProject` by @augustepoiroux in <https://github.com/augustepoiroux/LeanInteract/pull/26>
|
|
18
|
+
- Fix `ResourceWarning` issues when killing the REPL
|
|
19
|
+
- Improve memory monitoring in `AutoLeanServer`
|
|
20
|
+
|
|
21
|
+
**Full Changelog**: <https://github.com/augustepoiroux/LeanInteract/compare/v0.6.0...v0.6.1>
|
|
22
|
+
|
|
5
23
|
## v0.6.0 (June 05, 2025)
|
|
6
24
|
|
|
7
25
|
## What's Changed
|
|
8
26
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
27
|
+
- Support for local / custom REPL + Lean versions up to v4.21.0-rc3 by @augustepoiroux in <https://github.com/augustepoiroux/LeanInteract/pull/21>
|
|
28
|
+
- Separate the session cache logic from `AutoLeanServer` by @sorgfresser in <https://github.com/augustepoiroux/LeanInteract/pull/18>
|
|
29
|
+
- Add documentation by @augustepoiroux in <https://github.com/augustepoiroux/LeanInteract/pull/19>
|
|
30
|
+
- Add support for modern Python Path by @augustepoiroux in <https://github.com/augustepoiroux/LeanInteract/pull/20>
|
|
13
31
|
|
|
14
32
|
**Full Changelog**: <https://github.com/augustepoiroux/LeanInteract/compare/v0.5.3...v0.6.0>
|
|
15
33
|
|
|
@@ -17,8 +35,8 @@ This page documents the notable changes to LeanInteract.
|
|
|
17
35
|
|
|
18
36
|
## What's Changed
|
|
19
37
|
|
|
20
|
-
|
|
21
|
-
|
|
38
|
+
- Add optional build boolean for LocalProject by @sorgfresser in <https://github.com/augustepoiroux/LeanInteract/pull/16>
|
|
39
|
+
- Slightly improve sorry detection in `lean_code_is_valid` by checking `message` instead of just `sorries` in REPL output.
|
|
22
40
|
|
|
23
41
|
**Full Changelog**: <https://github.com/augustepoiroux/LeanInteract/compare/v0.5.2...v0.5.3>
|
|
24
42
|
|
|
@@ -32,9 +50,9 @@ Introduce compatibility with Lean v4.19.0
|
|
|
32
50
|
|
|
33
51
|
## What's Changed
|
|
34
52
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
53
|
+
- Add fix for non-respected timeout by @augustepoiroux in <https://github.com/augustepoiroux/LeanInteract/pull/13>
|
|
54
|
+
- Query Lake cache for all Project types by @habemus-papadum in <https://github.com/augustepoiroux/LeanInteract/pull/10>
|
|
55
|
+
- Bump REPL version to v1.0.7 fixing `"auxiliary declaration cannot be created when declaration name is not available"` in tactic mode for Lean <= v4.18.0 <https://github.com/leanprover-community/repl/issues/44#issuecomment-2814069261>
|
|
38
56
|
|
|
39
57
|
**Full Changelog**: <https://github.com/augustepoiroux/LeanInteract/compare/v0.5.0...v0.5.1>
|
|
40
58
|
|
|
@@ -42,9 +60,9 @@ Introduce compatibility with Lean v4.19.0
|
|
|
42
60
|
|
|
43
61
|
## What's Changed
|
|
44
62
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
63
|
+
- Make LeanInteract cross-platform by @augustepoiroux in <https://github.com/augustepoiroux/LeanInteract/pull/4>
|
|
64
|
+
- Fix infotree parsing issue by @sorgfresser in <https://github.com/augustepoiroux/LeanInteract/pull/1>
|
|
65
|
+
- Implement `async_run` + make calls to the REPL thread-safe by @augustepoiroux in <https://github.com/augustepoiroux/LeanInteract/pull/2>
|
|
48
66
|
|
|
49
67
|
## v0.4.1 (April 18, 2025)
|
|
50
68
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
- **🔗 Interactivity**: Execute Lean code and files directly from Python
|
|
13
13
|
- **🚀 Ease of Use**: LeanInteract abstracts the complexities of Lean setup and interaction
|
|
14
14
|
- **💻 Cross-platform**: Works on Windows, macOS, and Linux operating systems
|
|
15
|
-
- **🔧 Compatibility**: Supports all Lean versions between `v4.7.0-rc1` and `v4.
|
|
15
|
+
- **🔧 Compatibility**: Supports all Lean versions between `v4.7.0-rc1` and `v4.22.0-rc2`
|
|
16
16
|
- We backport the latest features of Lean REPL to older versions of Lean (see [fork](https://github.com/augustepoiroux/repl)).
|
|
17
17
|
- **📦 Temporary Projects**: Easily instantiate temporary Lean environments
|
|
18
18
|
- Useful for experimenting with benchmarks depending on [Mathlib](https://github.com/leanprover-community/mathlib4) like [ProofNet#](https://huggingface.co/datasets/PAug/ProofNetSharp) and [MiniF2F](https://github.com/yangky11/miniF2F-lean4)
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Update the changelog from GitHub releases.
|
|
4
|
+
This script fetches release information from the GitHub API and updates the changelog file.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import argparse
|
|
8
|
+
import os
|
|
9
|
+
import re
|
|
10
|
+
import sys
|
|
11
|
+
from datetime import datetime
|
|
12
|
+
|
|
13
|
+
import requests
|
|
14
|
+
|
|
15
|
+
# Configuration
|
|
16
|
+
REPO_OWNER = "augustepoiroux"
|
|
17
|
+
REPO_NAME = "LeanInteract"
|
|
18
|
+
CHANGELOG_PATH = "docs/changelog.md"
|
|
19
|
+
GITHUB_TOKEN = os.environ.get("GITHUB_TOKEN") # Set this environment variable if you're hitting rate limits
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def format_date(date_string):
|
|
23
|
+
"""Format the date as Month Day, Year"""
|
|
24
|
+
date_obj = datetime.fromisoformat(date_string.replace("Z", "+00:00"))
|
|
25
|
+
return date_obj.strftime("%B %d, %Y")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def fetch_releases():
|
|
29
|
+
"""Fetch releases from GitHub API"""
|
|
30
|
+
headers = {}
|
|
31
|
+
if GITHUB_TOKEN:
|
|
32
|
+
headers["Authorization"] = f"token {GITHUB_TOKEN}"
|
|
33
|
+
|
|
34
|
+
url = f"https://api.github.com/repos/{REPO_OWNER}/{REPO_NAME}/releases"
|
|
35
|
+
response = requests.get(url, headers=headers, timeout=30) # 30 seconds timeout
|
|
36
|
+
|
|
37
|
+
if response.status_code != 200:
|
|
38
|
+
print(f"Failed to fetch releases: {response.status_code}")
|
|
39
|
+
print(response.text)
|
|
40
|
+
sys.exit(1)
|
|
41
|
+
|
|
42
|
+
return response.json()
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def format_release(release):
|
|
46
|
+
"""Format a release for the changelog"""
|
|
47
|
+
tag = release["tag_name"]
|
|
48
|
+
name = release.get("name") or tag
|
|
49
|
+
body = release["body"].strip()
|
|
50
|
+
published_at = format_date(release["published_at"])
|
|
51
|
+
|
|
52
|
+
# If the name is just the tag, make it more presentable
|
|
53
|
+
if name == tag:
|
|
54
|
+
name = tag
|
|
55
|
+
|
|
56
|
+
return f"\n\n## {name} ({published_at})\n\n{body}\n"
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def update_changelog(releases):
|
|
60
|
+
"""Update the changelog file with the releases"""
|
|
61
|
+
# Create changelog if it doesn't exist
|
|
62
|
+
if not os.path.exists(CHANGELOG_PATH):
|
|
63
|
+
with open(CHANGELOG_PATH, "w", encoding="utf-8") as f:
|
|
64
|
+
f.write("# Changelog\n\nThis page documents the notable changes to LeanInteract.\n\n")
|
|
65
|
+
|
|
66
|
+
# Read current changelog content
|
|
67
|
+
with open(CHANGELOG_PATH, "r", encoding="utf-8") as f:
|
|
68
|
+
content = f.read()
|
|
69
|
+
|
|
70
|
+
# Extract header and existing releases
|
|
71
|
+
header_match = re.match(r"(# Changelog\s+.*?)\s*##", content, re.DOTALL)
|
|
72
|
+
if header_match:
|
|
73
|
+
header = header_match.group(1)
|
|
74
|
+
else:
|
|
75
|
+
header = "# Changelog\n\nThis page documents the notable changes to LeanInteract.\n\n"
|
|
76
|
+
|
|
77
|
+
# Check if we're only updating a single release
|
|
78
|
+
if len(releases) == 1:
|
|
79
|
+
# For a single release, insert it after the header
|
|
80
|
+
new_release = format_release(releases[0])
|
|
81
|
+
|
|
82
|
+
# Check if this release already exists in the changelog
|
|
83
|
+
release_tag = releases[0]["tag_name"]
|
|
84
|
+
if re.search(rf"## .*{re.escape(release_tag)}.*?\(", content):
|
|
85
|
+
print(f"Release {release_tag} already exists in the changelog. Skipping update.")
|
|
86
|
+
return
|
|
87
|
+
|
|
88
|
+
# Insert the new release after the header
|
|
89
|
+
new_content = re.sub(r"(# Changelog\s+.*?)(\s*##)", f"\\1{new_release}\\2", content, count=1, flags=re.DOTALL)
|
|
90
|
+
|
|
91
|
+
# If the pattern didn't match, append to header
|
|
92
|
+
if new_content == content:
|
|
93
|
+
new_content = header + new_release + content[len(header) :]
|
|
94
|
+
else:
|
|
95
|
+
# Generate new changelog content with all releases
|
|
96
|
+
new_content = header
|
|
97
|
+
for release in releases:
|
|
98
|
+
new_content += format_release(release)
|
|
99
|
+
|
|
100
|
+
# Add a note about pre-release development if it doesn't exist in content
|
|
101
|
+
if "## Pre-release Development" not in content:
|
|
102
|
+
new_content += "## Pre-release Development\n\n"
|
|
103
|
+
new_content += f"For development history prior to the first release, please see the [GitHub commit history](https://github.com/{REPO_OWNER}/{REPO_NAME}/commits/main)."
|
|
104
|
+
else:
|
|
105
|
+
# Extract and add the pre-release section
|
|
106
|
+
pre_release_match = re.search(r"(## Pre-release Development[\s\S]*$)", content)
|
|
107
|
+
if pre_release_match:
|
|
108
|
+
new_content += pre_release_match.group(1)
|
|
109
|
+
|
|
110
|
+
# Write updated changelog
|
|
111
|
+
with open(CHANGELOG_PATH, "w", encoding="utf-8") as f:
|
|
112
|
+
f.write(new_content)
|
|
113
|
+
|
|
114
|
+
print(f"Updated {CHANGELOG_PATH} with {len(releases)} releases.")
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def fetch_release_by_tag(tag_name):
|
|
118
|
+
"""Fetch a specific release by its tag name"""
|
|
119
|
+
headers = {}
|
|
120
|
+
if GITHUB_TOKEN:
|
|
121
|
+
headers["Authorization"] = f"token {GITHUB_TOKEN}"
|
|
122
|
+
|
|
123
|
+
url = f"https://api.github.com/repos/{REPO_OWNER}/{REPO_NAME}/releases/tags/{tag_name}"
|
|
124
|
+
response = requests.get(url, headers=headers, timeout=30) # 30 seconds timeout
|
|
125
|
+
|
|
126
|
+
if response.status_code != 200:
|
|
127
|
+
print(f"Failed to fetch release with tag '{tag_name}': {response.status_code}")
|
|
128
|
+
print(response.text)
|
|
129
|
+
sys.exit(1)
|
|
130
|
+
|
|
131
|
+
return response.json()
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def main():
|
|
135
|
+
parser = argparse.ArgumentParser(description="Update the changelog with GitHub release information")
|
|
136
|
+
parser.add_argument("--release-tag", type=str, help="Update the changelog with only this specific release tag")
|
|
137
|
+
args = parser.parse_args()
|
|
138
|
+
|
|
139
|
+
if args.release_tag:
|
|
140
|
+
# Get a specific release by tag name
|
|
141
|
+
release = fetch_release_by_tag(args.release_tag)
|
|
142
|
+
releases = [release]
|
|
143
|
+
else:
|
|
144
|
+
# Get all releases
|
|
145
|
+
releases = fetch_releases()
|
|
146
|
+
if not releases:
|
|
147
|
+
print("No releases found.")
|
|
148
|
+
return
|
|
149
|
+
# Sort releases by published date (newest first)
|
|
150
|
+
releases.sort(key=lambda r: r["published_at"], reverse=True)
|
|
151
|
+
|
|
152
|
+
update_changelog(releases)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
if __name__ == "__main__":
|
|
156
|
+
main()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "lean-interact"
|
|
3
|
-
version = "0.6.
|
|
3
|
+
version = "0.6.3"
|
|
4
4
|
description = "LeanInteract is a Python package that allows you to interact with the Lean theorem prover."
|
|
5
5
|
keywords = ["Lean", "theorem proving", "autoformalization", "REPL"]
|
|
6
6
|
license = { file = "LICENSE" }
|
|
@@ -14,7 +14,7 @@ dependencies = [
|
|
|
14
14
|
"psutil>=6.1.0",
|
|
15
15
|
"pydantic>=2.11.1",
|
|
16
16
|
"requests>=2.32.3",
|
|
17
|
-
"rich>=13.9.4"
|
|
17
|
+
"rich>=13.9.4"
|
|
18
18
|
]
|
|
19
19
|
|
|
20
20
|
[build-system]
|
|
@@ -22,7 +22,7 @@ logger.addHandler(handler)
|
|
|
22
22
|
ROOT_DIR = Path(__file__).resolve().parent
|
|
23
23
|
DEFAULT_CACHE_DIR = ROOT_DIR / "cache"
|
|
24
24
|
DEFAULT_REPL_GIT_URL = "https://github.com/augustepoiroux/repl"
|
|
25
|
-
DEFAULT_REPL_VERSION = "v1.0.
|
|
25
|
+
DEFAULT_REPL_VERSION = "v1.0.11"
|
|
26
26
|
|
|
27
27
|
os.makedirs(DEFAULT_CACHE_DIR, exist_ok=True)
|
|
28
28
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lean_interact-0.6.1 → lean_interact-0.6.3}/examples/proof_generation_and_autoformalization.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|