feat: add 'fromager resolve package' subcommand#906
feat: add 'fromager resolve package' subcommand#906tiran wants to merge 1 commit intopython-wheel-build:mainfrom
Conversation
|
I'm marking this as a draft, because I have not added documentation and tests for the new code. |
|
I maybe wrong, but can we name the command as
|
1d66a39 to
2a5e90c
Compare
dhellmann
left a comment
There was a problem hiding this comment.
It would be good to align the UX of this command and list-versions. That one has CLI switches to control the type of package allowed, for example, which could be useful here for testing if configuration changes help with a problem.
We should also work out some naming conventions. As we get more commands, they aren't as nicely organized as they could be. I like systems that use "noun verb" because if I know the noun then tab completion can help me find the verbs. So in this case we might have "package resolve" for this command and "package list-versions" for the other.
Perhaps the 2 commands should be merged with "list-versions" becoming a --all flag on "package resolve"?
None of these comments should block this from merging, but it would be good to work out a plan and clean things up afterwards.
34ab595 to
b065f0b
Compare
|
I have addressed some of @dhellmann 's remarks and improved the UI a bit. |
|
I will take a look in to this today. |
dhellmann
left a comment
There was a problem hiding this comment.
I'm happy with this version. I have a couple of nits, but I think we could fix those in follow-up PRs, unless other reviewers have things they want to change.
src/fromager/commands/package.py
Outdated
| f"req: '{req}', global constraint: '{global_constraint}'", | ||
| ) | ||
|
|
||
| latest = _get_latest_package(candidate.upload_time for candidate in candidates) |
There was a problem hiding this comment.
If I upload 1.2.0 and then 1.1.1, this will mark 1.1.1 as the latest but I would expect 1.2.0 to show up as latest since it has the higher version number.
Maybe we want to show separately the "most recent" release and the "release with the highest version number"?
There was a problem hiding this comment.
Good idea! I have changed the code and output from "latest" to "most recent". The command is showing the most recent upload as an activity indicator. If the package hasn't seen an updates in years, then the project is likely abandoned.
The next line prints a sorted list of versions in ascending order (highest version last). Is that good enough or do you still prefer an extra line for highest version?
LalatenduMohanty
left a comment
There was a problem hiding this comment.
Also we moved list-versions to package list-versions . which would be breaking change. Do we need to do anything special here?
The new `package resolve` subcommand is designed to debug Fromager settings and resolver properties. It compares the results from Fromager's internal resolver with a simple PyPI lookup. It prints informations like resolver configuration, detected versions and versions with sdists and wheels on PyPI. ```console $ fromager --variant cpu package resolve 'fromager~=0.68.0' resolving requirement for 'fromager~=0.68.0' (variant: cpu) Package uses standard settings. - sdist server url: https://pypi.org/simple - resolver includes sdists: True - resolver includes wheels: False - wheel server url: None - download url: None - prebuilt wheel: False - package is not constrained by '--constraints-file' Using distribution type: default (sdists: True, wheels: False) get_resolver_provider returns provider 'PyPIProvider' found 2 Fromager candidates with 2 unique versions for req: 'fromager~=0.68.0', Fromager constraint: 'None' - most recent release: 2025-10-21 14:37:12+02:00 - Fromager versions: 0.68.0, 0.68.1 found 2 versions on PyPI for req: 'fromager~=0.68.0', Fromager constraint: 'None' - most recent PyPI release: 2025-10-21 14:37:12+02:00 - package has purelib wheels (pure Python code) - PyPI versions: 0.68.0, 0.68.1 ``` Signed-off-by: Christian Heimes <cheimes@redhat.com>
The new
resole packagesubcommand is designed to debug Fromager settings and resolver properties. It compares the results from Fromager's internal resolver with a simple PyPI lookup. It prints informations like resolver configuration, detected versions and versions with sdists and wheels on PyPI.