forked from IAMconsortium/pyam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·115 lines (100 loc) · 3.09 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
import versioneer
from setuptools import setup, Command
from subprocess import call
# Thanks to http://patorjk.com/software/taag/
logo = r"""
______ __ __ ______ __ __
/\ == \ /\ \_\ \ /\ __ \ /\ "-./ \
\ \ _-/ \ \____ \ \ \ __ \ \ \ \-./\ \
\ \_\ \/\_____\ \ \_\ \_\ \ \_\ \ \_\
\/_/ \/_____/ \/_/\/_/ \/_/ \/_/
"""
REQUIREMENTS = [
'argparse',
'iam-units >= 2020.4.12',
'numpy',
'requests',
'pandas>=0.25.0',
'pint',
'PyYAML',
'matplotlib',
'seaborn',
'six',
]
EXTRA_REQUIREMENTS = {
'tests': ['coverage', 'coveralls', 'pytest<6.0.0', 'pytest-cov',
'pytest-mpl'],
'optional-io-formats': ['datapackage', 'pandas-datareader'],
'deploy': ['twine', 'setuptools', 'wheel'],
'tutorials': ['pypandoc', 'nbformat', 'nbconvert', 'jupyter_client',
'ipykernel'],
'docs': ['sphinx', 'nbsphinx', 'sphinx-gallery', 'cloud_sptheme',
'pillow', 'sphinxcontrib-bibtex', 'sphinxcontrib-programoutput',
'numpydoc', 'openpyxl'] # docs also requires 'tutorials'
}
# 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='pyam+owner@groups.io',
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()