comparison setup.py @ 51833:6388fd855f66 stable tip

setup: handle removal of old MSVC compiler from setuptools 65.0 (issue6910) It was removed a few years ago[1]. When trying to reproduce locally using a clean py3.12 as called out in the bug report, `setuptools` wasn't installed at all, and needed a `pip install` to fix a `ModuleNotFoundError` when building locally. Maybe that needs to be in the requirements clause now. It looks like this "private" module was added in setuptools 48.0.[2] I can't find a changelog of what version was included in which version of python, and the changelog for pip has a huge gap between when it called out 67.6.1 in `pip` 23.1 (2023-04-15), and 41.4.0 in `pip` 19.3 (2019-10-14).[3] So, we'll just add to the existing code instead of replacing it, for safety. [1] https://github.com/pypa/setuptools/commit/cc017c77948737d131f683e0c25cd37bc639b8fc [2] https://github.com/pypa/setuptools/commit/d034a5ec7f707499139f90eb846b9e720923124c [3] https://pip.pypa.io/en/stable/news/
author Matt Harbison <mharbison@atto.com>
date Thu, 05 Sep 2024 15:37:14 -0400
parents 45ba8416afc4
children
comparison
equal deleted inserted replaced
51818:23116aefe786 51833:6388fd855f66
1660 1660
1661 if os.name == 'nt': 1661 if os.name == 'nt':
1662 # Allow compiler/linker flags to be added to Visual Studio builds. Passing 1662 # Allow compiler/linker flags to be added to Visual Studio builds. Passing
1663 # extra_link_args to distutils.extensions.Extension() doesn't have any 1663 # extra_link_args to distutils.extensions.Extension() doesn't have any
1664 # effect. 1664 # effect.
1665 from distutils import msvccompiler 1665 try:
1666 # setuptools < 65.0
1667 from distutils import msvccompiler
1668 except ImportError:
1669 from distutils import _msvccompiler as msvccompiler
1666 1670
1667 msvccompilerclass = msvccompiler.MSVCCompiler 1671 msvccompilerclass = msvccompiler.MSVCCompiler
1668 1672
1669 class HackedMSVCCompiler(msvccompiler.MSVCCompiler): 1673 class HackedMSVCCompiler(msvccompiler.MSVCCompiler):
1670 def initialize(self): 1674 def initialize(self):