-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* BLD: Initial try at pyproject.toml I think I got every key from setup.py. The main difference is if the READTHEDOCS environment variable is set: I don't know how to change the dependencies based on that. On the other hand, given 3.8 is close to or past EOL, I suspect 3.3 is relatively uncommon, and the RTD install, without the unneeded bits, could be accomplished with pip install --no-deps. * BLD,BUG: Fix pyproject.toml configuration and remove setup.py duplicates. numpy.distutils recommends setuptools<60, but that breaks pyproject.toml configuration. I like this way better. Still needs setup.py for the fortran module and for the Cheyenne configuration. * FIX: Require a setuptools version that understands the configuration. setuptools<60 just gets confused, and has no idea what the project name is. I just inverted that requirement: not sure if setuptools needs to be more recent still. * BLD: Quote version requirement. * BLD: Specify dependencies in pyproject.toml only. Remove requirements.txt. * DOC: Don't install dependencies on RTD The old setup script replaced the dependencies listed in requirements.txt with mock if python was old enough and nothing if python was recent. The package no longer supports python versions that old (<3.3), so installing without dependencies is likely the correct way to handle the RTD configuration. * BLD,BUG: Remove references to requirements, not just definitions Forgot to remove this two or three commits back. * BLD: Let's see if NumPy < 2.0 fixes the error * BLD: Pin setuptools<60 NumPy suggested it, it might help with the distutils failure. * BLD: Pin setuptools<71 Let's see if that change is the one that broke things. * BLD: Add subroutines to f90 modules so f2py adds code for them. If it's just constants used somewhere, f2py drops the module. * BLD: Remove build-time setuptools pin. * BLD: Pin setuptools<70 to get msvccompiler * BLD: Add -fopenmp to LDFLAGS Let's see if this gets Linux compiles working. --------- Co-authored-by: Katelyn FitzGerald <[email protected]>
- Loading branch information
1 parent
302bd5f
commit fc2bc17
Showing
10 changed files
with
77 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
include README.md | ||
include LICENSE | ||
include requirements.txt | ||
|
||
include fortran/*.f90 | ||
include fortran/*.pyf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
[build-system] | ||
requires = ["setuptools>=61, <70", "numpy"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "wrf-python" | ||
authors = [ | ||
{ name = "Bill Ladwig" } | ||
] | ||
maintainers = [ | ||
{ name = "GeoCAT", email = "[email protected]" }, | ||
] | ||
description = "Diagnostic and interpolation routines for WRF-ARW data." | ||
readme = "README.md" | ||
requires-python = ">=3.7, <3.12" | ||
keywords = [ | ||
"python", "wrf-python", "wrf", "forecast", "model", | ||
"weather research and forecasting", "interpolation", | ||
"plotting", "plots", "meteorology", "nwp", | ||
"numerical weather prediction", "diagnostic", | ||
"science", "numpy" | ||
] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Science/Research", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Programming Language :: Fortran", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Topic :: Scientific/Engineering :: Atmospheric Science", | ||
"Topic :: Software Development", | ||
"Operating System :: POSIX", | ||
"Operating System :: Unix", | ||
"Operating System :: MacOS", | ||
"Operating System :: Microsoft :: Windows" | ||
] | ||
license = { text = "Apache-2.0" } | ||
dynamic = [ "version" ] | ||
dependencies = [ | ||
"basemap", | ||
"numpy >=1.11, !=1.24.3", | ||
"setuptools", | ||
"wrapt", | ||
"xarray" | ||
] | ||
|
||
[project.urls] | ||
Repository = "https://github.com/NCAR/wrf-python" | ||
Documentation = "https://wrf-python.rtfd.org" | ||
|
||
[tool.setuptools] | ||
package-data = { "wrf" = ["data/psadilookup.dat"]} | ||
platforms = ["any"] | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = { attr = "wrf.version.__version__" } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,7 @@ | ||
import os | ||
import sys | ||
import setuptools | ||
import socket | ||
|
||
# Bootstrap a numpy installation before trying to import it. | ||
import importlib | ||
try: | ||
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']) | ||
|
||
if not socket.gethostname().startswith("cheyenne"): | ||
import numpy.distutils.core | ||
else: | ||
|
@@ -53,70 +42,15 @@ | |
"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()) | ||
|
||
on_rtd = os.environ.get("READTHEDOCS", None) == "True" | ||
# on_rtd=True | ||
if on_rtd: | ||
if sys.version_info < (3, 3): | ||
requirements = ["mock"] # for python2 and python < 3.3 | ||
else: | ||
requirements = [] # for >= python3.3 | ||
ext_modules = [] | ||
|
||
else: | ||
# Place install_requires into the text file "requirements.txt" | ||
with open("requirements.txt") as f2: | ||
requirements = f2.read().strip().splitlines() | ||
|
||
# if sys.version_info < (3,3): | ||
# requirements.append("mock") | ||
ext_modules = [ext1] | ||
|
||
numpy.distutils.core.setup( | ||
name='wrf-python', | ||
author="Bill Ladwig", | ||
maintainer="GeoCAT", | ||
maintainer_email="[email protected]", | ||
description="Diagnostic and interpolation routines for WRF-ARW data.", | ||
long_description=("A collection of diagnostic and interpolation " | ||
"routines to be used with WRF-ARW data.\n\n" | ||
"GitHub Repository:\n\n" | ||
"https://github.com/NCAR/wrf-python\n\n" | ||
"Documentation:\n\n" | ||
"https://wrf-python.rtfd.org\n"), | ||
url="https://github.com/NCAR/wrf-python", | ||
version=__version__, | ||
package_dir={"": "src"}, | ||
keywords=["python", "wrf-python", "wrf", "forecast", "model", | ||
"weather research and forecasting", "interpolation", | ||
"plotting", "plots", "meteorology", "nwp", | ||
"numerical weather prediction", "diagnostic", | ||
"science", "numpy"], | ||
python_requires='>=3.9, <3.12', | ||
install_requires=requirements, | ||
classifiers=["Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Science/Research", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Programming Language :: Fortran", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Topic :: Scientific/Engineering :: Atmospheric Science", | ||
"Topic :: Software Development", | ||
"Operating System :: POSIX", | ||
"Operating System :: Unix", | ||
"Operating System :: MacOS", | ||
"Operating System :: Microsoft :: Windows"], | ||
platforms=["any"], | ||
license="Apache License 2.0", | ||
packages=setuptools.find_packages("src"), | ||
ext_modules=ext_modules, | ||
download_url="https://python.org/pypi/wrf-python", | ||
package_data={"wrf": ["data/psadilookup.dat"]}, | ||
scripts=[] | ||
) |