Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug message for expected build tag #543

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading