@@ -90,43 +90,27 @@ def _get_xdg_cache_dir():
90
90
options ['local_freetype' ] = lft or options .get ('local_freetype' , False )
91
91
92
92
93
- def get_win32_compiler ():
94
- """
95
- Determine the compiler being used on win32.
96
- """
97
- # Used to determine mingw32 or msvc
98
- # This is pretty bad logic, someone know a better way?
99
- for v in sys .argv :
100
- if 'mingw32' in v :
101
- return 'mingw32'
102
- return 'msvc'
103
- win32_compiler = get_win32_compiler ()
104
-
105
-
106
93
def extract_versions ():
107
94
"""
108
95
Extracts version values from the main matplotlib __init__.py and
109
96
returns them as a dictionary.
110
97
"""
111
98
with open ('lib/matplotlib/__init__.py' ) as fd :
112
99
for line in fd .readlines ():
113
- if ( line .startswith ('__version__numpy__' ) ):
100
+ if line .startswith ('__version__numpy__' ):
114
101
exec (line .strip ())
115
102
return locals ()
116
103
117
104
118
105
def has_include_file (include_dirs , filename ):
119
106
"""
120
- Returns `True` if ` filename` can be found in one of the
121
- directories in ` include_dirs` .
107
+ Returns `True` if * filename* can be found in one of the
108
+ directories in * include_dirs* .
122
109
"""
123
110
if sys .platform == 'win32' :
124
- include_dirs = list (include_dirs ) # copy before modify
125
- include_dirs += os .environ .get ('INCLUDE' , '.' ).split (os .pathsep )
126
- for dir in include_dirs :
127
- if os .path .exists (os .path .join (dir , filename )):
128
- return True
129
- return False
111
+ include_dirs = [* include_dirs , # Don't modify it in-place.
112
+ * os .environ .get ('INCLUDE' , '.' ).split (os .pathsep )]
113
+ return any (pathlib .Path (dir , filename ).exists () for dir in include_dirs )
130
114
131
115
132
116
def check_include_file (include_dirs , filename , package ):
@@ -150,7 +134,7 @@ def get_base_dirs():
150
134
if os .environ .get ('MPLBASEDIRLIST' ):
151
135
return os .environ .get ('MPLBASEDIRLIST' ).split (os .pathsep )
152
136
153
- win_bases = ['win32_static' , ]
137
+ win_bases = ['win32_static' ]
154
138
# on conda windows, we also add the <conda_env_dir>\Library,
155
139
# as conda installs libs/includes there
156
140
# env var names mess: https://github.com/conda/conda/issues/2312
0 commit comments