forked from ClusterHQ/flocker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
185 lines (154 loc) · 6.18 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
184
185
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Generate a Flocker package that can be deployed onto cluster nodes.
"""
import os
from setuptools import setup, find_packages
import versioneer
versioneer.vcs = "git"
versioneer.versionfile_source = "flocker/_version.py"
versioneer.versionfile_build = "flocker/_version.py"
versioneer.tag_prefix = ""
versioneer.parentdir_prefix = "flocker-"
from distutils.core import Command
from admin.release import make_rpm_version
class cmd_generate_spec(Command):
description = "Generate python-flocker.spec with current version."
user_options = []
boolean_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
with open('python-flocker.spec.in', 'r') as source:
spec = source.read()
flocker_version = versioneer.get_version()
version, release = make_rpm_version(flocker_version)
with open('python-flocker.spec', 'w') as destination:
destination.write(
"%%global flocker_version %s\n" % (flocker_version,))
destination.write(
"%%global flocker_version_underscore %s\n" % (
flocker_version.replace('-', '_'),))
destination.write(
"%%global supplied_rpm_version %s\n" % (version,))
destination.write(
"%%global supplied_rpm_release %s\n" % (release,))
destination.write(spec)
cmdclass = {'generate_spec': cmd_generate_spec}
# Let versioneer hook into the various distutils commands so it can rewrite
# certain data at appropriate times.
cmdclass.update(versioneer.get_cmdclass())
# Hard linking doesn't work inside VirtualBox shared folders. This means that
# you can't use tox in a directory that is being shared with Vagrant,
# since tox relies on `python setup.py sdist` which uses hard links. As a
# workaround, disable hard-linking if setup.py is a descendant of /vagrant.
# See
# https://stackoverflow.com/questions/7719380/python-setup-py-sdist-error-operation-not-permitted
# for more details.
if os.path.abspath(__file__).split(os.path.sep)[1] == 'vagrant':
del os.link
with open("README.rst") as readme:
description = readme.read()
setup(
# This is the human-targetted name of the software being packaged.
name="Flocker",
# This is a string giving the version of the software being packaged. For
# simplicity it should be something boring like X.Y.Z.
version=versioneer.get_version(),
# This identifies the creators of this software. This is left symbolic for
# ease of maintenance.
author="ClusterHQ Team",
# This is contact information for the authors.
author_email="support@clusterhq.com",
# Here is a website where more information about the software is available.
url="https://clusterhq.com/",
# A short identifier for the license under which the project is released.
license="Apache License, Version 2.0",
# Some details about what Flocker is. Synchronized with the README.rst to
# keep it up to date more easily.
long_description=description,
# This setuptools helper will find everything that looks like a *Python*
# package (in other words, things that can be imported) which are part of
# the Flocker package.
packages=find_packages(exclude=('admin', 'admin.*')),
package_data={
'flocker.node.functional': ['sendbytes-docker/*', 'env-docker/*'],
},
entry_points = {
# Command-line programs we want setuptools to install:
'console_scripts': [
'flocker-volume = flocker.volume.script:flocker_volume_main',
'flocker-deploy = flocker.cli.script:flocker_deploy_main',
'flocker-changestate = flocker.node.script:flocker_changestate_main',
'flocker-reportstate = flocker.node.script:flocker_reportstate_main',
'flocker-serve = flocker.node.script:flocker_serve_main',
],
},
install_requires=[
# Any changes here must be reflected in ``python-flocker.spec.in`` so
# that RPM dependencies match.
# They must also be reflected in the yumdownloader lines in
# "Appendix: Pre-populating RPM Repository" in the Release Process.
"setuptools >= 1.4",
"eliot == 0.4.0",
"zope.interface >= 4.0.5",
"pytz",
"characteristic >= 14.1.0",
"Twisted == 14.0.0",
"PyYAML == 3.10",
"treq == 0.2.1",
"psutil == 2.1.2",
"netifaces >= 0.8",
"ipaddr == 2.1.10",
"docker-py == 0.5.0",
"jsonschema == 2.4.0",
"klein == 0.2.3",
],
extras_require={
# This extra allows you to build and check the documentation for
# Flocker.
"doc": [
"Sphinx==1.2.2",
"sphinx-rtd-theme==0.1.6",
"pyenchant==1.6.6",
"sphinxcontrib-spelling==2.1.1",
],
# This extra is for developers who need to work on Flocker itself.
"dev": [
# flake8 is pretty critical to have around to help point out
# obvious mistakes. It depends on PEP8, pyflakes and mccabe.
"pyflakes==0.8.1",
"pep8==1.5.7",
"mccabe==0.2.1",
"flake8==2.2.0",
# Run the test suite:
"tox==1.7.1",
# versioneer is necessary in order to update (but *not* merely to
# use) the automatic versioning tools.
"versioneer==0.10",
# Some of the tests use Conch:
"PyCrypto==2.6.1",
"pyasn1==0.1.7",
# The test suite uses network namespaces
"nomenclature >= 0.1.0",
# The acceptance tests interact with MongoDB
"pymongo>=2.7.2"
],
# This extra is for Flocker release engineers to set up their release
# environment.
"release": [
"gsutil",
"wheel",
"virtualenv",
"PyCrypto",
"pyasn1",
],
},
cmdclass=cmdclass,
# Some "trove classifiers" which are relevant.
classifiers=[
"License :: OSI Approved :: Apache Software License",
],
)