src/fromager/sources.py has 44% unit test coverage. This module is the backbone of fromager's source acquisition and preparation pipeline -- every package processed flows through these functions.
Functions that already have dedicated unit tests:
resolve_source(), patch_source(), validate_sdist_filename(), scan_compiled_extensions(), _download_source_check() (partial), default_download_source(), prepare_new_source()
Scope -- Untested Functions
| Function |
Lines |
Role |
get_source_type() |
45 |
Classifies source as SDIST/GIT/OVERRIDE |
download_source() |
60 |
Main download dispatcher (mocked in other tests but never directly tested) |
get_source_provider() |
126 |
Creates resolver provider from package settings and overrides |
download_git_source() |
235 |
Git clone with ref/tag/submodule handling |
download_url() |
305 |
HTTP download with retry and temp file handling |
_takes_arg() |
391 |
Checks if a callable accepts a given argument name |
unpack_source() |
396 |
Tarball/zip extraction and directory normalization |
write_build_meta() |
488 |
Build metadata serialization |
read_build_meta() |
508 |
Build metadata deserialization |
prepare_source() |
516 |
Source preparation dispatcher (mocked in other tests but never directly tested) |
default_prepare_source() |
568 |
Default source preparation with compiled-extension scan |
build_sdist() |
628 |
SDist build dispatcher |
default_build_sdist() |
692 |
Default sdist build |
pep517_build_sdist() |
732 |
PEP 517 sdist building |
ensure_pkg_info() |
765 |
PKG-INFO stub creation |
Acceptance Criteria
src/fromager/sources.pyhas 44% unit test coverage. This module is the backbone of fromager's source acquisition and preparation pipeline -- every package processed flows through these functions.Functions that already have dedicated unit tests:
resolve_source(),patch_source(),validate_sdist_filename(),scan_compiled_extensions(),_download_source_check()(partial),default_download_source(),prepare_new_source()Scope -- Untested Functions
get_source_type()download_source()get_source_provider()download_git_source()download_url()_takes_arg()unpack_source()write_build_meta()read_build_meta()prepare_source()default_prepare_source()build_sdist()default_build_sdist()pep517_build_sdist()ensure_pkg_info()Acceptance Criteria
get_source_type()-- test dispatch for sdist URLs, git URLs, and override settingsdownload_source()-- test git URL parsing (url@refformat) and dispatch pathsunpack_source()-- test extraction success, directory renaming, and invalid archive error handlingwrite_build_meta()/read_build_meta()-- test round-trip serializationprepare_source()-- test plugin return handling (Path vs tuple)ensure_pkg_info()-- test stub creation when PKG-INFO is missingbuild_sdist()-- test validation logic with mocked build environment