Context
PR #1202 wired source_resolver into the resolver and download pipelines. Git-clone-based resolvers (github-tag-git, gitlab-tag-git, pypi-git) now resolve and clone correctly, but the prepare_source and build_sdist steps don't yet handle the cloned directory.
prepare_source crashes on git-clone directories
sources.prepare_source() decides how to prepare source based on req.url:
if req.url:
source_root_dir = pathlib.Path(source_filename)
prepare_new_source(...)
else:
prepare_source_details = overrides.find_and_invoke("prepare_source", default_prepare_source, ...)
When a package uses the new source config with a git-clone-based resolver, req.url is None, so it takes the else path. That calls default_prepare_source() -> unpack_source(), which tries to open source_filename as a .tar.gz or .zip. But source_filename is a directory (the cloned git repo). This crashes with:
ValueError: Do not know how to unpack source archive /path/to/mypackage-1.0
Context
PR #1202 wired
source_resolverinto the resolver and download pipelines. Git-clone-based resolvers (github-tag-git,gitlab-tag-git,pypi-git) now resolve and clone correctly, but theprepare_sourceandbuild_sdiststeps don't yet handle the cloned directory.prepare_sourcecrashes on git-clone directoriessources.prepare_source()decides how to prepare source based onreq.url:When a package uses the new source config with a git-clone-based resolver, req.url is None, so it takes the else path. That calls default_prepare_source() -> unpack_source(), which tries to open source_filename as a .tar.gz or .zip. But source_filename is a directory (the cloned git repo). This crashes with:
ValueError: Do not know how to unpack source archive /path/to/mypackage-1.0