Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using pkg_resources in PIL.features.pilinfo #4975

Merged
merged 1 commit into from Oct 14, 2020

Conversation

nulano
Copy link
Contributor

@nulano nulano commented Oct 13, 2020

Instead of using pkg_resources, which AFAICT is part of setuptools, check the LCMS version (check added in #4963) manually.

While setuptools is very likely to already be installed, Pillow doesn't actually require it for runtime, only compilation and testing. Additionally, the pilinfo function is useful for finding configuration issues and should have as few external dependencies as possible.

Since this version string is being set in the C code, it is safe to break it back into ints and perform a tuple comparison instead.
This PR also adds a comment to make sure the two checks don't get out of sync.

@hugovk
Copy link
Member

hugovk commented Oct 14, 2020

Yep, pkg_resources is part of setuptools, and is likely to be installed (it's used by setup.py), some users of flit (or poetry?) might not have setuptools.

@hugovk hugovk merged commit ca42412 into python-pillow:master Oct 14, 2020
@nulano nulano deleted the features-setuptools branch October 14, 2020 19:00
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.

None yet

2 participants