Skip to content

Commit 7f5b1d0

Browse files
committed
Disable cythonizing screen.py for Python 3. #120
The experimental GUI is only supported for Python 2, so cythonizing screen.py doesn't make sense on Python 3.
1 parent 5b42d8d commit 7f5b1d0

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

setup.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,26 @@
88
]
99
extras_require = {}
1010
entry_points = {}
11+
ext_modules = None
1112

1213
if sys.version_info < (3, 4):
1314
# trollius is just a backport of 3.4 asyncio module
1415
install_requires.append('trollius')
1516

16-
has_cython = False
17-
if not platform.python_implementation() == 'PyPy':
17+
if platform.python_implementation() != 'PyPy':
1818
# pypy already includes an implementation of the greenlet module
1919
install_requires.append('greenlet')
20-
try:
20+
21+
# Experimental GUI only supported for Python 2.
22+
if sys.version_info < (3, 0):
2123
# Cythonizing screen.py to improve scrolling/clearing speed. Maybe the
2224
# performance can be improved even further by writing a screen.pxd with
2325
# static type information
24-
from Cython.Build import cythonize
25-
has_cython = True
26-
except ImportError:
27-
pass
26+
try:
27+
from Cython.Build import cythonize
28+
ext_modules = cythonize('neovim/ui/screen.py')
29+
except ImportError:
30+
pass
2831

2932
if sys.version_info < (3, 0):
3033
# Experimental GUI only supported for Python 2.
@@ -42,7 +45,7 @@
4245
packages=['neovim', 'neovim.api', 'neovim.msgpack_rpc', 'neovim.ui',
4346
'neovim.msgpack_rpc.event_loop', 'neovim.plugin'],
4447
install_requires=install_requires,
45-
ext_modules=cythonize('neovim/ui/screen.py') if has_cython else None,
48+
ext_modules=ext_modules,
4649
extras_require=extras_require,
4750
entry_points=entry_points,
4851
zip_safe=False)

0 commit comments

Comments
 (0)