Repository navigation
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Goal
Redesign resolve_from_provider and sdist handling to simplify default path and support VCS urls. The current API was designed and implemented before we encountered projects that need VCS download and git submodules.
current design
resolve_from_provider()/resolve_source()returns an URL to a tar.gz file and versiondownload_source()downloads the tar.gz fileprepare_sourceunpacks and modifies the sources (applies patches and modifiations)build_sdisteither repacks the sources as tar.gz or calls PEP 517 hook to build to create a tar.gz bundle
The current API has several flaws:
- Fromager unpacks and repacks all sdists. In majority of cases, there is no need to unpack the tar.gz and repack it again. Unpacking and repacking is only necessary when Fromager has patches, a non-default
prepare_sourcehook, or project overrides. download_sourcehas to return a path to a local file tar.gz andprepare_sourceexpects a tar.gz file. This design does not work well for VCS checkouts. Some build backends expect a full git checkout, sobuild_sdistneeds to have.gitdirectory.- The GitLab and GitHub tag provider return an URL to a git tar bundle. The tar bundle does not work if the project uses git submodules or the build backend (e.g.
setuptools-scm) expects a.gitdirectory.
redesign proposal
- change the resolver API to return a rich object (dataclass) instead of just an URL to a tar.gz and version. The rich object holds
req: Requirement,version: Version,url: str, url type (tar, git, ...), and a VCS tag/ref/revision argument. - change or replace
download_source,prepare_source,build_sdist, so Fromager can deal with four different cases:- sdist
tar.gzwithout modifications - sdist
tar.gzwith patches, project overrides, and/or modifications - VCS url, project supports
pep517_build_sdist - VCS url, project does not support PEP 517 sdist (e.g. PyArrow)
- sdist
Maybe we only need one or two hooks to get from resolver result to an sdist?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity
dhellmann commentedon Sep 22, 2025
This lines up with some other changes I was talking with @lcarva about earlier today that would separate the way sources are handled during bootstrapping from how they are handled in the build job. We still have the build job calling plugins to get source instead of using the available source distribution. He is going to write up a feature request to separate the bootstrap and source acquisition steps, and some of the changes described in this issue could be part of that same refactoring.
lcarva commentedon Sep 29, 2025
FYI, I filed #797 to capture what @dhellmann mentioned above.
mprpic commentedon Nov 5, 2026
Closing as done: the
source:configuration from #1414 covers this redesign. Source providers can download archives or do git checkouts, andbuild_sdistselects PEP 517 or tarball. Remaining follow-ups are tracked in their own issues.If you feel this change is still needed, feel free to reopen this issue. Thank you!