From 6eca38e473a5521fb130db1d18f3fe17100d2868 Mon Sep 17 00:00:00 2001 From: Mikhail Korobov Date: Mon, 28 Sep 2015 02:09:04 +0500 Subject: [PATCH] setup.py cleanup * check for CPython instead of checking for PyPy; * don't install fastcache for Python 3.5 --- setup.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index a5aaadd..9a5fb9d 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ #!/usr/bin/env python import sys +import platform from setuptools import setup # from Cython.Build import cythonize @@ -23,7 +24,7 @@ def get_version(): # ], # } -is_pypy = '__pypy__' in sys.builtin_module_names +is_cpython = platform.python_implementation() == 'CPython' py_version = sys.version_info[:2] @@ -32,18 +33,17 @@ def get_version(): 'pymorphy2-dicts-ru >=2.4, <3.0', 'docopt >= 0.6', ] -extras_require = {'fast': []} - - if py_version < (3, 0): install_requires.append("backports.functools_lru_cache >= 1.0.1") -if not is_pypy: - extras_require['fast'].extend([ - "DAWG >= 0.7.7", - "fastcache >= 1.0.2", - ]) +extras_require = {'fast': []} +if is_cpython: + extras_require['fast'].append("DAWG >= 0.7.7") + if py_version < (3, 5): + # lru_cache is optimized in Python 3.5 + extras_require['fast'].append("fastcache >= 1.0.2") + setup( name='pymorphy2',