diff --git a/setup.py b/setup.py index 32d94ae8..a4055516 100644 --- a/setup.py +++ b/setup.py @@ -108,7 +108,7 @@ def finalize_options(self): need_cythonize = True if need_cythonize: - import pkg_resources + from packaging.requirements import Requirement # Double check Cython presence in case setup_requires # didn't go into effect (most likely because someone @@ -121,8 +121,8 @@ def finalize_options(self): 'please install {} to compile uvloop from source'.format( CYTHON_DEPENDENCY)) - cython_dep = pkg_resources.Requirement.parse(CYTHON_DEPENDENCY) - if Cython.__version__ not in cython_dep: + cython_dep = Requirement(CYTHON_DEPENDENCY) + if Cython.__version__ not in str(cython_dep.specifier): raise RuntimeError( 'uvloop requires {}, got Cython=={}'.format( CYTHON_DEPENDENCY, Cython.__version__