forked from fedora-infra/bodhi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
170 lines (151 loc) · 5.49 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
import __main__
__requires__ = __main__.__requires__ = 'WebOb>=1.4.1'
import pkg_resources # noqa
# The following two imports are required to shut up an
# atexit error when running tests with python 2.7
from setuptools import setup, find_packages # noqa
import logging # noqa
import multiprocessing # noqa
import os # noqa
import setuptools.command.egg_info # noqa
import sys # noqa
def get_requirements(requirements_file='requirements.txt'):
"""
Get the contents of a file listing the requirements.
Args:
requirements_file (str): path to a requirements file
Returns:
list: the list of requirements, or an empty list if
`requirements_file` could not be opened or read
"""
lines = open(requirements_file).readlines()
dependencies = []
for line in lines:
maybe_dep = line.strip()
if maybe_dep.startswith('#'):
# Skip pure comment lines
continue
if maybe_dep.startswith('git+'):
# VCS reference for dev purposes, expect a trailing comment
# with the normal requirement
__, __, maybe_dep = maybe_dep.rpartition('#')
else:
# Ignore any trailing comment
maybe_dep, __, __ = maybe_dep.partition('#')
# Remove any whitespace and assume non-empty results are dependencies
maybe_dep = maybe_dep.strip()
if maybe_dep:
dependencies.append(maybe_dep)
return dependencies
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
VERSION = '3.3.0'
# Possible options are at https://pypi.python.org/pypi?%3Aaction=list_classifiers
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.7',
'Topic :: System :: Software Distribution']
LICENSE = 'GPLv2+'
MAINTAINER = 'Fedora Infrastructure Team'
MAINTAINER_EMAIL = '[email protected]'
PLATFORMS = ['Fedora', 'GNU/Linux']
URL = 'https://github.com/fedora-infra/bodhi'
setuptools.command.egg_info.manifest_maker.template = 'BODHI_MANIFEST.in'
setup(
name='bodhi',
version=VERSION,
description='bodhi common package',
long_description=README,
classifiers=CLASSIFIERS,
license=LICENSE,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
platforms=PLATFORMS,
url=URL,
keywords='fedora',
packages=['bodhi'],
include_package_data=True,
zip_safe=False,
install_requires=[],
tests_require=[
'flake8',
'pytest',
'pytest-cov',
'pyyaml',
'webtest',
'mock',
],
)
setuptools.command.egg_info.manifest_maker.template = 'CLIENT_MANIFEST.in'
setup(
name='bodhi-client',
version=VERSION,
description='bodhi client',
long_description=README,
classifiers=CLASSIFIERS,
license=LICENSE,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
platforms=PLATFORMS,
url=URL,
keywords='fedora',
packages=['bodhi.client'],
include_package_data=False,
zip_safe=False,
install_requires=['click', 'iniparse', 'python-fedora >= 0.9.0', 'six'],
entry_points="""\
[console_scripts]
bodhi = bodhi.client:cli
""")
setuptools.command.egg_info.manifest_maker.template = 'SERVER_MANIFEST.in'
# Due to https://github.com/pypa/setuptools/issues/808, we need to include the bodhi superpackage
# and then remove it if we want find_packages() to find the bodhi.server package and its
# subpackages without including the bodhi top level package.
server_packages = find_packages(
exclude=['bodhi.client', 'bodhi.client.*', 'bodhi.tests', 'bodhi.tests.*'])
server_packages.remove('bodhi')
setup(
name='bodhi-server',
version=VERSION,
description='bodhi server',
long_description=README,
classifiers=CLASSIFIERS + [
'Framework :: Pyramid',
'Programming Language :: JavaScript',
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application"],
license=LICENSE,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
platforms=PLATFORMS,
url=URL,
keywords='web fedora pyramid',
packages=server_packages,
include_package_data=True,
zip_safe=False,
install_requires=get_requirements(),
message_extractors={'.': []},
entry_points="""\
[paste.app_factory]
main = bodhi.server:main
[console_scripts]
initialize_bodhi_db = bodhi.server.scripts.initializedb:main
bodhi-clean-old-mashes = bodhi.server.scripts.clean_old_mashes:clean_up
bodhi-dequeue-stable = bodhi.server.scripts.dequeue_stable:dequeue_stable
bodhi-push = bodhi.server.push:push
bodhi-expire-overrides = bodhi.server.scripts.expire_overrides:main
bodhi-monitor-composes = bodhi.server.scripts.monitor_composes:monitor
bodhi-untag-branched = bodhi.server.scripts.untag_branched:main
bodhi-approve-testing = bodhi.server.scripts.approve_testing:main
bodhi-manage-releases = bodhi.server.scripts.manage_releases:main
bodhi-check-policies = bodhi.server.scripts.check_policies:check
[moksha.consumer]
masher = bodhi.server.consumers.masher:Masher
updates = bodhi.server.consumers.updates:UpdatesHandler
signed = bodhi.server.consumers.signed:SignedHandler
""",
paster_plugins=['pyramid'])