diff --git a/setup.py b/setup.py index 770a927e..6dd474bd 100755 --- a/setup.py +++ b/setup.py @@ -14,6 +14,7 @@ except IOError: README = '' OLD_PYTHON = sys.version_info < (2, 7) +PYTHON_3 = sys.version_info > (2,) def compile_client(): @@ -21,12 +22,6 @@ def compile_client(): if hasattr(sys, 'getwindowsversion'): raise NotImplementedError() - if sys.version_info >= (3, 0): - # FIXME Python 3 doesn't allow compiled C files to be included in the - # scripts list below. This is because Python 3 distutils tries to - # decode the file to ASCII, and fails when powerline-client is - # a binary. - raise NotImplementedError() else: from distutils.ccompiler import new_compiler compiler = new_compiler().compiler @@ -49,13 +44,16 @@ setup( author='Kim Silkebaekken', author_email='kim.silkebaekken+vim@gmail.com', url='https://github.com/Lokaltog/powerline', + # FIXME Python 3 doesn't allow compiled C files to be included in the + # scripts list below. This is because Python 3 distutils tries to decode the + # file to ASCII, and fails when powerline-client is a binary. scripts=[ - 'scripts/powerline', 'scripts/powerline-lint', 'scripts/powerline-daemon', 'scripts/powerline-render', 'scripts/powerline-config', - ], + ] + ([] if PYTHON_3 else ['scripts/powerline']), + data_files=([('bin', ['scripts/powerline'])] if PYTHON_3 else None), keywords='', packages=find_packages(exclude=('tests', 'tests.*')), include_package_data=True,