Skip to content

Do not install unsupported Pillow for Python 3.8+ #9118

@hugovk

Description

@hugovk

Details

Expected Result

Unnecessary dependencies are not installed (related #8208), and do not slow down the build.

Actual Result

https://docs.readthedocs.io/en/stable/build-default-versions.html#external-dependencies says that Pillow 5.4.1 is an external dependency and that it "could be removed in the future".

We require Python 3.9 to build the PEPs docs and do not need Pillow.

Pillow 5.4.1 (released Jan 2019) supported Python 2.7 and 3.4-3.7, which means binary wheels are only available for those versions. Pillow 8.0 is the first version support to Python 3.9 with binary wheels:

This means Python 3.9 downloads the big sdist and builds from source, which is much slower than installing from wheel:

Collecting pillow==5.4.1
  Downloading Pillow-5.4.1.tar.gz (16.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.0/16.0 MB 136.4 MB/s eta 0:00:00
...
Building wheels for collected packages: mock, pillow, future
  Building wheel for mock (setup.py): started
  Building wheel for mock (setup.py): finished with status 'done'
  Created wheel for mock: filename=mock-1.0.1-py3-none-any.whl size=23772 sha256=3178833b900aad79f904be4ec39fd9218034a3c8eb93ff168e7655db36f4a7ef
  Stored in directory: /tmp/pip-ephem-wheel-cache-bnbn_mt2/wheels/44/dc/c7/e89296d3612588db0aa6545ee3305c23b7a48b3a9922916e1f
  Building wheel for pillow (setup.py): started
  Building wheel for pillow (setup.py): finished with status 'done'
  Created wheel for pillow: filename=Pillow-5.4.1-cp39-cp39-linux_x86_64.whl size=1361211 sha256=065d9d668909332f20be3ebc31f77207067f846cdf142b3395dceac8aa236828
  Stored in directory: /tmp/pip-ephem-wheel-cache-bnbn_mt2/wheels/d3/de/21/f0ad1b0453288616d3f4d2ce28431aa7a2adde8f27c9b7a0af
  Building wheel for future (setup.py): started
  Building wheel for future (setup.py): finished with status 'done'
  Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491070 sha256=a59cfed6bc119fcf842c411312471446a70d5791d55d8bf4f27a58d52cf62dbf
  Stored in directory: /tmp/pip-ephem-wheel-cache-bnbn_mt2/wheels/2f/a0/d3/4030d9f80e6b3be787f19fc911b8e7aa462986a40ab1e4bb94
Successfully built mock pillow future
...
Command time: 39s Return: 0

Some suggestions, in my order of preference:

  • Do not install Pillow (as suggested by the docs, "could be removed in the future")
  • Install a newer version of Pillow for Python 3.8+, that has binary wheels
  • Cache the built wheels so they do not need to be rebuilt. But it's quite possible that Pillow 5.4.1 won't actually work on Python 3.8+, and at some point may even break the build.

I'm focusing on Pillow here as the main bottleneck, but we probably don't need most of the other external dependencies, and would prefer to only install things we've explicitly specified.

But if we can begin by addressing Pillow, that would be a good first step. Thank you!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions