Author: Matti Picus <[email protected]>
Branch:
Changeset: r97929:8f3a6314492e
Date: 2019-11-01 05:51 -0400
http://bitbucket.org/pypy/pypy/changeset/8f3a6314492e/
Log: make print in package.py 3-compatible
diff --git a/pypy/tool/release/package.py b/pypy/tool/release/package.py
--- a/pypy/tool/release/package.py
+++ b/pypy/tool/release/package.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+from __future__ import print_function
""" packages PyPy, provided that it's already built.
It uses 'pypy/goal/pypy-c' and parts of the rest of the working
copy. Usage:
@@ -21,7 +22,9 @@
import fnmatch
import subprocess
import glob
+import platform
from pypy.tool.release.smartstrip import smartstrip
+from pypy.tool.release.make_portable import make_portable
USE_ZIPFILE_MODULE = sys.platform == 'win32'
@@ -89,10 +92,11 @@
)
for key, module in failures:
- print >>sys.stderr, """!!!!!!!!!!\nBuilding {0} bindings failed.
+ print("""!!!!!!!!!!\nBuilding {0} bindings failed.
You can either install development headers package,
add the --without-{0} option to skip packaging this
- binary CFFI extension, or say --without-cffi.""".format(key)
+ binary CFFI extension, or say --without-cffi.""".format(key),
+ file=sys.stderr)
if len(failures) > 0:
return 1, None
@@ -129,7 +133,7 @@
if pypyw.exists():
tgt = py.path.local(tgt)
binaries.append((pypyw, tgt.new(purebasename=tgt.purebasename +
'w').basename, None))
- print "Picking %s" % str(pypyw)
+ print("Picking %s" % str(pypyw))
# Can't rename a DLL: it is always called 'libpypy-c.dll'
win_extras = [('libpypy-c.dll', None), ('sqlite3.dll', lib_pypy)]
if not options.no_tk:
@@ -141,18 +145,19 @@
if not p.check():
p = py.path.local.sysfind(extra)
if not p:
- print "%s not found, expect trouble if this is a shared
build" % (extra,)
+ print("%s not found, expect trouble if this "
+ "is a shared build" % (extra,))
continue
- print "Picking %s" % p
+ print("Picking %s" % p)
binaries.append((p, p.basename, target_dir))
libsdir = basedir.join('libs')
if libsdir.exists():
- print 'Picking %s (and contents)' % libsdir
+ print('Picking %s (and contents)' % libsdir)
shutil.copytree(str(libsdir), str(pypydir.join('libs')))
else:
- print '"libs" dir with import library not found.'
- print 'You have to create %r' % (str(libsdir),)
- print 'and copy libpypy-c.lib in there, renamed to python27.lib'
+ print('"libs" dir with import library not found.')
+ print('You have to create %r' % (str(libsdir),))
+ print('and copy libpypy-c.lib in there, renamed to python27.lib')
# XXX users will complain that they cannot compile capi (cpyext)
# modules for windows, also embedding pypy (i.e. in cffi)
# will fail.
@@ -169,14 +174,15 @@
tktcldir = p.dirpath().join('..').join('lib')
shutil.copytree(str(tktcldir), str(pypydir.join('tcl')))
except WindowsError:
- print >>sys.stderr, r"""Packaging Tk runtime failed.
-tk85.dll and tcl85.dll found in %s, expecting to find runtime in %s
-directory next to the dlls, as per build instructions.""" %(p, tktcldir)
+ print("Packaging Tk runtime failed. tk85.dll and tcl85.dll "
+ "found in %s, expecting to find runtime in %s directory "
+ "next to the dlls, as per build "
+ "instructions." %(p, tktcldir), file=sys.stderr)
import traceback;traceback.print_exc()
raise MissingDependenciesError('Tk runtime')
- print '* Binaries:', [source.relto(str(basedir))
- for source, target, target_dir in binaries]
+ print('* Binaries:', [source.relto(str(basedir))
+ for source, target, target_dir in binaries])
# Careful: to copy lib_pypy, copying just the hg-tracked files
# would not be enough: there are also ctypes_config_cache/_*_cache.py.
@@ -243,10 +249,11 @@
else:
archive = str(builddir.join(name + '.tar.bz2'))
if sys.platform == 'darwin':
- print >>sys.stderr, """Warning: tar on current platform does
not suport overriding the uid and gid
-for its contents. The tarball will contain your uid and gid. If you are
-building the actual release for the PyPy website, you may want to be
-using another platform..."""
+ print("Warning: tar on current platform does not suport "
+ "overriding the uid and gid for its contents. The
tarball "
+ "will contain your uid and gid. If you are building the "
+ "actual release for the PyPy website, you may want to be
"
+ "using another platform...", file=sys.stderr)
e = os.system('tar --numeric-owner -cvjf ' + archive + " " +
name)
elif sys.platform.startswith('freebsd'):
e = os.system('tar --uname=root --gname=wheel -cvjf ' +
archive + " " + name)
@@ -259,10 +266,10 @@
finally:
os.chdir(old_dir)
if options.targetdir:
- print "Copying %s to %s" % (archive, options.targetdir)
+ print("Copying %s to %s" % (archive, options.targetdir))
shutil.copy(archive, options.targetdir)
else:
- print "Ready in %s" % (builddir,)
+ print("Ready in %s" % (builddir,))
return retval, builddir # for tests
def package(*args, **kwds):
@@ -310,7 +317,7 @@
dest='embed_dependencies',
action=NegateAction,
default=(sys.platform == 'darwin'),
- help='whether to embed dependencies for distribution '
+ help='whether to embed dependencies in CFFI modules '
'(default on OS X)')
options = parser.parse_args(args)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit