fix(release-python): __version__ をファイル直接 grep で読む(v0.1.0 publish 失敗の修復)#30
Open
aromarious wants to merge 1 commit into
Open
fix(release-python): __version__ をファイル直接 grep で読む(v0.1.0 publish 失敗の修復)#30aromarious wants to merge 1 commit into
aromarious wants to merge 1 commit into
Conversation
…rks pre-sync The Step 13c first publish attempt for python-v0.1.0 failed at the "Verify tag matches package version" step. The step ran `uv run --no-sync python -c "from cao_holidays import __version__"`, but `--no-sync` skips installing the package, so cao_holidays was never importable and the step exited 1 with ModuleNotFoundError. Replace the import-based version read with a direct grep over src/cao_holidays/__init__.py — the same file pyproject.toml's [tool.hatch.version] uses as the source of truth. This makes the verify step work without any sync (faster) and removes the implicit dep on uv install order. The publish itself never ran (failed at verify); PyPI and GitHub Releases are still in the pre-publish state. After this fix lands on main, the python-v0.1.0 tag will be retagged at the new HEAD and pushed again to retry the release. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
概要
Step 13c の初回 PyPI publish (
python-v0.1.0tag push) が "Verify tag matches package version" ステップで失敗した件の修正。失敗ログ
原因
`uv run --no-sync python -c "from cao_holidays import version"` で実行していたが、`--no-sync` は依存 install をスキップするため `cao_holidays` モジュールがインストールされておらず import 不能。
修正
`version` の値は `src/cao_holidays/init.py` がそのまま真の場所(`pyproject.toml` の `[tool.hatch.version] path = "src/cao_holidays/init.py"`)。Python import を経由せずファイル直接 grepで値を取り出す:
```bash
pkg_version=$(grep -E '^version' src/cao_holidays/init.py | sed -E 's/."([^\"]+)"./\1/')
```
これで:
影響範囲
merge 後
python-v0.1.0tag を delete + 新しい main HEAD で retagテスト計画
関連
🤖 Generated with Claude Code