-
Notifications
You must be signed in to change notification settings - Fork 27
/
setup.py
166 lines (149 loc) · 4.17 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
"""
pymagicc
Thin Python wrapper around the
reduced complexity climate model MAGICC6 (http://magicc.org/).
Install using
pip install pymagicc
On Linux and macOS Wine (https://www.winehq.org) needs to be installed (usually
available with your package manager).
Find usage instructions in the
GitHub repository at https://github.com/openscm/pymagicc.
"""
import versioneer
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
PACKAGE_NAME = "pymagicc"
DESCRIPTION = "Python wrapper for the simple climate model MAGICC"
KEYWORDS = ["simple climate model MAGICC python"]
AUTHORS = [
("Robert Gieseke", "rob.g@web.de"),
("Zeb Nicholls", "zebedee.nicholls@climate-energy-college.org"),
("Jared Lewis", "jared.lewis@climate-energy-college.org"),
("Sven Willner", "sven.willner@pik-potsdam.de"),
("Matthias Mengel", "matthias.mengel@pik-potsdam.de"),
]
URL = "https://github.com/openscm/pymagicc"
PROJECT_URLS = {
"Bug Reports": "https://github.com/openscm/pymagicc/issues",
"Documentation": "https://pymagicc.readthedocs.io/en/latest",
"Source": "https://github.com/openscm/pymagicc",
}
LICENSE = "3-Clause BSD License"
CLASSIFIERS = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
REQUIREMENTS_INSTALL = [
"pandas-datapackage-reader",
"f90nml",
"PyYAML",
"scmdata",
"pandas",
"versioneer",
]
REQUIREMENTS_NOTEBOOKS = [
"notebook",
"expectexception",
"seaborn",
"pyam-iamc>=0.3.0",
]
REQUIREMENTS_TESTS = [
"nbval",
"pytest>=7",
"pytest-benchmark",
"pytest-cov",
"pytest-mock",
"pytest-xdist",
"codecov",
"goodtables",
"scipy",
"seaborn",
]
REQUIREMENTS_DOCS = [
"sphinx>2.1",
"sphinx_rtd_theme",
"sphinx-autodoc-typehints",
"pydoc-markdown",
]
REQUIREMENTS_DEPLOY = ["setuptools>=38.6.0", "twine>=1.11.0", "wheel>=0.31.0"]
REQUIREMENTS_DEV = (
[
"bandit",
"black",
"flake8",
"isort>=5",
"nbdime",
"pydocstyle",
"pylint",
]
+ REQUIREMENTS_NOTEBOOKS
+ REQUIREMENTS_TESTS
+ REQUIREMENTS_DOCS
+ REQUIREMENTS_DEPLOY
)
README = "README.rst"
REQUIREMENTS_EXTRAS = {
"notebooks": REQUIREMENTS_NOTEBOOKS,
"docs": REQUIREMENTS_DOCS,
"tests": REQUIREMENTS_TESTS,
"deploy": REQUIREMENTS_DEPLOY,
"dev": REQUIREMENTS_DEV,
}
PACKAGE_DATA = {
"": ["*.csv"],
"pymagicc": [
"MAGICC6/*.txt",
"MAGICC6/out/.gitkeep",
"MAGICC6/run/*.CFG",
"MAGICC6/run/*.exe",
"MAGICC6/run/*.IN",
"MAGICC6/run/*.MON",
"MAGICC6/run/*.prn",
"MAGICC6/run/*.SCEN",
],
}
with open(README, "r", encoding="utf-8") as f:
README_LINES = ["Pymagicc", "========", ""]
add_line = False
for line in f:
if line.strip() == ".. sec-begin-long-description":
add_line = True
elif line.strip() == ".. sec-end-long-description":
break
elif add_line:
README_LINES.append(line)
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
pytest.main(self.test_args)
cmdclass = versioneer.get_cmdclass()
cmdclass.update({"test": PyTest})
setup(
name=PACKAGE_NAME,
version=versioneer.get_version(),
description=DESCRIPTION,
long_description="\n".join(README_LINES),
long_description_content_type="text/x-rst",
author=", ".join([author[0] for author in AUTHORS]),
author_email=", ".join([author[1] for author in AUTHORS]),
url=URL,
project_urls=PROJECT_URLS,
license=LICENSE,
keywords=KEYWORDS,
classifiers=CLASSIFIERS,
packages=find_packages(exclude=["tests"]),
package_data=PACKAGE_DATA,
include_package_data=True,
install_requires=REQUIREMENTS_INSTALL,
extras_require=REQUIREMENTS_EXTRAS,
cmdclass=cmdclass,
)