forked from landlab/landlab
-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
114 lines (97 loc) · 3.31 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#! /usr/bin/env python
import os
import re
import pkg_resources
from setuptools import Extension, find_packages, setup
numpy_incl = pkg_resources.resource_filename("numpy", "core/include")
def read(filename):
with open(filename, "r", encoding="utf-8") as fp:
return fp.read()
def read_requirements(filename):
"""Read requirements from a file, adding dependency specifications where needed.
Dependency specifications could be included in the requirements file but,
since the requirements file is also used by conda and conda doesn't
understand dependency specifications, we add them here.
"""
lines = [line.strip() for line in read(filename).splitlines()]
requirements = []
for requirement in lines:
if requirement.startswith(("richdem", "bmi-topography")):
requirement += "; sys_platform != 'win32' or python_version < '3.10'"
requirements.append(requirement)
return requirements
long_description = "\n\n".join(
[
read("README.rst"),
read("AUTHORS.rst"),
read("CHANGES.rst"),
]
)
def find_extensions(path="."):
extensions = []
for root, _dirs, files in os.walk(os.path.normpath(path)):
extensions += [
os.path.join(root, fname) for fname in files if fname.endswith(".pyx")
]
return [
Extension(re.sub(re.escape(os.path.sep), ".", ext[: -len(".pyx")]), [ext])
for ext in extensions
]
install_requires = read_requirements("requirements.txt")
extras_require = {
"tests": read_requirements("requirements-testing.txt"),
"docs": read_requirements("requirements-docs.txt"),
"dev": read_requirements("requirements-dev.txt"),
"notebooks": read_requirements("requirements-notebooks.txt"),
}
setup(
name="landlab",
version="2.4.2.dev0",
author="Eric Hutton",
author_email="[email protected]",
url="https://github.com/landlab",
description="Plugin-based component modeling tool.",
long_description=long_description,
python_requires=">=3.7",
install_requires=install_requires,
extras_require=extras_require,
include_package_data=True,
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Cython",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Physics",
],
keywords=[
"bmi",
"component modeling",
"earth science",
"gridding engine",
"model coupling",
"numerical modeling",
],
packages=find_packages(),
package_data={
"": [
"tests/*txt",
"data/*asc",
"data/*nc",
"data/*shp",
"test/*shx",
"data/*dbf",
"preciptest.in",
"test_*/*nc",
"test_*/*asc",
]
},
entry_points={"console_scripts": ["landlab=landlab.cmd.landlab:main"]},
include_dirs=[numpy_incl],
ext_modules=find_extensions("landlab"),
)