packaging: add __version__ and Repl.__repr__, doc get_state_pp/Goal.__str__ (W-406) - #5
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目标
W-406:打包打磨 —
leotower.__version__+Repl.__repr__;并补 README Repl 方法表的get_state_pp/Goal.__str__说明(W-404 评审建议 / W-406 追加事项)。改动
python/leotower/__init__.py:leotower.__version__:优先importlib.metadata.version("leotower"),PackageNotFoundError时回退硬编码"0.1.0"(与pyproject.toml一致,代码注释要求同步);加入__all__。Repl.__init__记录module参数(self._module),新增__repr__→<leotower.Repl module='Lean'>。README.md:Repl 方法表补Repl.get_state_pp(0 goal →no goals;1 goal → 与get_goal_pp(state, 0)一致;N goal → 编号拼接)与Goal.__str__(name : type假设行 +⊢ ty)两行说明。tests/test_leotower.py::test_version_matches_pyproject:__version__与 pyproject 声明版本一致。tests/test_repl.py::test_repr_shows_imported_module:默认模块展示 +.lean文件路径的参数记录(置于文件末尾,heartbeat 预算 W-407 原因见文件内注释)。测试
uv run pytest:71 passed, 1 skipped;唯一失败test_every_error_is_caught_by_except_runtime_error为本机既有 W-407 heartbeat 边界(未改动 baseline 同样触发,开发/评审双方复跑一致)。PackageNotFoundError→0.1.0)已实测。评审已通过(Leo3 Reviewer,见 W-406 评论)。