@@ -51,15 +51,19 @@ def get_geos_install_prefix():
51
51
if os .path .isfile (hfile ) and libfiles :
52
52
return prefix
53
53
54
- warnings .warn (" " .join ([
55
- "Cannot find GEOS library and/or headers in standard locations" ,
56
- "('{0}'). Please install the corresponding packages using your" ,
57
- "software management system or set the environment variable" ,
58
- "GEOS_DIR to point to the location where GEOS is installed" ,
59
- "(for example, if 'geos_c.h' is in '/usr/local/include'" ,
60
- "and 'libgeos_c' is in '/usr/local/lib', then you need to" ,
61
- "set GEOS_DIR to '/usr/local'" ,
62
- ]).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 )
63
67
return None
64
68
65
69
@@ -96,7 +100,9 @@ def run(self):
96
100
import numpy
97
101
include_dirs .append (numpy .get_include ())
98
102
except ImportError as err :
99
- 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 )
100
106
101
107
# Define GEOS include, library and runtime dirs.
102
108
geos_install_prefix = get_geos_install_prefix ()
0 commit comments