forked from GranthamImperial/silicone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
138 lines (122 loc) · 3.66 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
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
import versioneer
NAME = "silicone"
SHORT_DESCRIPTION = "Automated filling of detail in reported emission scenarios"
KEYWORDS = ["emissions", "automation", "filling", "detail", "climate"]
AUTHORS = [
("Robin Lamboll", "[email protected]"),
("Zebedee Nicholls", "[email protected]"),
("Jarmo Kikstra", "[email protected]"),
]
URL = "https://github.com/GranthamImperial/silicone"
PROJECT_URLS = {
"Bug Reports": "https://github.com/GranthamImperial/silicone/issues",
"Documentation": "https://silicone.readthedocs.io/en/latest",
"Source": "https://github.com/GranthamImperial/silicone",
}
README = "README.rst"
SOURCE_DIR = "src"
LICENSE = "3-Clause BSD License"
CLASSIFIERS = [
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
# "Programming Language :: Python :: 3.8",
]
REQUIREMENTS_INSTALL = [
"openscm-units>=0.2,<0.3",
"pint",
"pyam-iamc>=0.5.0",
"python-dateutil",
"numpy",
"scipy",
"tqdm",
]
REQUIREMENTS_NOTEBOOKS = ["notebook", "seaborn", "statsmodels"]
REQUIREMENTS_TESTS = [
"codecov",
"nbval",
"coverage<5", # nbval requirement, see https://github.com/computationalmodelling/nbval/issues/129
"pytest>=4.0,<5.0",
"pytest-console-scripts",
"pytest-cov",
]
REQUIREMENTS_DOCS = [
"sphinx>2.1",
"sphinx_rtd_theme",
"sphinx-autodoc-typehints",
]
REQUIREMENTS_DEPLOY = ["setuptools>=38.6.0", "twine>=1.11.0", "wheel>=0.31.0"]
REQUIREMENTS_DEV = (
[
"black==19.10b0",
"black-nb",
"bandit",
"coverage",
"flake8",
"isort",
"mypy",
"nbdime",
"pydocstyle",
"pylint",
]
+ REQUIREMENTS_NOTEBOOKS
+ REQUIREMENTS_TESTS
+ REQUIREMENTS_DOCS
+ REQUIREMENTS_DEPLOY
)
REQUIREMENTS_EXTRAS = {
"notebooks": REQUIREMENTS_NOTEBOOKS,
"docs": REQUIREMENTS_DOCS,
"tests": REQUIREMENTS_TESTS,
"deploy": REQUIREMENTS_DEPLOY,
"dev": REQUIREMENTS_DEV,
}
# Get the long description from the README file
with open(README, "r") as f:
README_LINES = ["Silicone", "========", ""]
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.strip())
if len(README_LINES) < 3:
raise RuntimeError("Insufficient description given")
class SiliconeTest(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": SiliconeTest})
setup(
name=NAME,
version=versioneer.get_version(),
description=SHORT_DESCRIPTION,
long_description="\n".join(README_LINES),
long_description_content_type="text/x-rst",
keywords=KEYWORDS,
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,
classifiers=CLASSIFIERS,
packages=find_packages(SOURCE_DIR),
package_dir={"": SOURCE_DIR},
install_requires=REQUIREMENTS_INSTALL,
extras_require=REQUIREMENTS_EXTRAS,
cmdclass=CMDCLASS,
)