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.
Files changed (50) hide show
  1. {lean_interact-0.10.2 → lean_interact-0.10.4}/PKG-INFO +1 -1
  2. {lean_interact-0.10.2 → lean_interact-0.10.4}/pyproject.toml +1 -1
  3. {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/config.py +4 -3
  4. {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/project.py +6 -4
  5. {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/utils.py +4 -4
  6. {lean_interact-0.10.2 → lean_interact-0.10.4}/.devcontainer/devcontainer.json +0 -0
  7. {lean_interact-0.10.2 → lean_interact-0.10.4}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  8. {lean_interact-0.10.2 → lean_interact-0.10.4}/.github/copilot-instructions.md +0 -0
  9. {lean_interact-0.10.2 → lean_interact-0.10.4}/.github/workflows/ci.yml +0 -0
  10. {lean_interact-0.10.2 → lean_interact-0.10.4}/.github/workflows/docs.yml +0 -0
  11. {lean_interact-0.10.2 → lean_interact-0.10.4}/.github/workflows/publish-to-pypi.yml +0 -0
  12. {lean_interact-0.10.2 → lean_interact-0.10.4}/.gitignore +0 -0
  13. {lean_interact-0.10.2 → lean_interact-0.10.4}/LICENSE +0 -0
  14. {lean_interact-0.10.2 → lean_interact-0.10.4}/README.md +0 -0
  15. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/.nojekyll +0 -0
  16. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/api/config.md +0 -0
  17. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/api/interface.md +0 -0
  18. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/api/project.md +0 -0
  19. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/api/server.md +0 -0
  20. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/api/sessioncache.md +0 -0
  21. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/api/utils.md +0 -0
  22. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/contributing.md +0 -0
  23. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/generate_changelog.py +0 -0
  24. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/index.md +0 -0
  25. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/theme/main.html +0 -0
  26. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/basic-usage.md +0 -0
  27. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/custom-lean-configuration.md +0 -0
  28. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/data-extraction.md +0 -0
  29. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/examples.md +0 -0
  30. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/getting-started.md +0 -0
  31. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/installation.md +0 -0
  32. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/performance.md +0 -0
  33. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/set-options.md +0 -0
  34. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/tactic-mode.md +0 -0
  35. {lean_interact-0.10.2 → lean_interact-0.10.4}/docs/user-guide/troubleshooting.md +0 -0
  36. {lean_interact-0.10.2 → lean_interact-0.10.4}/examples/beq_plus.py +0 -0
  37. {lean_interact-0.10.2 → lean_interact-0.10.4}/examples/extract_mathlib_decls.py +0 -0
  38. {lean_interact-0.10.2 → lean_interact-0.10.4}/examples/parallelization.py +0 -0
  39. {lean_interact-0.10.2 → lean_interact-0.10.4}/examples/proof_generation_and_autoformalization.py +0 -0
  40. {lean_interact-0.10.2 → lean_interact-0.10.4}/examples/type_check.py +0 -0
  41. {lean_interact-0.10.2 → lean_interact-0.10.4}/mkdocs.yml +0 -0
  42. {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/__init__.py +0 -0
  43. {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/interface.py +0 -0
  44. {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/py.typed +0 -0
  45. {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/server.py +0 -0
  46. {lean_interact-0.10.2 → lean_interact-0.10.4}/src/lean_interact/sessioncache.py +0 -0
  47. {lean_interact-0.10.2 → lean_interact-0.10.4}/tests/test_concurrency.py +0 -0
  48. {lean_interact-0.10.2 → lean_interact-0.10.4}/tests/test_git_functionality.py +0 -0
  49. {lean_interact-0.10.2 → lean_interact-0.10.4}/tests/test_server.py +0 -0
  50. {lean_interact-0.10.2 → lean_interact-0.10.4}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lean-interact
3
- Version: 0.10.2
3
+ Version: 0.10.4
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lean-interact"
3
- version = "0.10.2"
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 local REPL before running it. This option is ignored when `local_repl_path` is not provided.
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._build_repl()
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.build(_lock=False)
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 _build_project method with update=True
332
+ # Use the inherited build method with update=True
332
333
  try:
333
- self.build(verbose=self.verbose, update=True, _lock=False)
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.10"
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