From 0fd260eae7a53483a4be5b265effba3daacd84c7 Mon Sep 17 00:00:00 2001 From: Dwayne Litzenberger Date: Tue, 14 Oct 2014 13:47:06 -0700 Subject: Use 2to3 when building under Python 3. --- python/setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/setup.py b/python/setup.py index 91565c18..99c1ca9f 100755 --- a/python/setup.py +++ b/python/setup.py @@ -20,7 +20,12 @@ except ImportError: "ez_setup installed.\n") raise from distutils.command.clean import clean as _clean -from distutils.command.build_py import build_py as _build_py +if sys.version_info[0] >= 3: + # Python 3 + from distutils.command.build_py import build_py_2to3 as _build_py +else: + # Python 2 + from distutils.command.build_py import build_py as _build_py from distutils.spawn import find_executable maintainer_email = "protobuf@googlegroups.com" -- cgit v1.2.3 From b460610b69b8ab9096e3da9423379200fefad3a5 Mon Sep 17 00:00:00 2001 From: Dwayne Litzenberger Date: Tue, 14 Oct 2014 13:50:00 -0700 Subject: Omit google-apputils dependency under Python 3 Temporary change until a py3k-compatible google-apputils is released. --- python/setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/setup.py b/python/setup.py index 99c1ca9f..7a8f5f1e 100755 --- a/python/setup.py +++ b/python/setup.py @@ -194,7 +194,11 @@ if __name__ == '__main__': 'google.protobuf.text_format'], cmdclass = { 'clean': clean, 'build_py': build_py }, install_requires = ['setuptools'], - setup_requires = ['google-apputils'], + # TODO: Restore dependency once a Python 3 compatible google-apputils + # is released. + setup_requires = (['google-apputils'] + if sys.version_info[0] < 3 else + []), ext_modules = ext_module_list, url = 'https://developers.google.com/protocol-buffers/', maintainer = maintainer_email, -- cgit v1.2.3