Skip to content

Commit

Permalink
Merge pull request #543 from rd4398/expected-tag-message
Browse files Browse the repository at this point in the history
Add debug message for expected build tag
  • Loading branch information
mergify[bot] authored Feb 6, 2025
2 parents fb341a3 + 338d0ac commit fac7ee6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions e2e/test_bootstrap_constraints.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fi
$pass

EXPECTED_LINES="
pbr==6.1.0
pbr==6.1.1
# ERROR
stevedore==4.0.0
stevedore==5.2.0
Expand All @@ -51,4 +51,4 @@ for pattern in $EXPECTED_LINES; do
fi
done

$pass
$pass
6 changes: 6 additions & 0 deletions src/fromager/bootstrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,12 @@ def _download_wheel_from_cache(
wheelfile_name = pathlib.Path(urlparse(wheel_url).path)
pbi = self.ctx.package_build_info(req)
expected_build_tag = pbi.build_tag(resolved_version)
# Log the expected build tag for debugging
logger.info(f"{req.name}: has expected build tag {expected_build_tag}")
# Get changelogs for debug info
changelogs = pbi.get_changelog(resolved_version)
logger.debug(f"{req.name} has change logs {changelogs}")

dist_name, dist_version, build_tag, _ = wheels.extract_info_from_wheel_file(
req, wheelfile_name
)
Expand Down
9 changes: 7 additions & 2 deletions src/fromager/packagesettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,16 @@ def build_dir(self, sdist_root_dir: pathlib.Path) -> pathlib.Path:
return sdist_root_dir / relative_build_dir
return sdist_root_dir

def get_changelog(self, version: Version) -> list[str]:
pv = typing.cast(PackageVersion, version)
variant_changelog = self._variant_changelog
package_changelog = self._ps.changelog.get(pv, [])
return variant_changelog + package_changelog

def build_tag(self, version: Version) -> BuildTag:
"""Build tag for version's changelog and this variant"""
pv = typing.cast(PackageVersion, version)
release = len(self._ps.changelog.get(pv, []))
release += len(self._variant_changelog)
release = len(self.get_changelog(pv))
if release == 0:
return ()
# suffix = "." + self.variant.replace("-", "_")
Expand Down

0 comments on commit fac7ee6

Please sign in to comment.