lean-interact 0.6.1__tar.gz → 0.6.2__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.
Files changed (41) hide show
  1. {lean_interact-0.6.1 → lean_interact-0.6.2}/PKG-INFO +2 -2
  2. {lean_interact-0.6.1 → lean_interact-0.6.2}/README.md +1 -1
  3. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/changelog.md +10 -0
  4. lean_interact-0.6.2/docs/update_changelog.py +156 -0
  5. {lean_interact-0.6.1 → lean_interact-0.6.2}/pyproject.toml +1 -1
  6. {lean_interact-0.6.1 → lean_interact-0.6.2}/src/lean_interact/utils.py +1 -1
  7. {lean_interact-0.6.1 → lean_interact-0.6.2}/uv.lock +1 -1
  8. {lean_interact-0.6.1 → lean_interact-0.6.2}/.devcontainer/devcontainer.json +0 -0
  9. {lean_interact-0.6.1 → lean_interact-0.6.2}/.github/workflows/ci.yml +0 -0
  10. {lean_interact-0.6.1 → lean_interact-0.6.2}/.github/workflows/docs.yml +0 -0
  11. {lean_interact-0.6.1 → lean_interact-0.6.2}/.github/workflows/publish-to-pypi.yml +0 -0
  12. {lean_interact-0.6.1 → lean_interact-0.6.2}/.github/workflows/update-changelog.yml +0 -0
  13. {lean_interact-0.6.1 → lean_interact-0.6.2}/.gitignore +0 -0
  14. {lean_interact-0.6.1 → lean_interact-0.6.2}/LICENSE +0 -0
  15. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/.nojekyll +0 -0
  16. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/api/config.md +0 -0
  17. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/api/interface.md +0 -0
  18. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/api/server.md +0 -0
  19. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/api/sessioncache.md +0 -0
  20. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/api/utils.md +0 -0
  21. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/contributing.md +0 -0
  22. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/examples.md +0 -0
  23. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/index.md +0 -0
  24. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/installation.md +0 -0
  25. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/troubleshooting.md +0 -0
  26. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/user-guide/basic-usage.md +0 -0
  27. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/user-guide/custom-lean-configuration.md +0 -0
  28. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/user-guide/getting-started.md +0 -0
  29. {lean_interact-0.6.1 → lean_interact-0.6.2}/docs/user-guide/tactic-mode.md +0 -0
  30. {lean_interact-0.6.1 → lean_interact-0.6.2}/examples/beq_plus.py +0 -0
  31. {lean_interact-0.6.1 → lean_interact-0.6.2}/examples/proof_generation_and_autoformalization.py +0 -0
  32. {lean_interact-0.6.1 → lean_interact-0.6.2}/examples/type_check.py +0 -0
  33. {lean_interact-0.6.1 → lean_interact-0.6.2}/mkdocs.yml +0 -0
  34. {lean_interact-0.6.1 → lean_interact-0.6.2}/src/lean_interact/__init__.py +0 -0
  35. {lean_interact-0.6.1 → lean_interact-0.6.2}/src/lean_interact/config.py +0 -0
  36. {lean_interact-0.6.1 → lean_interact-0.6.2}/src/lean_interact/interface.py +0 -0
  37. {lean_interact-0.6.1 → lean_interact-0.6.2}/src/lean_interact/server.py +0 -0
  38. {lean_interact-0.6.1 → lean_interact-0.6.2}/src/lean_interact/sessioncache.py +0 -0
  39. {lean_interact-0.6.1 → lean_interact-0.6.2}/tests/test_concurrency.py +0 -0
  40. {lean_interact-0.6.1 → lean_interact-0.6.2}/tests/test_server.py +0 -0
  41. {lean_interact-0.6.1 → lean_interact-0.6.2}/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.1
3
+ Version: 0.6.2
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.21.0-rc3`.
54
+ - **🔧 Compatibility**: Supports all Lean versions between `v4.7.0-rc1` and `v4.21.0`.
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.21.0-rc3`.
16
+ - **🔧 Compatibility**: Supports all Lean versions between `v4.7.0-rc1` and `v4.21.0`.
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,6 +2,16 @@
2
2
 
3
3
  This page documents the notable changes to LeanInteract.
4
4
 
5
+ ## v0.6.1 (June 24, 2025)
6
+
7
+ ## What's Changed
8
+
9
+ * Fix Lean version inference for `LocalProject` and `GitProject` by @augustepoiroux in <https://github.com/augustepoiroux/LeanInteract/pull/26>
10
+ * Fix `ResourceWarning` issues when killing the REPL
11
+ * Improve memory monitoring in `AutoLeanServer`
12
+
13
+ **Full Changelog**: <https://github.com/augustepoiroux/LeanInteract/compare/v0.6.0...v0.6.1>
14
+
5
15
  ## v0.6.0 (June 05, 2025)
6
16
 
7
17
  ## What's Changed
@@ -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.1"
3
+ version = "0.6.2"
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" }
@@ -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.9"
25
+ DEFAULT_REPL_VERSION = "v1.0.10"
26
26
 
27
27
  os.makedirs(DEFAULT_CACHE_DIR, exist_ok=True)
28
28
 
@@ -540,7 +540,7 @@ wheels = [
540
540
 
541
541
  [[package]]
542
542
  name = "lean-interact"
543
- version = "0.6.0"
543
+ version = "0.6.2"
544
544
  source = { editable = "." }
545
545
  dependencies = [
546
546
  { name = "filelock" },
File without changes
File without changes
File without changes