forked from IAMconsortium/pyam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·130 lines (114 loc) · 3.5 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
import versioneer
from setuptools import setup, Command
from subprocess import call
# Thanks to http://patorjk.com/software/taag/
logo = r"""
______ __ __ ______ __ __
/\ == \ /\ \_\ \ /\ __ \ /\ "-./ \
\ \ _-/ \ \____ \ \ \ __ \ \ \ \-./\ \
\ \_\ \/\_____\ \ \_\ \_\ \ \_\ \ \_\
\/_/ \/_____/ \/_/\/_/ \/_/ \/_/
"""
# NOTE TO DEVS
# If you change a minimum version below, please explicitly set that
# in our minimum-reqs test in the file ./.github/workflows/pytest-depedency.yml
# Please also add a section "Dependency changes" to the release notes
REQUIREMENTS = [
"argparse",
"iam-units>=2020.4.21",
"numpy",
"requests",
"pandas>=1.1.1",
"pint",
"PyYAML",
"matplotlib>=3.2.0",
"seaborn",
"six",
"xlrd<2.0",
]
EXTRA_REQUIREMENTS = {
"tests": ["coverage", "coveralls", "pytest<6.0.0", "pytest-cov", "pytest-mpl<0.12"],
"optional-plotting": ["plotly"],
"optional-io-formats": ["datapackage", "pandas-datareader", "unfccc_di_api>=2.0"],
"deploy": ["twine", "setuptools", "wheel"],
"tutorials": ["pypandoc", "nbformat", "nbconvert", "jupyter_client", "ipykernel"],
"docs": [
"sphinx",
"nbsphinx",
"sphinx-gallery",
"cloud_sptheme",
"pillow",
"sphinxcontrib-bibtex<2.0",
"sphinxcontrib-programoutput",
"numpydoc",
"openpyxl",
"kaleido",
] # docs requires 'tutorials'
# GitHub Actions requires pandoc explicitly to build the docs
}
# building the docs on readthedocs fails with a FileNotFoundError
# https://github.com/IAMconsortium/pyam/issues/363
try:
with open("README.md", "r") as f:
LONG_DESCRIPTION = f.read()
except FileNotFoundError:
LONG_DESCRIPTION = ""
# thank you https://stormpath.com/blog/building-simple-cli-interfaces-in-python
class RunTests(Command):
"""Run all tests."""
description = "run tests"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
"""Run all tests!"""
errno = call(["py.test", "--cov=skele", "--cov-report=term-missing"])
raise SystemExit(errno)
CMDCLASS = versioneer.get_cmdclass()
CMDCLASS.update({"test": RunTests})
def main():
print(logo)
description = "Analysis & visualization of integrated-assessment scenarios"
classifiers = [
"License :: OSI Approved :: Apache Software License",
]
packages = [
"pyam",
]
pack_dir = {
"pyam": "pyam",
}
entry_points = {
"console_scripts": [
# list CLIs here
],
}
package_data = {
"pyam": ["region_mappings/*"],
}
install_requirements = REQUIREMENTS
extra_requirements = EXTRA_REQUIREMENTS
setup_kwargs = dict(
name="pyam-iamc",
version=versioneer.get_version(),
cmdclass=CMDCLASS,
description=description,
classifiers=classifiers,
license="Apache License 2.0",
author="Matthew Gidden & Daniel Huppmann",
author_email="[email protected]",
url="https://github.com/IAMconsortium/pyam",
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
packages=packages,
package_dir=pack_dir,
entry_points=entry_points,
package_data=package_data,
install_requires=install_requirements,
extras_require=extra_requirements,
)
setup(**setup_kwargs)
if __name__ == "__main__":
main()