diff --git a/setup.py b/setup.py index f9fafadf..d9f3a2d8 100644 --- a/setup.py +++ b/setup.py @@ -188,28 +188,17 @@ def finalize_options(self): need_cythonize = True if need_cythonize: - import pkg_resources - # Double check Cython presence in case setup_requires # didn't go into effect (most likely because someone # imported Cython before setup_requires injected the # correct egg into sys.path. try: - import Cython + from Cython.Build import cythonize except ImportError: raise RuntimeError( 'please install {} to compile asyncpg from source'.format( CYTHON_DEPENDENCY)) - cython_dep = pkg_resources.Requirement.parse(CYTHON_DEPENDENCY) - if Cython.__version__ not in cython_dep: - raise RuntimeError( - 'asyncpg requires {}, got Cython=={}'.format( - CYTHON_DEPENDENCY, Cython.__version__ - )) - - from Cython.Build import cythonize - directives = { 'language_level': '3', 'freethreading_compatible': 'True',