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(scripts): setuptools v71 removed the need for extern (#15717) #15741

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions scripts/python_build_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,18 @@ def normalize_version(package, project, extra_tag='', git_dir=None):
# the way they vendor dependencies, like the packaging module that
# provides the way to normalize version numbers for wheel file names. So
# we try all the possible ways to find it.
# Since 71.0.0 they have removed the need for extern
# So depending on the version of 3.10 you're building on you may or may not
# need to use the extern or import it directly
try:
# new way
from setuptools.extern import packaging
import setuptools
major, minor, patch = [int(x, 10) for x in setuptools.__version__.split('.')]
if major < 71:
# new way
from setuptools.extern import packaging
else:
# new new way
import packaging
except ImportError:
# old way
from pkg_resources.extern import packaging
Expand Down
Loading