Skip to content

fix JPEG reference tests #5162

Closed
Closed
@pmeier

Description

@pmeier

We are currently skipping JPEG reference tests on Windows, since the Windows wheels of Pillow are built against libjpeg-turbo while we build torchvision against libjpeg

@pytest.mark.skipif(IS_WINDOWS, reason=("this test fails on windows because PIL uses libjpeg-turbo on windows"))

As of Pillow==9.0.0, all wheels are now built against libjpeg-turbo, which leads to the CI failures that are currently happening. Thus, these tests will now fail for every OS or at least only succeed by chance.

There are multiple ways out in descending order of preference by me:

  1. Install Pillow from conda-forge rather from PyPI to enforce the same JPEG library for torchvision and Pillow.
  2. Pin Pillow<9 for unittest CI. This basically preserves the behavior we had before.
  3. Remove these tests completely.

The only downside of 1. that I see is that Pillow on conda-forge is released later than on PyPI. IIUC, the conda-forge package is community managed and they only start building when it is released on PyPI. If there are build failures it might take some time until the versions converge again. In the meantime, our tests would not pick up on any incompatibilities with Pillow in general not just for JPEG I/O. Thus, we would need to rely on user feedback that something is not working.

Given that this is an dependency issue, I would be fine with waiting for user reports in the time of Pillow version divergence between conda-forge and PyPI. If we don't want to accept that, we could also hide all JPEG compatibility tests behind a runtime flag and add another CI job that only runs these tests while enforcing 1. from above.

cc @pmeier @NicolasHug @datumbox

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions