Skip to content

Avoid using pkg_resources in PIL.features.pilinfo#4975

Merged
hugovk merged 1 commit intopython-pillow:masterfrom
nulano:features-setuptools
Oct 14, 2020
Merged

Avoid using pkg_resources in PIL.features.pilinfo#4975
hugovk merged 1 commit intopython-pillow:masterfrom
nulano:features-setuptools

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.

2 participants