Skip to content

Commit 53b283f

Browse files
authored
Merge pull request NCAR#185 from kinow/fixing-setuppy
Fixing setup.py (install numpy)
2 parents 2fb22a1 + ac347c7 commit 53b283f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

setup.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
# Bootstrap a numpy installation before trying to import it.
77
import importlib
88
try:
9-
importlib.util.find_spec('numpy')
10-
except ImportError:
9+
numpy_module = importlib.util.find_spec('numpy')
10+
if numpy_module is None:
11+
raise ModuleNotFoundError
12+
except (ImportError, ModuleNotFoundError):
1113
import subprocess
1214
subprocess.call([sys.executable, '-m', 'pip', 'install', 'numpy'])
1315

@@ -51,6 +53,8 @@
5153
"fortran/omp.f90"]
5254
)
5355

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

@@ -83,7 +87,7 @@
8387
"GitHub Repository:\n\n"
8488
"https://github.com/NCAR/wrf-python\n\n"
8589
"Documentation:\n\n"
86-
"http://wrf-python.rtfd.org\n"),
90+
"https://wrf-python.rtfd.org\n"),
8791
url="https://github.com/NCAR/wrf-python",
8892
version=__version__,
8993
package_dir={"": "src"},
@@ -112,7 +116,7 @@
112116
license="Apache License 2.0",
113117
packages=setuptools.find_packages("src"),
114118
ext_modules=ext_modules,
115-
download_url="http://python.org/pypi/wrf-python",
119+
download_url="https://python.org/pypi/wrf-python",
116120
package_data={"wrf": ["data/psadilookup.dat"]},
117121
scripts=[]
118122
)

0 commit comments

Comments
 (0)