lean-interact 0.3.1__tar.gz → 0.3.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.
- {lean_interact-0.3.1 → lean_interact-0.3.2}/PKG-INFO +1 -1
- {lean_interact-0.3.1 → lean_interact-0.3.2}/pyproject.toml +1 -1
- {lean_interact-0.3.1 → lean_interact-0.3.2}/src/lean_interact/server.py +1 -0
- {lean_interact-0.3.1 → lean_interact-0.3.2}/tests/test_server.py +14 -0
- {lean_interact-0.3.1 → lean_interact-0.3.2}/uv.lock +1 -1
- {lean_interact-0.3.1 → lean_interact-0.3.2}/.devcontainer/devcontainer.json +0 -0
- {lean_interact-0.3.1 → lean_interact-0.3.2}/.github/workflows/ci.yml +0 -0
- {lean_interact-0.3.1 → lean_interact-0.3.2}/.github/workflows/publish-to-pypi.yml +0 -0
- {lean_interact-0.3.1 → lean_interact-0.3.2}/.gitignore +0 -0
- {lean_interact-0.3.1 → lean_interact-0.3.2}/LICENSE +0 -0
- {lean_interact-0.3.1 → lean_interact-0.3.2}/README.md +0 -0
- {lean_interact-0.3.1 → lean_interact-0.3.2}/examples/beq_plus.py +0 -0
- {lean_interact-0.3.1 → lean_interact-0.3.2}/examples/proof_generation_and_autoformalization.py +0 -0
- {lean_interact-0.3.1 → lean_interact-0.3.2}/examples/type_check.py +0 -0
- {lean_interact-0.3.1 → lean_interact-0.3.2}/src/lean_interact/__init__.py +0 -0
- {lean_interact-0.3.1 → lean_interact-0.3.2}/src/lean_interact/config.py +0 -0
- {lean_interact-0.3.1 → lean_interact-0.3.2}/src/lean_interact/interface.py +0 -0
- {lean_interact-0.3.1 → lean_interact-0.3.2}/src/lean_interact/utils.py +0 -0
- {lean_interact-0.3.1 → lean_interact-0.3.2}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "lean-interact"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.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" }
|
|
@@ -64,6 +64,7 @@ class LeanServer:
|
|
|
64
64
|
echo=False,
|
|
65
65
|
preexec_fn=lambda: _limit_memory(self.config.memory_hard_limit_mb),
|
|
66
66
|
)
|
|
67
|
+
self._proc.delaybeforesend = None
|
|
67
68
|
# `stty -icanon` is required to handle arbitrary long inputs in the Lean REPL
|
|
68
69
|
self._proc.sendline("stty -icanon")
|
|
69
70
|
self._proc.sendline(f"lake env {self.config._cache_repl_dir}/.lake/build/bin/repl || exit")
|
|
@@ -411,6 +411,18 @@ class TestLeanServer(unittest.TestCase):
|
|
|
411
411
|
step2 = server.run(ProofStep(tactic="rfl", proof_state=step1.proof_state))
|
|
412
412
|
self.assertEqual(step2, ProofStepResponse(proof_state=2, goals=[]))
|
|
413
413
|
|
|
414
|
+
def test_run_lots_of_commands(self):
|
|
415
|
+
server = LeanServer(LeanREPLConfig(verbose=True))
|
|
416
|
+
|
|
417
|
+
init_env = server.run(Command(cmd="#eval 1"))
|
|
418
|
+
assert isinstance(init_env, CommandResponse)
|
|
419
|
+
for i in range(1000):
|
|
420
|
+
cmd = Command(
|
|
421
|
+
cmd=f"theorem womp{i} (a{i} b c : Nat) : (a{i} + b) + c = c + a{i} + b := by sorry", env=init_env.env
|
|
422
|
+
)
|
|
423
|
+
result = server.run(cmd)
|
|
424
|
+
self.assertIsInstance(result, CommandResponse)
|
|
425
|
+
|
|
414
426
|
def test_bug_increasing_memory(self):
|
|
415
427
|
mem_limit = 512
|
|
416
428
|
server = AutoLeanServer(config=LeanREPLConfig(memory_hard_limit_mb=mem_limit, verbose=True))
|
|
@@ -435,6 +447,8 @@ class TestLeanServer(unittest.TestCase):
|
|
|
435
447
|
result_queue.put(("success", result))
|
|
436
448
|
except TimeoutError as e:
|
|
437
449
|
result_queue.put(("timeout", e))
|
|
450
|
+
except ConnectionAbortedError as e:
|
|
451
|
+
result_queue.put(("connection_aborted", e)) # out of memory
|
|
438
452
|
except Exception as e:
|
|
439
453
|
result_queue.put(("error", e))
|
|
440
454
|
|
|
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.1 → lean_interact-0.3.2}/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
|