Move version-less drop reconciliation into the walk, harden the name guards

The shared walk now defers every version-less skip and reconciles after
emit against the final resolution set (request keys, resolved manifest
names, and backend.provides(name) per name), so drop visibility is
correct for every backend by construction instead of by a comment-level
contract, and the arduino backend's duplicate pending_drops pass and its
short-name suppression heuristics are deleted. The provides lambda
applies _is_safe_library_name so an unsafe manifest name is simply not
provided, and the guard also rejects drive-colon names that would
escape the tree on Windows.
This commit is contained in:
J. Nick Koston
2026-08-22 10:46:50 -05:00
parent 735d4076c1
commit 70b8573110
3 changed files with 78 additions and 60 deletions
+32 -2
View File
@@ -620,7 +620,10 @@ def test_versionless_dependency_without_provider_warns(
{"esphome/A": {"name": "A", "dependencies": [{"name": "Hash"}]}},
)
convert_libraries([Library("esphome/A", None, None)], _backend())
assert "'Hash' of esphome/A has no version to resolve" in caplog.text
assert (
"Hash of esphome/A has no version to resolve and nothing provides it"
in caplog.text
)
def test_walk_warns_for_nonplatform_invalid_library(
@@ -678,4 +681,31 @@ def test_versionless_url_ish_dependency_name_warns_cleanly(
{"esphome/A": {"name": "A", "dependencies": [{"name": "file://"}]}},
)
convert_libraries([Library("esphome/A", None, None)], _backend())
assert "'file://' of esphome/A has no version to resolve" in caplog.text
assert (
"file:// of esphome/A has no version to resolve and nothing provides it"
in caplog.text
)
def test_versionless_dependency_matching_resolved_manifest_name_stays_quiet(
tmp_path, monkeypatch, caplog: pytest.LogCaptureFixture
) -> None:
"""A bare dependency name satisfied by a component requested under an
owner-qualified spec (manifest names match) is not a drop; a nameless
entry is skipped without a reconciliation warning."""
_patch_download_with_manifests(
monkeypatch,
tmp_path,
{
"esphome/A": {
"name": "A",
"dependencies": [{"name": "B"}, {"version": "1.0"}],
},
"esphome/B": {"name": "B"},
},
)
convert_libraries(
[Library("esphome/A", None, None), Library("esphome/B", None, None)],
_backend(),
)
assert "has no version to resolve" not in caplog.text