forked from benoitc/restkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·109 lines (91 loc) · 3.06 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
#!/usr/bin/env python
# -*- coding: utf-8 -
#
# This file is part of restkit released under the MIT license.
# See the NOTICE for more information.
from __future__ import with_statement
try:
from setuptools import setup
use_setuptools = True
except ImportError:
from distutils.core import setup
use_setuptools = False
import glob
from imp import load_source
import os
import sys
if not hasattr(sys, 'version_info') or sys.version_info < (2, 5, 0, 'final'):
raise SystemExit("Restkit requires Python 2.5 or later.")
extras = {}
try:
import ssl
except ImportError:
sys.stderr.write("Warning: On python 2.5x, https support requires "
+ " ssl module (http://pypi.python.org/pypi/ssl) "
+ "to be intalled.")
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Libraries']
MODULES = [
"restkit",
"restkit.contrib",
"restkit.manager"]
SCRIPTS = ['scripts/restcli']
def main():
version = load_source("version", os.path.join("restkit",
"version.py"))
# read long description
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
long_description = f.read()
PACKAGES = {}
for name in MODULES:
PACKAGES[name] = name.replace(".", "/")
DATA_FILES = [
('restkit', ["LICENSE", "MANIFEST.in", "NOTICE", "README.rst",
"THANKS", "TODO.txt"])
]
options=dict(
name = 'restkit',
version = version.__version__,
description = 'Python REST kit',
long_description = long_description,
author = 'Benoit Chesneau',
author_email = '[email protected]',
license = 'BSD',
url = 'http://benoitc.github.com/restkit',
classifiers = CLASSIFIERS,
packages = PACKAGES.keys(),
package_dir = PACKAGES,
data_files = DATA_FILES,
scripts = SCRIPTS
)
if use_setuptools:
options.update({
'zip_safe': False,
'entry_points': {
'paste.app_factory': [
'proxy = restkit.contrib.wsgi_proxy:make_proxy',
'host_proxy = restkit.contrib.wsgi_proxy:make_host_proxy',
'couchdb_proxy = restkit.contrib.wsgi_proxy:make_couchdb_proxy',
]},
'install_requires': ['http-parser>=0.5.4']})
# Python 3: run 2to3
try:
from distutils.command.build_py import build_py_2to3
from distutils.command.build_scripts import build_scripts_2to3
except ImportError:
pass
else:
options['cmdclass'] = {
'build_py': build_py_2to3,
'build_scripts': build_scripts_2to3,
}
setup(**options)
if __name__ == "__main__":
main()