summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2023-01-21 10:04:58 -0500
committerGitHub <noreply@github.com>2023-01-21 10:04:58 -0500
commit40911c1b16be2247c0698d68b01ca587ed7be677 (patch)
tree6646514a275cea6d0ba618595ccf820493a3d2db
parent56ef50b3abf53183ee72253d39333169bfefd33e (diff)
parent9f783ac0ac08dd51a2d6644a9e58d5e64c4a3b2a (diff)
downloadpython-setuptools-git-40911c1b16be2247c0698d68b01ca587ed7be677.tar.gz
Merge pull request #3741 from mgorny/msvc-hack
Remove msvc hack for Numpy < 1.11.2
-rw-r--r--changelog.d/3741.breaking.rst2
-rw-r--r--setuptools/monkey.py6
-rw-r--r--setuptools/msvc.py17
3 files changed, 2 insertions, 23 deletions
diff --git a/changelog.d/3741.breaking.rst b/changelog.d/3741.breaking.rst
new file mode 100644
index 00000000..48e4e175
--- /dev/null
+++ b/changelog.d/3741.breaking.rst
@@ -0,0 +1,2 @@
+Removed patching of ``distutils._msvccompiler.gen_lib_options``
+for compatibility with Numpy < 1.11.2 -- by :user:`mgorny`
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