|
1 | 1 | import os |
2 | | -import sys |
3 | 2 | import setuptools |
4 | 3 | import socket |
5 | 4 |
|
6 | | -# Bootstrap a numpy installation before trying to import it. |
7 | | -import importlib |
8 | | -try: |
9 | | - numpy_module = importlib.util.find_spec('numpy') |
10 | | - if numpy_module is None: |
11 | | - raise ModuleNotFoundError |
12 | | -except (ImportError, ModuleNotFoundError): |
13 | | - import subprocess |
14 | | - subprocess.call([sys.executable, '-m', 'pip', 'install', 'numpy']) |
15 | | - |
16 | 5 | if not socket.gethostname().startswith("cheyenne"): |
17 | 6 | import numpy.distutils.core |
18 | 7 | else: |
|
53 | 42 | "fortran/omp.f90"] |
54 | 43 | ) |
55 | 44 |
|
56 | | -#Note: __version__ will be set in the version.py script loaded below |
57 | | -__version__ = None |
58 | | -with open("src/wrf/version.py") as f: |
59 | | - exec(f.read()) |
60 | | - |
61 | 45 | on_rtd = os.environ.get("READTHEDOCS", None) == "True" |
62 | 46 | # on_rtd=True |
63 | 47 | if on_rtd: |
64 | | - if sys.version_info < (3, 3): |
65 | | - requirements = ["mock"] # for python2 and python < 3.3 |
66 | | - else: |
67 | | - requirements = [] # for >= python3.3 |
68 | 48 | ext_modules = [] |
69 | 49 |
|
70 | 50 | else: |
71 | | - # Place install_requires into the text file "requirements.txt" |
72 | | - with open("requirements.txt") as f2: |
73 | | - requirements = f2.read().strip().splitlines() |
74 | | - |
75 | | - # if sys.version_info < (3,3): |
76 | | - # requirements.append("mock") |
77 | 51 | ext_modules = [ext1] |
78 | 52 |
|
79 | 53 | numpy.distutils.core.setup( |
80 | | - name='wrf-python', |
81 | | - author="Bill Ladwig", |
82 | | - maintainer="GeoCAT", |
83 | | - maintainer_email="[email protected]", |
84 | | - description="Diagnostic and interpolation routines for WRF-ARW data.", |
85 | | - long_description=("A collection of diagnostic and interpolation " |
86 | | - "routines to be used with WRF-ARW data.\n\n" |
87 | | - "GitHub Repository:\n\n" |
88 | | - "https://github.com/NCAR/wrf-python\n\n" |
89 | | - "Documentation:\n\n" |
90 | | - "https://wrf-python.rtfd.org\n"), |
91 | | - url="https://github.com/NCAR/wrf-python", |
92 | | - version=__version__, |
93 | | - package_dir={"": "src"}, |
94 | | - keywords=["python", "wrf-python", "wrf", "forecast", "model", |
95 | | - "weather research and forecasting", "interpolation", |
96 | | - "plotting", "plots", "meteorology", "nwp", |
97 | | - "numerical weather prediction", "diagnostic", |
98 | | - "science", "numpy"], |
99 | | - python_requires='>=3.9, <3.12', |
100 | | - install_requires=requirements, |
101 | | - classifiers=["Development Status :: 5 - Production/Stable", |
102 | | - "Intended Audience :: Science/Research", |
103 | | - "Intended Audience :: Developers", |
104 | | - "License :: OSI Approved :: Apache Software License", |
105 | | - "Programming Language :: Fortran", |
106 | | - "Programming Language :: Python :: 3.9", |
107 | | - "Programming Language :: Python :: 3.10", |
108 | | - "Programming Language :: Python :: 3.11", |
109 | | - "Topic :: Scientific/Engineering :: Atmospheric Science", |
110 | | - "Topic :: Software Development", |
111 | | - "Operating System :: POSIX", |
112 | | - "Operating System :: Unix", |
113 | | - "Operating System :: MacOS", |
114 | | - "Operating System :: Microsoft :: Windows"], |
115 | | - platforms=["any"], |
116 | | - license="Apache License 2.0", |
117 | | - packages=setuptools.find_packages("src"), |
118 | 54 | ext_modules=ext_modules, |
119 | | - download_url="https://python.org/pypi/wrf-python", |
120 | | - package_data={"wrf": ["data/psadilookup.dat"]}, |
121 | 55 | scripts=[] |
122 | 56 | ) |
0 commit comments