summaryrefslogtreecommitdiff
path: root/setuptools
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-12-30 19:20:42 +0100
committerMichał Górny <mgorny@gentoo.org>2023-01-21 09:27:16 +0100
commit9f783ac0ac08dd51a2d6644a9e58d5e64c4a3b2a (patch)
tree1ddf6c95a24950999c49cd652a94ff7dd8c5af14 /setuptools
parenta81b1303544208467235212ff8a39755e88cee7f (diff)
downloadpython-setuptools-git-9f783ac0ac08dd51a2d6644a9e58d5e64c4a3b2a.tar.gz
Remove msvc hack for Numpy < 1.11.2
Remove the msvc hack that was applied if numpy.distutils were loaded prior to Numpy 1.11.2. These versions date back to June 2016 and no longer build with Python 3.7. At the same time, the hack relies on packaging.version.LegacyVersion that is removed in packaging 22.0.
Diffstat (limited to 'setuptools')
-rw-r--r--setuptools/monkey.py6
-rw-r--r--setuptools/msvc.py17
2 files changed, 0 insertions, 23 deletions
diff --git a/setuptools/monkey.py b/setuptools/monkey.py
index 77a7adcf..50653fc7 100644
--- a/setuptools/monkey.py
+++ b/setuptools/monkey.py
@@ -157,9 +157,3 @@ def patch_for_msvc_specialized_compiler():
patch_func(*msvc14('_get_vc_env'))
except ImportError:
pass
-
- try:
- # Patch distutils._msvccompiler.gen_lib_options for Numpy
- patch_func(*msvc14('gen_lib_options'))
- except ImportError:
- pass
diff --git a/setuptools/msvc.py b/setuptools/msvc.py
index 5d4d7759..26d4e74f 100644
--- a/setuptools/msvc.py
+++ b/setuptools/msvc.py
@@ -15,17 +15,13 @@ import json
from io import open
from os import listdir, pathsep
from os.path import join, isfile, isdir, dirname
-import sys
import contextlib
import platform
import itertools
import subprocess
import distutils.errors
-from setuptools.extern.packaging.version import LegacyVersion
from setuptools.extern.more_itertools import unique_everseen
-from .monkey import get_unpatched
-
if platform.system() == 'Windows':
import winreg
from os import environ
@@ -217,19 +213,6 @@ def msvc14_get_vc_env(plat_spec):
raise
-def msvc14_gen_lib_options(*args, **kwargs):
- """
- Patched "distutils._msvccompiler.gen_lib_options" for fix
- compatibility between "numpy.distutils" and "distutils._msvccompiler"
- (for Numpy < 1.11.2)
- """
- if "numpy.distutils" in sys.modules:
- import numpy as np
- if LegacyVersion(np.__version__) < LegacyVersion('1.11.2'):
- return np.distutils.ccompiler.gen_lib_options(*args, **kwargs)
- return get_unpatched(msvc14_gen_lib_options)(*args, **kwargs)
-
-
def _augment_exception(exc, version, arch=''):
"""
Add details to the exception message to help guide the user