fix: Python publishing fails on some Python distributions #4776
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.
Our recent
jsii-pacmak
release contained an update totwine
which exhibits a failure when combined with specific versions ofpackaging
.When reading the bug thread the root cause seems to be
setuptools
, but the workaround seems to depend on the installed version ofpackaging
.twine
declares a dependency onpackaging>=24.0.0
and the bug doesn't appear if24.2
is installed. As a result, the problem shows on Python distributions that come with[email protected]
or[email protected]
preinstalled.If an older version or no version of
packaging
is preinstalled thenpip
will install a fresh copy and it will pick24.2
, but older versions match the declared version range and the pre-existing version will be used, which leads to the problem.To solve, add the required minimum version of
packaging
to our own dependency file.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.