-
Notifications
You must be signed in to change notification settings - Fork 30
/
setup.py
executable file
·86 lines (70 loc) · 2.35 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import os
from itertools import chain
from setuptools import find_packages, setup
from celery_redis_sentinel import __author__, __version__
def read(fname):
with open(os.path.join(os.path.dirname(__file__), fname), 'rb') as fid:
return fid.read().decode('utf-8')
def remove_section_from_rst(text, section):
lines = text.splitlines()
section_line = lines.index(section)
separator = lines[section_line + 1]
assert set(separator) == {separator[0]}
next_section_line = next(
i for i, l in enumerate(lines[section_line + 2:])
if set(l) == {separator[0]}
)
return '\n'.join(chain(
lines[:section_line - 1],
lines[section_line + next_section_line:]
))
authors = read('AUTHORS.rst')
history = read('HISTORY.rst').replace('.. :changelog:', '')
licence = read('LICENSE.rst')
readme = read('README.rst')
requirements = read('requirements.txt').splitlines() + [
'setuptools',
]
test_requirements = (
read('requirements.txt').splitlines() +
read('requirements-dev.txt').splitlines()[1:]
)
long_description = remove_section_from_rst(
'\n\n'.join([readme, history, authors, licence]),
'Master (not yet on PyPI)'
)
setup(
name='celery-redis-sentinel',
version=__version__,
author=__author__,
description='Celery broker and results backend implementation for Redis Sentinel',
long_description=long_description,
url='https://github.com/dealertrack/celery-redis-sentinel',
license='MIT',
packages=find_packages(exclude=['tests', 'tests.*', 'test_tasks', 'test_tasks.*']),
install_requires=requirements,
test_suite='tests',
tests_require=test_requirements,
keywords=' '.join([
'celery',
'redis',
'sentinel',
'broker',
'results',
]),
classifiers=[
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Development Status :: 2 - Pre-Alpha',
],
)