|
8 | 8 | ]
|
9 | 9 | extras_require = {}
|
10 | 10 | entry_points = {}
|
| 11 | +ext_modules = None |
11 | 12 |
|
12 | 13 | if sys.version_info < (3, 4):
|
13 | 14 | # trollius is just a backport of 3.4 asyncio module
|
14 | 15 | install_requires.append('trollius')
|
15 | 16 |
|
16 |
| -has_cython = False |
17 |
| -if not platform.python_implementation() == 'PyPy': |
| 17 | +if platform.python_implementation() != 'PyPy': |
18 | 18 | # pypy already includes an implementation of the greenlet module
|
19 | 19 | install_requires.append('greenlet')
|
20 |
| - try: |
| 20 | + |
| 21 | + # Experimental GUI only supported for Python 2. |
| 22 | + if sys.version_info < (3, 0): |
21 | 23 | # Cythonizing screen.py to improve scrolling/clearing speed. Maybe the
|
22 | 24 | # performance can be improved even further by writing a screen.pxd with
|
23 | 25 | # 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 |
28 | 31 |
|
29 | 32 | if sys.version_info < (3, 0):
|
30 | 33 | # Experimental GUI only supported for Python 2.
|
|
42 | 45 | packages=['neovim', 'neovim.api', 'neovim.msgpack_rpc', 'neovim.ui',
|
43 | 46 | 'neovim.msgpack_rpc.event_loop', 'neovim.plugin'],
|
44 | 47 | install_requires=install_requires,
|
45 |
| - ext_modules=cythonize('neovim/ui/screen.py') if has_cython else None, |
| 48 | + ext_modules=ext_modules, |
46 | 49 | extras_require=extras_require,
|
47 | 50 | entry_points=entry_points,
|
48 | 51 | zip_safe=False)
|
0 commit comments