SmileyChris / easy-thumbnails

Easy thumbnails for Django
http://easy-thumbnails.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
1.38k stars 318 forks source link

Require [svg] extra for SVG support #597

Closed akx closed 2 years ago

akx commented 2 years ago

This PR gates SVG support behind the [svg] install extra.

With that, there is no hard dependency on svglib and reportlab (see #591).

The vil_image generator will emit a warning if it fails to import the VIL bits.

jrief commented 2 years ago

How would one tell pip to install the extra dependencies?

SmileyChris commented 2 years ago

pip install easy-thumbnails[svg]

jaap3 commented 2 years ago

This PR missed at least one place where VIL is imported, causing issues if easy-thumbnails is installed without the svg extra:

https://github.com/SmileyChris/easy-thumbnails/blob/92060b9fd7b617cab1ac88d149dc5021d43b35c3/easy_thumbnails/files.py#L17

There may be more, this is the one I saw in a CI run on a project that uses easy-thumbnails.

I'd suggest adding a test configuration that doesn't install the svg extras in order to catch these sort of issues.

akx commented 2 years ago

Hi @jaap3, @wesbroadway, sorry for the trouble 😞

These should be fixed by #603.

jaap3 commented 2 years ago

@akx no worries, glad you're able to follow up. Thanks for the effort in the first place!

wesbroadway commented 2 years ago

Thank you so much @akx and @jaap3! No trouble at all, I'm very grateful for all of your work. Kind regards!