diff options
-rw-r--r-- | changelog.d/3741.breaking.rst | 2 | ||||
-rw-r--r-- | setuptools/monkey.py | 6 | ||||
-rw-r--r-- | setuptools/msvc.py | 17 |
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 |