fix(claude-md): unify version source for outdated hint + stderr (#161) - #163
Merged
Conversation
check_outdated compared against importlib.metadata (stale under editable installs, dist-info baked at install time) while the hint print used module __version__ — a fresh CLAUDE.md triggered a self-contradictory "v0.35.1 vs v0.35.1, run update" hint. Now both use the module's __version__ resolver (source pyproject first, same as --version), and the startup hint prints to stderr so --output json stdout stays parseable (once made 21 CLI JSON tests fail red on a stale venv).
Updated by post-commit hook. Update level: affected
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.
Closes #161
两处修复
_get_current_version弃用自己的 importlib-first 查询,改用模块既有__version__resolver(source pyproject 优先——与--version同源,editable install 下 dist-info 陈旧也不受影响)。同版本 CLAUDE.md 不再触发自相矛盾的 "v0.35.1 vs v0.35.1, run update" hintConsole(stderr=True)):--output json消费方可直接json.loadsstdout(曾在 stale venv 上造成 21 个 CLI JSON 测试假红)验证
TestVersionSourceConsistency——同源断言、stale dist-info 不泄漏(patch importlib 返回 0.0.1)、fresh CLAUDE.md 不被 flag、hint 在 stderr备注
模块
__init__._resolve_version早已为--version解决过同一 stale dist-info 问题(含 rationale docstring);claude_md.py是漏网的第二实现。本次统一后全仓单一版本源。