Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ test = [
'mypy>=0.800',
]
dev = [
'packaging',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also need this in build-system.requires, so that people who install from the src tarball overriding cython-always, would succeed. It's a marginal case though.

'setuptools>=60',
'Cython~=3.0',
]
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ def finalize_options(self):
need_cythonize = True

if need_cythonize:
import pkg_resources
from packaging.requirements import Requirement
from packaging.version import Version

# Double check Cython presence in case setup_requires
# didn't go into effect (most likely because someone
Expand All @@ -121,8 +122,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 not cython_dep.specifier.contains(Version(Cython.__version__)):
raise RuntimeError(
'uvloop requires {}, got Cython=={}'.format(
CYTHON_DEPENDENCY, Cython.__version__
Expand Down
Loading