Repository navigation
fetch: skip a lock entry the host provides (#2) - #19
Merged
Merged
Conversation
RED: parse_lock rejects the "optional" field, so an entry that says the host provides its tool cannot be read, and fetch has no skip. Both new tests fail on main (deps.lock.json.tools[1].sha256: missing).
An entry may now say "optional": true (no sha256, no install path): the host provides that tool (a distro Qt or FFmpeg at a suitable version), so fetch prints the skip and installs the rest. An entry without the flag still needs both fields. GREEN: model.LockedTool.optional and the fetch skip in cli; pytest 23 passed, ruff check clean.
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.
Part 2 of #2 (part 1, concurrent downloads, landed in #12).
What
A lock entry may now say the host provides its tool:
{ "tool": "qt6", "version": "6.11.1", "platform": { ... }, "variant": {}, "optional": true }Such an entry pins no bytes and no install path — the host supplies a copy at a suitable version (a distro's Qt or FFmpeg).
obs-studio-libs fetch --lockprints the skip and installs the remaining pins:An entry without the flag still requires
sha256andinstall(only the two fields are relaxed, and only for a provided entry; unknown fields still fail, as before).RED
03cbb10—tests/test_fetch.py:parse_lockrejects the unknown"optional"field, so a provided entry cannot be read, andfetchhas no skip.GREEN
61fef3d—model.LockedTool.optional(strict boolean field,_Obj.flag) plus the skip incli.py's fetch path:The CLI test drives the real
fetchpath over the existingFakeOpener: the ordinary pin installs, the provided tool's archive is never requested, its install directory is absent, and the skip is printed.Note
No consumer in this repo sets the flag yet;
obs-studio'sbuild-aux/appimage/manylinux/deps.lock.jsonis unchanged by this PR (a separate repo). No behavior changes for a lock that does not use the field.Refs #2.