From d6bfd4975d8f5f06bd522dbc5bcc0506dfb49497 Mon Sep 17 00:00:00 2001 From: Ryan howard Date: Fri, 19 Jul 2024 12:15:47 -0400 Subject: [PATCH] setuptools v71 removed the need for extern --- scripts/python_build_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/python_build_utils.py b/scripts/python_build_utils.py index 317775cd2f2..c1e240d3c99 100644 --- a/scripts/python_build_utils.py +++ b/scripts/python_build_utils.py @@ -58,7 +58,12 @@ def normalize_version(package, project, extra_tag='', git_dir=None): # we try all the possible ways to find it. 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: + from setuptools.extern import packaging + else: + import packaging except ImportError: # old way from pkg_resources.extern import packaging