4
4
5
5
import os
6
6
import platform
7
+ import sys
7
8
8
9
from distutils .command .build import build
9
10
@@ -132,6 +133,35 @@ def initialize_options(self):
132
133
]
133
134
data_files .extend (man_pages )
134
135
136
+ extras_require = {
137
+ 'urwid' : ['urwid' ]
138
+ }
139
+
140
+ packages = ['bpython' , 'bpython.test' , 'bpython.translations' , 'bpdb' ]
141
+
142
+ entry_points = {
143
+ 'console_scripts' : [
144
+ 'bpython = bpython.cli:main' ,
145
+ 'bpython-urwid = bpython.urwid:main [urwid]'
146
+ ],
147
+ 'gui_scripts' : [
148
+ 'bpython-gtk = bpython.gtk_:main'
149
+ ]
150
+ }
151
+
152
+ scripts = [] if using_setuptools else ['data/bpython' ,
153
+ 'data/bpython-gtk' ,
154
+ 'data/bpython-urwid' ]
155
+
156
+ if sys .version_info [:2 ] >= (2 , 6 ):
157
+ # curtsies only supports 2.6 and onwards
158
+ extras_require ['curtsies' ] = ['curtsies>=0.0.32' , 'greenlet' ]
159
+ packages .append ("bpython.curtsiesfrontend" )
160
+ entry_points ['console_scripts' ].append (
161
+ 'bpython-curtsies = bpython.curtsies:main [curtsies]' )
162
+ if not using_setuptools :
163
+ scripts .append ('data/bpython-curtsies' )
164
+
135
165
# translations
136
166
mo_files = list ()
137
167
for language in os .listdir (translations_dir ):
@@ -152,32 +182,17 @@ def initialize_options(self):
152
182
install_requires = [
153
183
'pygments'
154
184
],
155
- extras_require = {
156
- 'curtsies' : ['curtsies>=0.0.32' , 'greenlet' ],
157
- 'urwid' : ['urwid' ]
158
- },
185
+ extras_require = extras_require ,
159
186
tests_require = ['mock' ],
160
- packages = [ "bpython" , "bpython.test" , "bpython.translations" , "bpdb" , "bpython.curtsiesfrontend" ] ,
187
+ packages = packages ,
161
188
data_files = data_files ,
162
189
package_data = {
163
190
'bpython' : ['logo.png' ],
164
191
'bpython.translations' : mo_files ,
165
192
'bpython.test' : ['test.config' , 'test.theme' ]
166
193
},
167
- entry_points = {
168
- 'console_scripts' : [
169
- 'bpython = bpython.cli:main' ,
170
- 'bpython-urwid = bpython.urwid:main [urwid]' ,
171
- 'bpython-curtsies = bpython.curtsies:main [curtsies]' ,
172
- ],
173
- 'gui_scripts' : [
174
- 'bpython-gtk = bpython.gtk_:main'
175
- ]
176
- },
177
- scripts = ([] if using_setuptools else ['data/bpython' ,
178
- 'data/bpython-gtk' ,
179
- 'data/bpython-curtsies' ,
180
- 'data/bpython-urwid' ]),
194
+ entry_points = entry_points ,
195
+ scripts = scripts ,
181
196
cmdclass = cmdclass ,
182
197
test_suite = 'bpython.test'
183
198
)
0 commit comments