This repository has been archived by the owner on Sep 14, 2021. It is now read-only.
forked from elasticluster/elasticluster
-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
executable file
·183 lines (167 loc) · 6.72 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#!/usr/bin/env python
# -*- coding: utf-8 -*-#
#
#
# Copyright (C) 2013-2017 University of Zurich. All rights reserved.
#
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import sys
# fix Python issue 15881 (on Python <2.7.5)
try:
import multiprocessing
except ImportError:
pass
# Ensure we use a recent enough version of setuptools: CentOS7 still ships with
# 0.9.8! Although at the moment ElastiCluster does not make use of any advanced
# feature from `setuptools`, some dependent package requires >=17.1 (at the
# time of this writing) and this version number is likely to increase with time
# -- so just pick a "known good one".
from ez_setup import use_setuptools
use_setuptools(version='21.0.0')
## auxiliary functions
#
def read_whole_file(path):
"""
Return file contents as a string.
"""
with open(path, 'r') as stream:
return stream.read()
## test runner setup
#
# See http://tox.readthedocs.org/en/latest/example/basic.html#integration-with-setuptools-distribute-test-commands
# on how to run tox when python setup.py test is run
#
from setuptools.command.test import test as TestCommand
class Tox(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import tox
errno = tox.cmdline(self.test_args)
sys.exit(errno)
## conditional dependencies
#
# Although PEP-508 and a number of predecessors specify a syntax for
# conditional dependencies in Python packages, support for it is inconsistent
# (at best) among the PyPA tools. An attempt to use the conditional syntax has
# already caused issues #308, #249, #227, and many more headaches to me while
# trying to find a combination of `pip`, `setuptools`, `wheel`, and dependency
# specification syntax that would work reliably across all supported Linux
# distributions. I give up, and revert to computing the dependencies via
# explicit Python code in `setup.py`; this will possibly break wheels but it's
# the least damage I can do ATM.
python_version = sys.version_info[:2]
if python_version == (2, 6):
version_dependent_requires = [
# Alternate dependencies for Python 2.6:
# - PyCLI requires argparse,
'argparse',
# - OpenStack's "keystoneclient" requires `importlib`
'importlib',
# - support for Python 2.6 was removed from `novaclient` in commit
# 81f8fa655ccecd409fe6dcda0d3763592c053e57 which is contained in
# releases 3.0.0 and above; however, we also need to pin down
# the version of `oslo.config` and all the dependencies thereof,
# otherwise `pip` will happily download the latest and
# incompatible version,since `python-novaclient` specifies only
# the *minimal* version of dependencies it is compatible with...
'stevedore<1.10.0',
'debtcollector<1.0.0',
'keystoneauth<2.0.0',
# yes, there"s `keystoneauth` and `keystoneauth1` !!
'keystoneauth1<2.0.0',
'oslo.config<3.0.0',
'oslo.i18n<3.1.0',
'oslo.serialization<2.1.0',
'oslo.utils<3.1.0',
'python-keystoneclient<2.0.0',
'python-novaclient<3.0.0',
]
elif python_version == (2, 7):
version_dependent_requires = [
'python-novaclient',
]
else:
raise RuntimeError("ElastiCluster requires Python 2.6 or 2.7")
## real setup description begins here
#
from setuptools import setup, find_packages
setup(
name="elasticluster",
version=read_whole_file("version.txt").strip(),
description="A command line tool to create, manage and setup computing clusters hosted on a public or private cloud infrastructure.",
long_description=read_whole_file('README.rst'),
author="Services and Support for Science IT, University of Zurich",
author_email="[email protected]",
license="LGPL",
keywords="cloud openstack amazon ec2 ssh hpc gridengine torque slurm batch job elastic",
url="https://github.com/gc3-uzh-ch/elasticluster",
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"License :: DFSG approved",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Operating System :: POSIX :: Other",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Topic :: System :: Clustering",
"Topic :: Education",
"Topic :: Scientific/Engineering",
"Topic :: System :: Distributed Computing",
],
packages=find_packages(),
include_package_data=True, # include files mentioned by MANIFEST.in
entry_points={
'console_scripts': [
'elasticluster = elasticluster.__main__:main',
]
},
install_requires=([
'PyCLI',
'ansible>=2.2.1', ## see: https://www.computest.nl/advisories/CT-2017-0109_Ansible.txt
'click>=4.0', ## click.prompt() added in 4.0
'coloredlogs',
'netaddr',
'paramiko',
'schema',
# EC2 clouds
'boto',
# GCE cloud
'google-api-python-client',
'google-compute-engine',
'python-gflags',
'simplejson>=2.5.0', # needed by `uritemplate` but somehow not picked up
'pytz', ## required by `positional` but somehow not picked up
'httplib2>=0.9.1', ## required by `oauth2client` but somehow not picked up
# Azure cloud
'azure',
# OpenStack clouds
'netifaces',
#'python-novaclient' ## this needs special treatment depending on Python version, see below
] + version_dependent_requires),
tests_require=['tox', 'mock', 'pytest>=2.10'], # read right-to-left
cmdclass={'test': Tox},
)