scripts/pythondistdeps: Implement provides/requires for extras packages + Rework error messages #1546
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Fedora we have adapted the pythondistdeps.py script (that generates python3.Xdist(foo) dependencies) to also generate requirements on Python extras (e.g. python3.Xdist(foo[bar])) whenever upstream metadata indicate such dependency.
The script was also adapted to be able to process a new Python extras packages that have the format
base_package+extras_name
(e.g.python3-setuptools_scm+toml
) and generate provides and requires for them.This has been implemented in Fedora 33: https://fedoraproject.org/wiki/Changes/PythonExtras
The change also includes an improvement of the error messages: Previously the error messages were printed to stdout, they were part of the output of the script, and thus the words were treated like dependencies, sorted alphabetically, thus rendering the message unreadable. This change prints a single keyword indicating the error and details are outputted to stderr. It also outputs *** on purpose to ensure the dependency would not be valid, causing a failure of the build.