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

fix some issues writing the constraints file during bootstrap #534

Merged

Conversation

dhellmann
Copy link
Member

@dhellmann dhellmann commented Jan 20, 2025

We're seeing some cases downstream where fromager
fails with an exception because it tries to remove
something from the unresolved dependency list when
the item isn't in the list. This seems to be
caused by having multiple candidate versions for a
package where both versions could be used by all
consumers.

This change resolves the issue by stopping the
resolution loop when we find a version of a
package that can work for all consumers. The loop
now iterates from the newest version to the
oldest, to ensure we choose the newest package
that works.

There is also some error handling in case this fix
is not sufficient to eliminate the original
ValueError.

I also noticed that a log message that we supposed
to print debug info about the candidate versions
was using the wrong list variable so it was always
printing the same values, regardless of the
package. I cleaned that up and added additional
debug logging.

@dhellmann dhellmann marked this pull request as draft January 20, 2025 21:24
@dhellmann dhellmann force-pushed the fix-issues-writing-constraints branch from b1373db to 15bd8d4 Compare January 20, 2025 21:52
@dhellmann dhellmann marked this pull request as ready for review January 20, 2025 21:53
@dhellmann dhellmann requested a review from rd4398 January 20, 2025 21:53
@dhellmann dhellmann force-pushed the fix-issues-writing-constraints branch from 15bd8d4 to 9d7dd26 Compare January 20, 2025 22:31
@mergify mergify bot added the ci label Jan 20, 2025
We're seeing some cases downstream where fromager
fails with an exception because it tries to remove
something from the unresolved dependency list when
the item isn't in the list. This seems to be
caused by having multiple candidate versions for a
package where both versions could be used by all
consumers.

This change resolves the issue by stopping the
resolution loop when we find a version of a
package that can work for all consumers. The loop
now iterates from the newest version to the
oldest, to ensure we choose the newest package
that works.

There is also some error handling in case this fix
is not sufficient to eliminate the original
ValueError.

I also noticed that a log message that we supposed
to print debug info about the candidate versions
was using the wrong list variable so it was always
printing the same values, regardless of the
package. I cleaned that up and added additional
debug logging.
@dhellmann dhellmann force-pushed the fix-issues-writing-constraints branch from 9d7dd26 to a925786 Compare January 21, 2025 14:41
@dhellmann dhellmann requested a review from rd4398 January 21, 2025 14:51
Copy link
Contributor

@rd4398 rd4398 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good!

@mergify mergify bot merged commit c84ee7a into python-wheel-build:main Jan 21, 2025
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants