Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
5c940cc9
Commit
5c940cc9
authored
Aug 19, 2016
by
Jason R. Coombs
Committed by
GitHub
Aug 19, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #739 from JGoutin/patch-1
numpy.distutils and distutils._msvccompiler compatibility
parents
ac10f58a
8d1eecae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
6 deletions
+35
-6
CHANGES.rst
CHANGES.rst
+9
-3
setuptools/msvc.py
setuptools/msvc.py
+26
-3
No files found.
CHANGES.rst
View file @
5c940cc9
...
@@ -2,6 +2,11 @@
...
@@ -2,6 +2,11 @@
CHANGES
CHANGES
=======
=======
v25
.3.1
-------
*
#
739
Fix
unquoted
libpaths
by
fixing
compatibility
between
`
numpy
.
distutils
`
and
`
distutils
.
_msvccompiler
`
for
numpy
<
1.11.2
(
Fix
issue
#
728
,
error
also
fixed
in
Numpy
).
v25
.3.0
v25
.3.0
-------
-------
...
@@ -16,20 +21,21 @@ v25.2.0
...
@@ -16,20 +21,21 @@ v25.2.0
v25
.1.6
v25
.1.6
-------
-------
*
#
725
*
#
725
:
revert
`
library_dir_option
`
patch
(
Error
is
related
to
`
numpy
.
distutils
`
and
make
errors
on
non
Numpy
users
).
v25
.1.5
v25
.1.5
-------
-------
*
#
720
*
#
720
*
#
723
*
#
723
:
Improve
patch
for
`
library_dir_option
`.
v25
.1.4
v25
.1.4
-------
-------
*
#
717
*
#
717
*
#
713
*
#
713
*
#
707
via
#
715
*
#
707
:
Fix
Python
2
compatibility
for
MSVC
by
catching
errors
properly
.
*
#
715
:
Fix
unquoted
libpaths
by
patching
`
library_dir_option
`.
v25
.1.3
v25
.1.3
-------
-------
...
...
setuptools/msvc.py
View file @
5c940cc9
...
@@ -2,9 +2,11 @@
...
@@ -2,9 +2,11 @@
This module adds improved support for Microsoft Visual C++ compilers.
This module adds improved support for Microsoft Visual C++ compilers.
"""
"""
import
os
import
os
import
sys
import
platform
import
platform
import
itertools
import
itertools
import
distutils.errors
import
distutils.errors
from
distutils.version
import
StrictVersion
from
setuptools.extern.six.moves
import
filterfalse
from
setuptools.extern.six.moves
import
filterfalse
...
@@ -75,14 +77,21 @@ def patch_for_specialized_compiler():
...
@@ -75,14 +77,21 @@ def patch_for_specialized_compiler():
msvc9compiler
.
find_vcvarsall
=
msvc9_find_vcvarsall
msvc9compiler
.
find_vcvarsall
=
msvc9_find_vcvarsall
unpatched
[
'msvc9_query_vcvarsall'
]
=
msvc9compiler
.
query_vcvarsall
unpatched
[
'msvc9_query_vcvarsall'
]
=
msvc9compiler
.
query_vcvarsall
msvc9compiler
.
query_vcvarsall
=
msvc9_query_vcvarsall
msvc9compiler
.
query_vcvarsall
=
msvc9_query_vcvarsall
except
Exception
:
except
NameError
:
pass
pass
try
:
try
:
# Patch distutils._msvccompiler._get_vc_env
# Patch distutils._msvccompiler._get_vc_env
unpatched
[
'msvc14_get_vc_env'
]
=
msvc14compiler
.
_get_vc_env
unpatched
[
'msvc14_get_vc_env'
]
=
msvc14compiler
.
_get_vc_env
msvc14compiler
.
_get_vc_env
=
msvc14_get_vc_env
msvc14compiler
.
_get_vc_env
=
msvc14_get_vc_env
except
Exception
:
except
NameError
:
pass
try
:
# Patch distutils._msvccompiler.gen_lib_options for Numpy
unpatched
[
'msvc14_gen_lib_options'
]
=
msvc14compiler
.
gen_lib_options
msvc14compiler
.
gen_lib_options
=
msvc14_gen_lib_options
except
NameError
:
pass
pass
...
@@ -212,6 +221,19 @@ def msvc14_get_vc_env(plat_spec):
...
@@ -212,6 +221,19 @@ def msvc14_get_vc_env(plat_spec):
raise
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
StrictVersion
(
np
.
__version__
)
<
StrictVersion
(
'1.11.2'
):
return
np
.
distutils
.
ccompiler
.
gen_lib_options
(
*
args
,
**
kwargs
)
return
unpatched
[
'msvc14_gen_lib_options'
](
*
args
,
**
kwargs
)
def
_augment_exception
(
exc
,
version
,
arch
=
''
):
def
_augment_exception
(
exc
,
version
,
arch
=
''
):
"""
"""
Add details to the exception message to help guide the user
Add details to the exception message to help guide the user
...
@@ -243,7 +265,8 @@ def _augment_exception(exc, version, arch=''):
...
@@ -243,7 +265,8 @@ def _augment_exception(exc, version, arch=''):
elif
version
>=
14.0
:
elif
version
>=
14.0
:
# For VC++ 14.0 Redirect user to Visual C++ Build Tools
# For VC++ 14.0 Redirect user to Visual C++ Build Tools
message
+=
(
' Get it with "Microsoft Visual C++ Build Tools": '
message
+=
(
' Get it with "Microsoft Visual C++ Build Tools": '
r'http://landinghub.visualstudio.com/visual-cpp-build-tools'
)
r'http://landinghub.visualstudio.com/'
'visual-cpp-build-tools'
)
exc
.
args
=
(
message
,
)
exc
.
args
=
(
message
,
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment