Skip to content

Drop the Cython version check from setup.py#1314

Open
musicinmybrain wants to merge 1 commit intoMagicStack:masterfrom
musicinmybrain:no-pkg_resources
Open

Drop the Cython version check from setup.py#1314
musicinmybrain wants to merge 1 commit intoMagicStack:masterfrom
musicinmybrain:no-pkg_resources

Conversation

@musicinmybrain
Copy link
Contributor

This avoids the dependency on the pkg_resources module, which has long been deprecated and is no longer shipped with current versions of setuptools.


The version check could have preserved by replacing

           import pkg_resources
           # …
           cython_dep = pkg_resources.Requirement.parse(CYTHON_DEPENDENCY)
           if Cython.__version__ not in cython_dep:

with

           from packaging.requirements import Requirement
           # …
           cython_dep = Requirement(CYTHON_DEPENDENCY)
           if not cython_dep.specifier.contains(Cython.__version__):

but then we would need to add a dependency on packaging to build-system.requires in pyproject.toml, and if we can trust build-system.requires to give us packaging, then we should be able to trust it to give us the correct version of Cython, too!

This avoids the dependency on the pkg_resources module, which has long
been deprecated and is no longer shipped with current versions of
setuptools.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant