From d70fdf0367f4ccb709563c980d7b62afdd54c203 Mon Sep 17 00:00:00 2001 From: "Bruno P. Kinoshita" Date: Thu, 19 May 2022 19:20:04 +1200 Subject: [PATCH 1/3] Use https for project page --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 49a3c84..fc17abd 100755 --- a/setup.py +++ b/setup.py @@ -83,7 +83,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"}, @@ -112,7 +112,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=[] ) From 507dac943a5cb86b12a925d91e9f247033d5a0f7 Mon Sep 17 00:00:00 2001 From: "Bruno P. Kinoshita" Date: Thu, 19 May 2022 19:22:34 +1200 Subject: [PATCH 2/3] Declare __version__ and add a comment for other devs --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index fc17abd..07c3007 100755 --- a/setup.py +++ b/setup.py @@ -51,6 +51,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()) From ac347c73fbc002313fadc53e43106dec23063d16 Mon Sep 17 00:00:00 2001 From: "Bruno P. Kinoshita" Date: Thu, 19 May 2022 19:31:25 +1200 Subject: [PATCH 3/3] Raise an exception so numpy gets installed --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 07c3007..3dbeaf3 100755 --- a/setup.py +++ b/setup.py @@ -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'])