@@ -51,15 +51,19 @@ def get_geos_install_prefix():
5151 if os .path .isfile (hfile ) and libfiles :
5252 return prefix
5353
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 )
6367 return None
6468
6569
@@ -96,7 +100,9 @@ def run(self):
96100 import numpy
97101 include_dirs .append (numpy .get_include ())
98102 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 )
100106
101107# Define GEOS include, library and runtime dirs.
102108geos_install_prefix = get_geos_install_prefix ()
0 commit comments