Skip to content

Remove unused *_ROOT globals from setup.py#9767

Closed
hugovk wants to merge 1 commit into
python-pillow:mainfrom
hugovk:simplify-build_extensions
Closed

Remove unused *_ROOT globals from setup.py#9767
hugovk wants to merge 1 commit into
python-pillow:mainfrom
hugovk:simplify-build_extensions

Conversation

@hugovk

@hugovk hugovk commented Jul 4, 2026

Copy link
Copy Markdown
Member

And simplify library root detection in build_extensions().

@hugovk hugovk added Cleanup Packaging Any mention of setup.py; some overlap with Install label labels Jul 4, 2026
@radarhere

Copy link
Copy Markdown
Member

In PIL, theses looked like

# --------------------------------------------------------------------
# Library pointers.
#
# Use None to look for the libraries in well-known library locations.
# Use a string to specify a single directory, for both the library and
# the include files.  Use a tuple to specify separate directories:
# (libpath, includepath).  Examples:
#
# JPEG_ROOT = "/home/libraries/jpeg-6b"
# TIFF_ROOT = "/opt/tiff/lib", "/opt/tiff/include"
#
# If you have "lib" and "include" directories under a common parent,
# you can use the "libinclude" helper:
#
# TIFF_ROOT = libinclude("/opt/tiff")

TCL_ROOT = None
JPEG_ROOT = None
ZLIB_ROOT = None
TIFF_ROOT = None
FREETYPE_ROOT = None
LCMS_ROOT = None

I think the expectation was for people building from source to patch these. https://github.com/conda-forge/pillow-feedstock/blob/main/recipe/patches/0003-add-XCB_ROOT.patch sort of does this.

You are asserting though that we have better mechanisms now, like ddb01ac, yes?

@hugovk

hugovk commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

Hmm, those comments have been gone since 2010.

That patch sets a global XCB_ROOT = None, not an actual value. Just a copy/paste of the neighbouring code.

But I found some use of them here:

https://github.com/NixOS/nixpkgs/blob/5ee04f2d21cb7907546b70ce94c4ae1d5529efab/pkgs/development/python-modules/pillow/default.nix#L89-L91

Let's leave this be, then.

@hugovk hugovk closed this Jul 6, 2026
@hugovk hugovk deleted the simplify-build_extensions branch July 6, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cleanup Packaging Any mention of setup.py; some overlap with Install label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants