diff --git a/setup.py b/setup.py index dc9e60b..45fb3f9 100644 --- a/setup.py +++ b/setup.py @@ -41,18 +41,23 @@ def parse_version_from(path): incdir = os.path.realpath("install/include") libs = ["eccodes"] -# https://setuptools.pypa.io/en/latest/userguide/ext_modules.html -ext_modules = [ - setuptools.Extension( - "eccodes._eccodes", - sources=["eccodes/_eccodes.cc"], - language="c++", - libraries=libs, - library_dirs=[libdir], - include_dirs=[incdir], - extra_link_args=["-Wl,-rpath," + libdir], - ) -] +if "--binary-wheel" in sys.argv: + sys.argv.remove("--binary-wheel") + + # https://setuptools.pypa.io/en/latest/userguide/ext_modules.html + ext_modules = [ + setuptools.Extension( + "eccodes._eccodes", + sources=["eccodes/_eccodes.cc"], + language="c++", + libraries=libs, + library_dirs=[libdir], + include_dirs=[incdir], + extra_link_args=["-Wl,-rpath," + libdir], + ) + ] +else: + ext_modules = [] install_requires = ["numpy"]