Keep local .git paths with pio run

This commit is contained in:
J. Nick Koston
2026-08-31 16:49:39 -04:00
parent 8582bf194a
commit fa5180bd51
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -384,11 +384,11 @@ def _is_vcs_spec_uri(url: str | None) -> bool:
copy or download it (PackageSpec normalizes git URLs to ``git+``).
The .git check runs first so an un-normalized repo URL degrades to a
failed clone and pio run, never an archive download of a repo page."""
if not url:
if not url or url.startswith(("file://", "symlink://")):
return False
if url.split("#", 1)[0].endswith(".git"):
return True
if url.startswith(("file://", "symlink://", "http://", "https://")):
if url.startswith(("http://", "https://")):
return False
return url.startswith(_VCS_URI_PREFIXES)
@@ -632,6 +632,8 @@ def test_uri_jobs_vcs_specs_installable_without_probe(tmp_path: Path) -> None:
# downloadable archive), then drops here as derived-name
_FakeSpec(uri="https://x/unnorm.git", name="unnorm"),
_FakeSpec(uri="file:///local/dir", name="local"),
# A local .git path is copied in place, never cloned
_FakeSpec(uri="file:///local/repo.git", name="localgit"),
_FakeSpec(uri="symlink:///local/dir", name="link"),
],
set(),