@@ -37,27 +37,33 @@ def get_geos_install_prefix():
37
37
candidates = [os .path .expanduser ("~/local" ), os .path .expanduser ("~" ),
38
38
"/usr/local" , "/usr" , "/opt/local" , "/opt" , "/sw" ]
39
39
40
+ # Prepare filename pattern to find the GEOS library.
41
+ extensions = {"win32" : "dll" , "cygwin" : "dll" , "darwin" : "dylib" }
42
+ libext = extensions .get (sys .platform , "so*" )
43
+ libname = "*geos_c*.{0}" .format (libext )
44
+ libdirs = ["bin" , "lib" , "lib/x86_64-linux-gnu" , "lib64" ]
45
+
40
46
for prefix in candidates :
41
47
libfiles = []
42
- libdirs = ["bin" , "lib" , "lib/x86_64-linux-gnu" , "lib64" ]
43
- libext = "dll" if os .name == "nt" else "so"
44
- libcode = "{0}geos_c" .format ("" if os .name == "nt" else "lib" )
45
- libname = "{0}*.{1}*" .format (libcode , libext )
46
48
for libdir in libdirs :
47
49
libfiles .extend (glob .glob (os .path .join (prefix , libdir , libname )))
48
50
hfile = os .path .join (prefix , "include" , "geos_c.h" )
49
51
if os .path .isfile (hfile ) and libfiles :
50
52
return prefix
51
53
52
- warnings .warn (" " .join ([
53
- "Cannot find GEOS library and/or headers in standard locations" ,
54
- "('{0}'). Please install the corresponding packages using your" ,
55
- "software management system or set the environment variable" ,
56
- "GEOS_DIR to point to the location where GEOS is installed" ,
57
- "(for example, if 'geos_c.h' is in '/usr/local/include'" ,
58
- "and 'libgeos_c' is in '/usr/local/lib', then you need to" ,
59
- "set GEOS_DIR to '/usr/local'" ,
60
- ]).format ("', '" .join (candidates )), RuntimeWarning )
54
+ # At this point, the GEOS library was not found, so we throw a warning if
55
+ # the user is trying to build the library.
56
+ build_cmds = ("bdist_wheel" , "build" , "install" )
57
+ if any (cmd in sys .argv [1 :] for cmd in build_cmds ):
58
+ warnings .warn (" " .join ([
59
+ "Cannot find GEOS library and/or headers in standard locations" ,
60
+ "('{0}'). Please install the corresponding packages using your" ,
61
+ "software management system or set the environment variable" ,
62
+ "GEOS_DIR to point to the location where GEOS is installed" ,
63
+ "(for example, if 'geos_c.h' is in '/usr/local/include'" ,
64
+ "and 'libgeos_c' is in '/usr/local/lib', then you need to" ,
65
+ "set GEOS_DIR to '/usr/local'" ,
66
+ ]).format ("', '" .join (candidates )), RuntimeWarning )
61
67
return None
62
68
63
69
@@ -94,7 +100,9 @@ def run(self):
94
100
import numpy
95
101
include_dirs .append (numpy .get_include ())
96
102
except ImportError as err :
97
- warnings .warn ("unable to locate NumPy headers" , RuntimeWarning )
103
+ build_cmds = ("bdist_wheel" , "build" , "install" )
104
+ if any (cmd in sys .argv [1 :] for cmd in build_cmds ):
105
+ warnings .warn ("unable to locate NumPy headers" , RuntimeWarning )
98
106
99
107
# Define GEOS include, library and runtime dirs.
100
108
geos_install_prefix = get_geos_install_prefix ()
@@ -164,7 +172,7 @@ def run(self):
164
172
"name" :
165
173
"basemap" ,
166
174
"version" :
167
- "1.3.2 " ,
175
+ "1.3.3 " ,
168
176
"license" :
169
177
"MIT" ,
170
178
"description" :
0 commit comments