Skip to content

fetch: skip a lock entry the host provides (#2) - #19

Merged
zackees merged 2 commits into
mainfrom
fetch/2-host-provided-tool
Oct 27, 2026
Merged

zackees merged 2 commits into
mainfrom
fetch/2-host-provided-tool

Conversation

@zackees

@zackees zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member

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 --lock prints the skip and installs the remaining pins:

skipped qt6 6.11.1: optional, the host provides it
qt6-... .tar.zst -> /opt/obs-deps/qt6

An entry without the flag still requires sha256 and install (only the two fields are relaxed, and only for a provided entry; unknown fields still fail, as before).

RED

03cbb10 — tests/test_fetch.py:

$ uv run --group dev pytest -q
FAILED tests/test_fetch.py::test_fetch_skips_the_entry_the_host_provides
FAILED tests/test_fetch.py::test_a_host_provided_entry_is_marked_and_carries_no_bytes
2 failed, 5 passed
obs_studio_libs.model.ManifestError: deps.lock.json.tools[1].sha256: missing

parse_lock rejects the unknown "optional" field, so a provided entry cannot be read, and fetch has no skip.

GREEN

61fef3d — model.LockedTool.optional (strict boolean field, _Obj.flag) plus the skip in cli.py's fetch path:

$ uv run --group dev pytest -q
23 passed in 1.74s
$ uv run --group dev ruff check .
All checks passed!
$ uv run --group dev ruff format --check .
10 files already formatted

The CLI test drives the real fetch path over the existing FakeOpener: 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's build-aux/appimage/manylinux/deps.lock.json is unchanged by this PR (a separate repo). No behavior changes for a lock that does not use the field.

Refs #2.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant