Skip to content

Commit

Permalink
Merge pull request #185 from kinow/fixing-setuppy
Browse files Browse the repository at this point in the history
Fixing setup.py (install numpy)
  • Loading branch information
michaelavs authored May 19, 2022
2 parents 2fb22a1 + ac347c7 commit 53b283f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
# Bootstrap a numpy installation before trying to import it.
import importlib
try:
importlib.util.find_spec('numpy')
except ImportError:
numpy_module = importlib.util.find_spec('numpy')
if numpy_module is None:
raise ModuleNotFoundError
except (ImportError, ModuleNotFoundError):
import subprocess
subprocess.call([sys.executable, '-m', 'pip', 'install', 'numpy'])

Expand Down Expand Up @@ -51,6 +53,8 @@
"fortran/omp.f90"]
)

#Note: __version__ will be set in the version.py script loaded below
__version__ = None
with open("src/wrf/version.py") as f:
exec(f.read())

Expand Down Expand Up @@ -83,7 +87,7 @@
"GitHub Repository:\n\n"
"https://github.com/NCAR/wrf-python\n\n"
"Documentation:\n\n"
"http://wrf-python.rtfd.org\n"),
"https://wrf-python.rtfd.org\n"),
url="https://github.com/NCAR/wrf-python",
version=__version__,
package_dir={"": "src"},
Expand Down Expand Up @@ -112,7 +116,7 @@
license="Apache License 2.0",
packages=setuptools.find_packages("src"),
ext_modules=ext_modules,
download_url="http://python.org/pypi/wrf-python",
download_url="https://python.org/pypi/wrf-python",
package_data={"wrf": ["data/psadilookup.dat"]},
scripts=[]
)

0 comments on commit 53b283f

Please sign in to comment.