src/fromager/sources.py has 43% 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(), prepare_new_source(), validate_sdist_filename(), scan_compiled_extensions(), _download_source_check() (partial)
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) |
download_git_source() |
226 |
Git clone with ref/tag handling |
download_url() |
296 |
HTTP download with retry and temp file handling |
unpack_source() |
387 |
Tarball extraction |
write_build_meta() |
479 |
Build metadata serialization |
read_build_meta() |
499 |
Build metadata deserialization |
prepare_source() |
507 |
Source preparation dispatcher (mocked in other tests but never directly tested) |
default_prepare_source() |
559 |
Dependency preparation |
build_sdist() |
619 |
SDist build dispatcher |
default_build_sdist() |
683 |
Default sdist build |
pep517_build_sdist() |
723 |
PEP 517 sdist building |
ensure_pkg_info() |
756 |
PKG-INFO validation |
Acceptance Criteria
src/fromager/sources.pyhas 43% 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(),prepare_new_source(),validate_sdist_filename(),scan_compiled_extensions(),_download_source_check()(partial)Scope -- Untested Functions
get_source_type()download_source()download_git_source()download_url()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 corrupt 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