From 969376ff0064d1b403fc884414ca414a3519d366 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 26 Mar 2026 22:53:15 +0000 Subject: [PATCH] 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. --- setup.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) 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',