Skip to content

Commit 969376f

Browse files
Drop the Cython version check from setup.py
This avoids the dependency on the pkg_resources module, which has long been deprecated and is no longer shipped with current versions of setuptools.
1 parent db8ecc2 commit 969376f

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

setup.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -188,28 +188,17 @@ def finalize_options(self):
188188
need_cythonize = True
189189

190190
if need_cythonize:
191-
import pkg_resources
192-
193191
# Double check Cython presence in case setup_requires
194192
# didn't go into effect (most likely because someone
195193
# imported Cython before setup_requires injected the
196194
# correct egg into sys.path.
197195
try:
198-
import Cython
196+
from Cython.Build import cythonize
199197
except ImportError:
200198
raise RuntimeError(
201199
'please install {} to compile asyncpg from source'.format(
202200
CYTHON_DEPENDENCY))
203201

204-
cython_dep = pkg_resources.Requirement.parse(CYTHON_DEPENDENCY)
205-
if Cython.__version__ not in cython_dep:
206-
raise RuntimeError(
207-
'asyncpg requires {}, got Cython=={}'.format(
208-
CYTHON_DEPENDENCY, Cython.__version__
209-
))
210-
211-
from Cython.Build import cythonize
212-
213202
directives = {
214203
'language_level': '3',
215204
'freethreading_compatible': 'True',

0 commit comments

Comments
 (0)