Skip to content

Commit 305f00e

Browse files
y3rshryanthecoder
andauthored
fix(scripts): setuptools v71 removed the need for extern (#15717) (#15741)
## `cherry-pick` afaa717 Must update `chore_release-7.4.0` so that Linux app builds work due to a change in setuptools. To understand the changes see #15717 Co-authored-by: Ryan Howard <[email protected]>
1 parent 6fe994e commit 305f00e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

scripts/python_build_utils.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,18 @@ def normalize_version(package, project, extra_tag='', git_dir=None):
5454
# the way they vendor dependencies, like the packaging module that
5555
# provides the way to normalize version numbers for wheel file names. So
5656
# we try all the possible ways to find it.
57+
# Since 71.0.0 they have removed the need for extern
58+
# So depending on the version of 3.10 you're building on you may or may not
59+
# need to use the extern or import it directly
5760
try:
58-
# new way
59-
from setuptools.extern import packaging
61+
import setuptools
62+
major, minor, patch = [int(x, 10) for x in setuptools.__version__.split('.')]
63+
if major < 71:
64+
# new way
65+
from setuptools.extern import packaging
66+
else:
67+
# new new way
68+
import packaging
6069
except ImportError:
6170
# old way
6271
from pkg_resources.extern import packaging

0 commit comments

Comments
 (0)