lean-interact 0.3.0__tar.gz → 0.3.1__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.3.0 → lean_interact-0.3.1}/PKG-INFO +1 -1
- {lean_interact-0.3.0 → lean_interact-0.3.1}/pyproject.toml +1 -1
- {lean_interact-0.3.0 → lean_interact-0.3.1}/src/lean_interact/server.py +3 -2
- {lean_interact-0.3.0 → lean_interact-0.3.1}/tests/test_server.py +5 -7
- {lean_interact-0.3.0 → lean_interact-0.3.1}/.devcontainer/devcontainer.json +0 -0
- {lean_interact-0.3.0 → lean_interact-0.3.1}/.github/workflows/ci.yml +0 -0
- {lean_interact-0.3.0 → lean_interact-0.3.1}/.github/workflows/publish-to-pypi.yml +0 -0
- {lean_interact-0.3.0 → lean_interact-0.3.1}/.gitignore +0 -0
- {lean_interact-0.3.0 → lean_interact-0.3.1}/LICENSE +0 -0
- {lean_interact-0.3.0 → lean_interact-0.3.1}/README.md +0 -0
- {lean_interact-0.3.0 → lean_interact-0.3.1}/examples/beq_plus.py +0 -0
- {lean_interact-0.3.0 → lean_interact-0.3.1}/examples/proof_generation_and_autoformalization.py +0 -0
- {lean_interact-0.3.0 → lean_interact-0.3.1}/examples/type_check.py +0 -0
- {lean_interact-0.3.0 → lean_interact-0.3.1}/src/lean_interact/__init__.py +0 -0
- {lean_interact-0.3.0 → lean_interact-0.3.1}/src/lean_interact/config.py +0 -0
- {lean_interact-0.3.0 → lean_interact-0.3.1}/src/lean_interact/interface.py +0 -0
- {lean_interact-0.3.0 → lean_interact-0.3.1}/src/lean_interact/utils.py +0 -0
- {lean_interact-0.3.0 → lean_interact-0.3.1}/tests/test_utils.py +0 -0
- {lean_interact-0.3.0 → lean_interact-0.3.1}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "lean-interact"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.1"
|
|
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" }
|
|
@@ -66,7 +66,7 @@ class LeanServer:
|
|
|
66
66
|
)
|
|
67
67
|
# `stty -icanon` is required to handle arbitrary long inputs in the Lean REPL
|
|
68
68
|
self._proc.sendline("stty -icanon")
|
|
69
|
-
self._proc.sendline(f"lake env {self.config._cache_repl_dir}/.lake/build/bin/repl")
|
|
69
|
+
self._proc.sendline(f"lake env {self.config._cache_repl_dir}/.lake/build/bin/repl || exit")
|
|
70
70
|
|
|
71
71
|
def is_alive(self) -> bool:
|
|
72
72
|
return hasattr(self, "_proc") and self._proc is not None and self._proc.isalive()
|
|
@@ -131,8 +131,9 @@ class LeanServer:
|
|
|
131
131
|
self.kill()
|
|
132
132
|
raise ConnectionAbortedError(
|
|
133
133
|
"The Lean server closed unexpectedly. Possible reasons (not exhaustive):\n"
|
|
134
|
+
"- An uncaught exception in the Lean REPL (for example, an unexistent file has been requested)\n"
|
|
134
135
|
"- Not enough memory and/or compute available\n"
|
|
135
|
-
"-
|
|
136
|
+
"- The cached Lean REPL is corrupted. In this case, clear the cache"
|
|
136
137
|
" using the `clear_cache` (`from pyleanrepl import clear_cache`) method."
|
|
137
138
|
) from e
|
|
138
139
|
|
|
@@ -549,13 +549,11 @@ class TestLeanServer(unittest.TestCase):
|
|
|
549
549
|
# Try to unpickle invalid data
|
|
550
550
|
temp_pickle_file = tempfile.mkstemp(suffix=".olean")[1]
|
|
551
551
|
|
|
552
|
-
#
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
with self.assertRaises(TimeoutError):
|
|
558
|
-
server.run(UnpickleProofState(unpickle_proof_state_from=temp_pickle_file), timeout=5)
|
|
552
|
+
# Try to unpickle invalid data
|
|
553
|
+
with self.assertRaises(ConnectionAbortedError):
|
|
554
|
+
server.run(UnpickleEnvironment(unpickle_env_from=temp_pickle_file))
|
|
555
|
+
with self.assertRaises(ConnectionAbortedError):
|
|
556
|
+
server.run(UnpickleProofState(unpickle_proof_state_from=temp_pickle_file))
|
|
559
557
|
|
|
560
558
|
# delete the temp file
|
|
561
559
|
os.remove(temp_pickle_file)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lean_interact-0.3.0 → lean_interact-0.3.1}/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
|