tools: Let scan_for_updates.py read a local PackageInfo.g - #1488
Merged
Conversation
Trying out a package update so far required a release to exist: the metadata was always downloaded from the PackageInfoURL. An argument that is a path -- either a directory holding a PackageInfo.g, or that file itself -- is now read from disk instead, so that a package author can see what the distribution will make of an update before publishing it. Arguments naming a package of the distribution keep their meaning, including the "packages/NAME" and "packages/NAME/meta.json" forms that are paths on disk as well. Names and paths cannot be mixed, and a path that does not exist, or a directory without a PackageInfo.g, is reported as such rather than being taken for a package name. Fixes #1024 Co-authored-by: Claude Opus 5 <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.
Allow passing a path to a local package instead of a package name:
The path may be either the directory holding the
PackageInfo.g, or thatfile itself. Its metadata is then read from disk rather than downloaded
from the
PackageInfoURL, so that a package author can see what thedistribution will make of an update before publishing it.
Arguments naming a package of the distribution keep their meaning. That
needs a little care, because the
packages/NAMEandpackages/NAME/meta.jsonforms thatnormalize_pkg_nameaccepts arepaths on disk as well: an argument is therefore only treated as a local
package once it turns out not to name a package of the distribution.
Names and paths cannot be mixed. A path that does not exist, and a
directory without a
PackageInfo.g, are reported as such instead ofbeing taken for a package name -- the latter only for arguments with a
directory part, so that a mistyped package name still produces the usual
error about the missing
meta.json.Note that only the metadata comes from disk. The source archive is still
fetched from
ArchiveURL, so until it is publishedscan_for_updates.pywarns and records
FAILas its checksum, andvalidate_package.pyfailsoutright because it cannot download the archive it is supposed to check.
The README section that used to point at this issue as a known limitation
now documents the new usage, including that caveat.
Fixes #1024
AI disclosure
Claude Code (Claude Opus 5) wrote the change, the tests, and this
description, and is recorded as a co-author on the commit.