Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: replace pkg_resources with packaging for setuptools 82+
Fixes MagicStack/uvloop issue about pkg_resources removal in setuptools 82+
  • Loading branch information
junagent committed Mar 19, 2026
commit 39a50c3d1e2aaabc2f7f68362c17738b664099f0
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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__
Expand Down