diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-08 02:25:53 -0500 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-08 02:25:53 -0500 |
commit | ad7f41bd574108e96c87510701e7653b78bd2729 (patch) | |
tree | 41903dec48e5d1018b3baadcb0fc2b619873dc51 /python | |
parent | a270576f535b8ad4bf949be325aab1f0c488078e (diff) | |
parent | b460610b69b8ab9096e3da9423379200fefad3a5 (diff) |
Merge pull request #50 from dlitz/compat-py3k
setup.py fixes for Python 3
Diffstat (limited to 'python')
-rwxr-xr-x | python/setup.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/python/setup.py b/python/setup.py index 19f1e698..22a2c98f 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" @@ -189,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, |