##// END OF EJS Templates
added argparse for python version <2.7
marcink -
r3230:bda2bd25 beta
parent child Browse files
Show More
@@ -1,167 +1,168 b''
1 1 import os
2 2 import sys
3 3 import platform
4 4
5 5 if sys.version_info < (2, 5):
6 6 raise Exception('RhodeCode requires python 2.5 or later')
7 7
8 8
9 9 here = os.path.abspath(os.path.dirname(__file__))
10 10
11 11
12 12 def _get_meta_var(name, data, callback_handler=None):
13 13 import re
14 14 matches = re.compile(r'(?:%s)\s*=\s*(.*)' % name).search(data)
15 15 if matches:
16 16 if not callable(callback_handler):
17 17 callback_handler = lambda v: v
18 18
19 19 return callback_handler(eval(matches.groups()[0]))
20 20
21 21 _meta = open(os.path.join(here, 'rhodecode', '__init__.py'), 'rb')
22 22 _metadata = _meta.read()
23 23 _meta.close()
24 24
25 25 callback = lambda V: ('.'.join(map(str, V[:3])) + '.'.join(V[3:]))
26 26 __version__ = _get_meta_var('VERSION', _metadata, callback)
27 27 __license__ = _get_meta_var('__license__', _metadata)
28 28 __author__ = _get_meta_var('__author__', _metadata)
29 29 __url__ = _get_meta_var('__url__', _metadata)
30 30 # defines current platform
31 31 __platform__ = platform.system()
32 32
33 33 is_windows = __platform__ in _get_meta_var('PLATFORM_WIN', _metadata)
34 34
35 35 requirements = [
36 36 "waitress==0.8.1",
37 37 "webob==1.0.8",
38 38 "Pylons==1.0.0",
39 39 "Beaker==1.6.4",
40 40 "WebHelpers==1.3",
41 41 "formencode==1.2.4",
42 42 "SQLAlchemy==0.7.9",
43 43 "Mako==0.7.3",
44 44 "pygments>=1.5",
45 45 "whoosh>=2.4.0,<2.5",
46 46 "celery>=2.2.5,<2.3",
47 47 "babel",
48 48 "python-dateutil>=1.5.0,<2.0.0",
49 49 "dulwich>=0.8.7,<0.9.0",
50 50 "markdown==2.2.1",
51 51 "docutils==0.8.1",
52 52 "simplejson==2.5.2",
53 53 "mock",
54 54 ]
55 55
56 56 if sys.version_info < (2, 6):
57 57 requirements.append("pysqlite")
58 58
59 59 if sys.version_info < (2, 7):
60 60 requirements.append("unittest2")
61 requirements.append("argparse")
61 62
62 63 if is_windows:
63 64 requirements.append("mercurial==2.4.2")
64 65 else:
65 66 requirements.append("py-bcrypt")
66 67 requirements.append("mercurial==2.4.2")
67 68
68 69
69 70 dependency_links = [
70 71 ]
71 72
72 73 classifiers = [
73 74 'Development Status :: 4 - Beta',
74 75 'Environment :: Web Environment',
75 76 'Framework :: Pylons',
76 77 'Intended Audience :: Developers',
77 78 'License :: OSI Approved :: GNU General Public License (GPL)',
78 79 'Operating System :: OS Independent',
79 80 'Programming Language :: Python',
80 81 'Programming Language :: Python :: 2.5',
81 82 'Programming Language :: Python :: 2.6',
82 83 'Programming Language :: Python :: 2.7',
83 84 ]
84 85
85 86
86 87 # additional files from project that goes somewhere in the filesystem
87 88 # relative to sys.prefix
88 89 data_files = []
89 90
90 91 # additional files that goes into package itself
91 92 package_data = {'rhodecode': ['i18n/*/LC_MESSAGES/*.mo', ], }
92 93
93 94 description = ('Mercurial repository browser/management with '
94 95 'build in push/pull server and full text search')
95 96 keywords = ' '.join(['rhodecode', 'rhodiumcode', 'mercurial', 'git',
96 97 'code review', 'repo groups', 'ldap'
97 98 'repository management', 'hgweb replacement'
98 99 'hgwebdir', 'gitweb replacement', 'serving hgweb', ])
99 100 # long description
100 101 try:
101 102 readme_file = 'README.rst'
102 103 changelog_file = 'docs/changelog.rst'
103 104 long_description = open(readme_file).read() + '\n\n' + \
104 105 open(changelog_file).read()
105 106
106 107 except IOError, err:
107 108 sys.stderr.write("[WARNING] Cannot find file specified as "
108 109 "long_description (%s)\n or changelog (%s) skipping that file" \
109 110 % (readme_file, changelog_file))
110 111 long_description = description
111 112
112 113
113 114 try:
114 115 from setuptools import setup, find_packages
115 116 except ImportError:
116 117 from ez_setup import use_setuptools
117 118 use_setuptools()
118 119 from setuptools import setup, find_packages
119 120 # packages
120 121 packages = find_packages(exclude=['ez_setup'])
121 122
122 123 setup(
123 124 name='RhodeCode',
124 125 version=__version__,
125 126 description=description,
126 127 long_description=long_description,
127 128 keywords=keywords,
128 129 license=__license__,
129 130 author=__author__,
130 131 author_email='marcin@python-works.com',
131 132 dependency_links=dependency_links,
132 133 url=__url__,
133 134 install_requires=requirements,
134 135 classifiers=classifiers,
135 136 setup_requires=["PasteScript>=1.6.3"],
136 137 data_files=data_files,
137 138 packages=packages,
138 139 include_package_data=True,
139 140 test_suite='nose.collector',
140 141 package_data=package_data,
141 142 message_extractors={'rhodecode': [
142 143 ('**.py', 'python', None),
143 144 ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}),
144 145 ('templates/**.html', 'mako', {'input_encoding': 'utf-8'}),
145 146 ('public/**', 'ignore', None)]},
146 147 zip_safe=False,
147 148 paster_plugins=['PasteScript', 'Pylons'],
148 149 entry_points="""
149 150 [console_scripts]
150 151 rhodecode-api = rhodecode.bin.rhodecode_api:main
151 152
152 153 [paste.app_factory]
153 154 main = rhodecode.config.middleware:make_app
154 155
155 156 [paste.app_install]
156 157 main = pylons.util:PylonsInstaller
157 158
158 159 [paste.global_paster_command]
159 160 setup-rhodecode=rhodecode.config.setup_rhodecode:SetupCommand
160 161 cleanup-repos=rhodecode.lib.cleanup:CleanupCommand
161 162 update-repoinfo=rhodecode.lib.update_repoinfo:UpdateCommand
162 163 make-index=rhodecode.lib.indexers:MakeIndex
163 164 make-rcext=rhodecode.config.rcextensions.make_rcextensions:MakeRcExt
164 165 upgrade-db=rhodecode.lib.dbmigrate:UpgradeDb
165 166 celeryd=rhodecode.lib.celerypylons.commands:CeleryDaemonCommand
166 167 """,
167 168 )
General Comments 0
You need to be logged in to leave comments. Login now