This repository has been archived by the owner on May 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
/
setup.py
118 lines (98 loc) · 3.3 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
import os
import platform
import centrifuge
from setuptools import setup
def full_split(path, result=None):
"""
Split a path name into components (the opposite of os.path.join)
in a platform-neutral way.
"""
if result is None:
result = []
head, tail = os.path.split(path)
if head == '':
return [tail] + result
if head == path:
return result
return full_split(head, [tail] + result)
EXCLUDE_FROM_PACKAGES = ['centrifuge/bin']
def is_package(package_name):
for pkg in EXCLUDE_FROM_PACKAGES:
if package_name.startswith(pkg):
return False
return True
# Compile the list of packages available, because distutils doesn't have
# an easy way to do this.
packages, package_data = [], {}
root_dir = os.path.dirname(__file__)
if root_dir != '':
os.chdir(root_dir)
project_dir = 'centrifuge'
for dir_path, dir_names, file_names in os.walk(project_dir):
# Ignore PEP 3147 cache dirs and those whose names start with '.'
dir_names[:] = [
d for d in dir_names if not d.startswith('.') and d != '__pycache__'
]
parts = full_split(dir_path)
package_name = '/'.join(parts)
if '__init__.py' in file_names and is_package(package_name):
packages.append(package_name)
elif file_names:
relative_path = []
while '/'.join(parts) not in packages:
relative_path.append(parts.pop())
relative_path.reverse()
path = os.path.join(*relative_path)
package_files = package_data.setdefault('/'.join(parts), [])
package_files.extend([os.path.join(path, f) for f in file_names])
install_requires = [
'six>=1.3.0',
'tornado==4.2.1',
'sockjs-tornado==1.0.1',
'jsonschema==2.4.0',
'toro==0.8'
]
if platform.system() != "Windows":
# Redis engine does not work on Windows
install_requires.append("toredis-fork==0.1.4")
def long_description():
return "Simple real-time messaging in web applications"
setup(
name='centrifuge',
version=centrifuge.__version__,
description="Simple real-time messaging in web applications",
long_description=long_description(),
url='http://centrifugal.github.io',
download_url='https://github.com/centrifugal/centrifuge',
author="Alexandr Emelin",
author_email='[email protected]',
license='MIT',
packages=packages,
package_data=package_data,
include_package_data=True,
entry_points={
'console_scripts': [
'centrifuge = centrifuge.node:main',
],
},
install_requires=install_requires,
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development',
'Topic :: System :: Networking',
'Topic :: Text Processing',
'Topic :: Utilities'
]
)