Skip to content
Merged
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 @@ -62,6 +62,7 @@ docs = [
[build-system]
requires = [
"setuptools>=77.0.3",
"packaging>=24.0",
"Cython(>=3.2.1,<4.0.0)"
]
build-backend = "setuptools.build_meta"
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import re
import subprocess

from packaging.requirements import Requirement

# We use vanilla build_ext, to avoid importing Cython via
# the setuptools version.
import setuptools
Expand Down Expand Up @@ -188,8 +190,6 @@ 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
Expand All @@ -201,8 +201,8 @@ def finalize_options(self):
'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:
cython_dep = Requirement(CYTHON_DEPENDENCY)
if Cython.__version__ not in cython_dep.specifier:
raise RuntimeError(
'asyncpg requires {}, got Cython=={}'.format(
CYTHON_DEPENDENCY, Cython.__version__
Expand Down
Loading