(engsys) fix: Gracefully handle invalid python_requires when finding mininum dependency version #37317
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.
Description
python_requires
must follow the format defined in: https://packaging.python.org/en/latest/specifications/version-specifiers/#id5In the event that a package version specifies a
python_requires
that does not match that spec, execution offilter_packages_for_compatibility
terminates with an InvalidSpecifier exception. This is called during themindependency
step in our CI, so that exception causes the testing step to fail: example runThis PR gracefully handles invalid python_requires, logging the exception and ignoring the version that has the invalid python version specifier.
This PR should have no impact on any existing SDKs in the repository, since any SDK with this issue would like have already been blocked it.
Note: An alternative solution could have been to attempt to correct the version specifier (e.g. '>= 3.5.*' is invalid, but it'd be trivial to correct it to '>=3.5'). But such a correction in the more general case may invite a complexity that costs more than it's worth.
Related to #37268
Unblocks #37201
_
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines