Import the other two scripts rather than load them by hand - #168
Merged
Conversation
The store copy script reached the listing and the changelog by opening those files and running them, because neither was named something Python can say. Both are renamed. The changelog reader moves out of the workflow folder while we are here, and the version reader with it, so every script sits in one place and a script that needs another one is simply next to it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E6tn8P25cBDmrA67zrhfwN
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.
store-copy.pyreached two other scripts by opening them and running themthrough
importlib, because a hyphen is not something Python can import:Both are renamed, and the
loadhelper is gone:Running a script puts its own directory first on the import path, so a plain
import finds a sibling with nothing set from outside. That only works if the
sibling is actually there, so
changelog-section.pymoves out of.github/scripts- the release workflow was its only reader when it was filedwith the workflows, and
store-copy.pywrites the store text out of the samesection.
resolve-version.pyfollows it so the folder goes rather than keepingone file, and
.github/scriptsno longer exists.Underscores are for the three files something imports; the scripts that are only
ever run keep their hyphens.
Not changed
No behaviour anywhere - every edit is a name, a path, or an import.
Checked
Each script run against 1.40:
changelog_section.pyprints the section,store_listing.pyreports what the release would refuse,resolve-version.pyresolves, and
store-copy.py --helpproves both imports resolve - from therepository root and from
/, since the import path follows the script and notthe working directory. The executable bit survived both moves, which the
workflow needs to run them by path.
scripts/format.shis clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01E6tn8P25cBDmrA67zrhfwN