125
125
f = file(batch_path, "w")
126
126
f.write(batch_str)
128
print("Created: %s" % batch_path)
130
e = sys.exc_info()[1]
131
print("ERROR: Unable to create %s: %s" % (batch_path, e))
128
print "Created:", batch_path
130
print "ERROR: Unable to create %s: %s" % (batch_path, e)
133
132
def _quoted_path(self, path):
172
171
from Pyrex.Distutils import build_ext
173
172
from Pyrex.Compiler.Version import version as pyrex_version
174
173
except ImportError:
175
print("No Pyrex, trying Cython...")
174
print "No Pyrex, trying Cython..."
176
175
from Cython.Distutils import build_ext
177
176
from Cython.Compiler.Version import version as pyrex_version
178
177
except ImportError:
179
178
have_pyrex = False
180
179
# try to build the extension from the prior generated source.
182
print("The python package 'Pyrex' is not available."
183
" If the .c files are available,")
184
print("they will be built,"
185
" but modifying the .pyx files will not rebuild them.")
181
print ("The python package 'Pyrex' is not available."
182
" If the .c files are available,")
183
print ("they will be built,"
184
" but modifying the .pyx files will not rebuild them.")
187
186
from distutils.command.build_ext import build_ext
189
188
have_pyrex = True
207
206
build_ext.run(self)
208
except DistutilsPlatformError:
209
e = sys.exc_info()[1]
207
except DistutilsPlatformError, e:
210
208
if not self.allow_python_fallback:
211
209
log.warn('\n Cannot build extensions.\n'
212
210
' Use "build_ext --allow-python-fallback" to use'
283
281
add_pyrex_extension('bzrlib._dirstate_helpers_pyx',
284
282
libraries=['Ws2_32'])
285
283
add_pyrex_extension('bzrlib._walkdirs_win32')
287
286
if have_pyrex and pyrex_version_info[:3] == (0,9,4):
288
287
# Pyrex 0.9.4.1 fails to compile this extension correctly
291
290
# which is NULL safe with PY_DECREF which is not.)
292
291
# <https://bugs.edge.launchpad.net/bzr/+bug/449372>
293
292
# <https://bugs.edge.launchpad.net/bzr/+bug/276868>
294
print('Cannot build extension "bzrlib._dirstate_helpers_pyx" using')
295
print('your version of pyrex "%s". Please upgrade your pyrex' % (
297
print('install. For now, the non-compiled (python) version will')
298
print('be used instead.')
293
print 'Cannot build extension "bzrlib._dirstate_helpers_pyx" using'
294
print 'your version of pyrex "%s". Please upgrade your pyrex' % (
296
print 'install. For now, the non-compiled (python) version will'
297
print 'be used instead.'
300
299
add_pyrex_extension('bzrlib._dirstate_helpers_pyx')
301
300
add_pyrex_extension('bzrlib._readdir_pyx')
302
add_pyrex_extension('bzrlib._chk_map_pyx')
302
add_pyrex_extension('bzrlib._chk_map_pyx', libraries=[z_lib])
303
303
ext_modules.append(Extension('bzrlib._patiencediff_c',
304
304
['bzrlib/_patiencediff_c.c']))
305
305
if have_pyrex and pyrex_version_info < (0, 9, 6, 3):
307
print('Your Pyrex/Cython version %s is too old to build the simple_set' % (
309
print('and static_tuple extensions.')
310
print('Please upgrade to at least Pyrex 0.9.6.3')
307
print 'Your Pyrex/Cython version %s is too old to build the simple_set' % (
309
print 'and static_tuple extensions.'
310
print 'Please upgrade to at least Pyrex 0.9.6.3'
312
312
# TODO: Should this be a fatal error?
314
314
# We only need 0.9.6.3 to build _simple_set_pyx, but static_tuple depends
322
322
if unavailable_files:
323
print('C extension(s) not found:')
324
print(' %s' % ('\n '.join(unavailable_files),))
325
print('The python versions will be used instead.')
323
print 'C extension(s) not found:'
324
print ' %s' % ('\n '.join(unavailable_files),)
325
print 'The python versions will be used instead.'
329
329
def get_tbzr_py2exe_info(includes, excludes, packages, console_targets,
534
534
install_data.run(self)
536
536
py2exe = self.distribution.get_command_obj('py2exe', False)
537
# GZ 2010-04-19: Setup has py2exe.optimize as 2, but give plugins
538
# time before living with docstring stripping
537
optimize = py2exe.optimize
540
538
compile_names = [f for f in self.outfiles if f.endswith('.py')]
541
539
byte_compile(compile_names,
542
540
optimize=optimize,
543
541
force=self.force, prefix=self.install_dir,
544
542
dry_run=self.dry_run)
545
self.outfiles.extend([f + 'o' for f in compile_names])
547
self.outfiles.extend([f + suffix for f in compile_names])
546
548
# end of class install_data_with_bytecompile
548
550
target = py2exe.build_exe.Target(script = "bzr",
679
681
# print this warning to stderr as output is redirected, so it is seen
680
682
# at build time. Also to stdout so it appears in the log
681
683
for f in (sys.stderr, sys.stdout):
682
f.write("Skipping TBZR binaries - "
683
"please set TBZR to a directory to enable\n")
685
"Skipping TBZR binaries - please set TBZR to a directory to enable"
685
687
# MSWSOCK.dll is a system-specific library, which py2exe accidentally pulls
690
692
"excludes": excludes,
691
693
"dll_excludes": dll_excludes,
692
694
"dist_dir": "win32_bzr.exe",
696
if __name__ == '__main__':
697
setup(options=options_list,
698
console=console_targets,
700
zipfile='lib/library.zip',
701
data_files=data_files,
702
cmdclass={'install_data': install_data_with_bytecompile},
699
setup(options=options_list,
700
console=console_targets,
702
zipfile='lib/library.zip',
703
data_files=data_files,
704
cmdclass={'install_data': install_data_with_bytecompile},
706
708
# ad-hoc for easy_install