lean-interact 0.10.2__tar.gz → 0.10.4__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.10.2 → lean_interact-0.10.4}/PKG-INFO +1 -1
- {lean_interact-0.10.2 → lean_interact-0.10.4}/pyproject.toml +1 -1
- {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/config.py +4 -3
- {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/project.py +6 -4
- {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/utils.py +4 -4
- {lean_interact-0.10.2 → lean_interact-0.10.4}/.devcontainer/devcontainer.json +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/.github/copilot-instructions.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/.github/workflows/ci.yml +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/.github/workflows/docs.yml +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/.github/workflows/publish-to-pypi.yml +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/.gitignore +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/LICENSE +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/README.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/.nojekyll +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/api/config.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/api/interface.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/api/project.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/api/server.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/api/sessioncache.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/api/utils.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/contributing.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/generate_changelog.py +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/index.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/theme/main.html +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/basic-usage.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/custom-lean-configuration.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/data-extraction.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/examples.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/getting-started.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/installation.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/performance.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/set-options.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/tactic-mode.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/troubleshooting.md +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/examples/beq_plus.py +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/examples/extract_mathlib_decls.py +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/examples/parallelization.py +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/examples/proof_generation_and_autoformalization.py +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/examples/type_check.py +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/mkdocs.yml +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/__init__.py +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/interface.py +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/py.typed +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/server.py +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/sessioncache.py +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/tests/test_concurrency.py +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/tests/test_git_functionality.py +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/tests/test_server.py +0 -0
- {lean_interact-0.10.2 → lean_interact-0.10.4}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "lean-interact"
|
|
3
|
-
version = "0.10.
|
|
3
|
+
version = "0.10.4"
|
|
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" }
|
|
@@ -77,7 +77,7 @@ class LeanREPLConfig:
|
|
|
77
77
|
When provided, the REPL will not be downloaded from the git repository.
|
|
78
78
|
This is particularly useful during REPL development.
|
|
79
79
|
build_repl:
|
|
80
|
-
Whether to build the
|
|
80
|
+
Whether to build the REPL. Can be set to False if the REPL is already built (e.g., when using a local REPL path or using an already cached REPL).
|
|
81
81
|
lake_path:
|
|
82
82
|
The path to the lake executable. Default is "lake", which assumes it is in the system PATH.
|
|
83
83
|
memory_hard_limit_mb:
|
|
@@ -158,7 +158,8 @@ class LeanREPLConfig:
|
|
|
158
158
|
self._build_repl()
|
|
159
159
|
else:
|
|
160
160
|
self._prepare_git_repl()
|
|
161
|
-
self.
|
|
161
|
+
if self.build_repl:
|
|
162
|
+
self._build_repl()
|
|
162
163
|
|
|
163
164
|
def _prepare_local_repl(self) -> None:
|
|
164
165
|
"""Prepare a local REPL."""
|
|
@@ -391,7 +392,7 @@ class LeanREPLConfig:
|
|
|
391
392
|
|
|
392
393
|
def _build_repl(self) -> None:
|
|
393
394
|
"""Build the REPL."""
|
|
394
|
-
check_lake(self.lake_path)
|
|
395
|
+
check_lake(self.lake_path, verbose=self.verbose)
|
|
395
396
|
|
|
396
397
|
try:
|
|
397
398
|
# Capture build output so failures can be diagnosed
|
|
@@ -63,7 +63,7 @@ class BaseProject:
|
|
|
63
63
|
_lock: (internal parameter) Whether to acquire a file lock (should be False if already locked by caller).
|
|
64
64
|
"""
|
|
65
65
|
directory = Path(self.get_directory())
|
|
66
|
-
check_lake(self.lake_path)
|
|
66
|
+
check_lake(self.lake_path, verbose=verbose)
|
|
67
67
|
|
|
68
68
|
def _do_build():
|
|
69
69
|
stdout = None if verbose else subprocess.DEVNULL
|
|
@@ -182,7 +182,8 @@ class GitProject(BaseProject):
|
|
|
182
182
|
self._update_existing_repo()
|
|
183
183
|
else:
|
|
184
184
|
self._clone_new_repo()
|
|
185
|
-
self.
|
|
185
|
+
if self.auto_build:
|
|
186
|
+
self.build(_lock=False)
|
|
186
187
|
except Exception as e:
|
|
187
188
|
logger.error("Failed to instantiate git project at %s: %s", directory, e)
|
|
188
189
|
raise
|
|
@@ -328,9 +329,10 @@ class BaseTempProject(BaseProject):
|
|
|
328
329
|
|
|
329
330
|
logger.info("Preparing Lean environment with dependencies (may take a while the first time)...")
|
|
330
331
|
|
|
331
|
-
# Use the inherited
|
|
332
|
+
# Use the inherited build method with update=True
|
|
332
333
|
try:
|
|
333
|
-
self.
|
|
334
|
+
if self.auto_build:
|
|
335
|
+
self.build(verbose=self.verbose, update=True, _lock=False)
|
|
334
336
|
except subprocess.CalledProcessError as e:
|
|
335
337
|
logger.error("Failed during Lean project setup: %s", e)
|
|
336
338
|
# delete the project directory to avoid conflicts
|
|
@@ -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.3.
|
|
25
|
+
DEFAULT_REPL_VERSION = "v1.3.11"
|
|
26
26
|
|
|
27
27
|
os.makedirs(DEFAULT_CACHE_DIR, exist_ok=True)
|
|
28
28
|
|
|
@@ -85,7 +85,7 @@ def get_project_lean_version(project_dir: str | PathLike) -> str | None:
|
|
|
85
85
|
return None
|
|
86
86
|
|
|
87
87
|
|
|
88
|
-
def check_lake(lake_path: str | PathLike) -> None:
|
|
88
|
+
def check_lake(lake_path: str | PathLike, verbose: bool = False) -> None:
|
|
89
89
|
"""
|
|
90
90
|
Check if the lake executable is available and can be executed.
|
|
91
91
|
"""
|
|
@@ -94,8 +94,8 @@ def check_lake(lake_path: str | PathLike) -> None:
|
|
|
94
94
|
try:
|
|
95
95
|
result = subprocess.run(
|
|
96
96
|
[str(lake_path), "--version"],
|
|
97
|
-
stdout=subprocess.PIPE,
|
|
98
|
-
stderr=subprocess.PIPE,
|
|
97
|
+
stdout=None if verbose else subprocess.PIPE,
|
|
98
|
+
stderr=None if verbose else subprocess.PIPE,
|
|
99
99
|
text=True,
|
|
100
100
|
)
|
|
101
101
|
except FileNotFoundError as e:
|
|
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
|
|
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.10.2 → lean_interact-0.10.4}/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
|
|
File without changes
|