~lioploum/offpunk-devel

3 3

Discussion about removing dependency on python-pillow

Details
Message ID
<171974170418.7.11404642512589804975.367913005@ploum.eu>
DKIM signature
pass
Download raw message
This is a request to comment a proposal to remove support for chafa 
older than 1.10 in offpunk.


Offpunk currently has an optional dependency on python3-pil 
(python-pillow) for a very limited usecase.


Usecase:

Before version 1.10, chafa had no feature to only handle the first frame 
of an animated gif. It will display all the frames. Thus, in offpunk, we 
use python-pil to extract the first frame of an animated gif if chafa is 
used and if chafa version < 1.10 and if there’s no timg or if timg 
version <= 1.3.2.

To summarize: python-pil is only needed if user has no recent timg 
version, an old chafa version and want images displayed in offpunk (and 
browse content with animated gifs).


Problem:

I feel that this usecase will become increasingly rare and that part of 
the code is not tested anymore so I can’t guarantee it works (I even 
suspect it is broken right now). 

Also, I’ve seen that python-pil has been marked as a hard dependency for 
the Arch package. While this is not a big problem, I feed bad for having 
people installing a library and its dependency when it will probably 
never be used.


Proposal:

I plan, at some point, to remove completely the python-pil dependency 
and remove support for chafa < 1.10.  People using chafa < 1.10 will be 
recommended to use timg instead or lose support for image in Offpunk. 
I’ve the unscientific intuition that this will not affect many users (or 
not at all).

For example, Debian 10 users have access to a newer chafa in backport 
(Debian 10 support ends today).

Ubuntu 22.04 users have access to timg 1.4.

Starting with Debian 11 and Ubuntu 22.10, chafa is >= 1.10.

I need your advices to better understand who will be affected by this.


Actions:

The following actions are possible:

1) Conservative: Let the code as it is as long as possible. The problem 
is too small for being considered. Act only if someone complains at some 
point.

2) Radical: Remove the dependency now. This will not affect users before 
the release of offpunk 2.4, at which points there will be even less 
users impacted (if any).

3) Progressive: add a warning for deprecation and wait for a given 
number of releases before actually removing the code. See if anybody 
complains on the deprecation warning. It is more effort but we don’t 
want to break any user feature without at least a warning.


What’s your opinion on the matter?

Thanks for commenting!

Ploum

-- 
Ploum - Lionel Dricot
Blog: https://www.ploum.net
Livres: https://ploum.net/livres.html
Details
Message ID
<lfmhahcymfd33oj72lb4auo5q4uy2hcflf4xzi53ld7q4zjucn@2df4lqh7szca>
In-Reply-To
<171974170418.7.11404642512589804975.367913005@ploum.eu> (view parent)
DKIM signature
pass
Download raw message
Ploum wrote:

> Thus, in offpunk, we use python-pil to extract the first frame
> of an animated gif if chafa is used and if chafa version < 1.10
> and if there’s no timg or if timg version <= 1.3.2.

I (AUR packager of offpunk-git) have removed the hard dependency on python-pil, and made versioned optional dependencies for chafa>=1.10 or timg>1.3.2 (Arch currently has chafa 1.14.1 and timg 1.6.0, so the versioned optional dependencies are not strictly needed, but I'll keep them for a little while).

> Also, I’ve seen that python-pil has been marked as a hard dependency
> for the Arch package. While this is not a big problem, I feed bad for
> having people installing a library and its dependency when it will
> probably never be used.

I agree.

> I’ve the unscientific intuition that this will not affect many users
> (or not at all).

> Actions:

Depending on which answers we get on the list, I'd say:

1. Progessive: Add warnings now that support for PIL will be removed in offpunk 2.4, then
2. Go radical: Remove support for PIL and remove support for old chafas and timgs from offpunk 2.4.

-- 
Kʟᴀᴜꜱ Aʟᴇxᴀɴᴅᴇʀ Sᴇɪꜱᴛʀᴜᴘ
https://kas.bio.link/ 🇩🇰
Details
Message ID
<20240630165254.GA154953@patsas>
In-Reply-To
<lfmhahcymfd33oj72lb4auo5q4uy2hcflf4xzi53ld7q4zjucn@2df4lqh7szca> (view parent)
DKIM signature
pass
Download raw message
On 2024-06-30, Klaus Alexander Seistrup wrote:
>Depending on which answers we get on the list, I'd say:
>
>1. Progessive: Add warnings now that support for PIL will be removed in 
>offpunk 2.4, then
>2. Go radical: Remove support for PIL and remove support for old chafas 
>and timgs from offpunk 2.4.

Agreed, with a preference towards option 1, adding a deprecation 
warning. Maybe support for PIL should be removed in version 2.5, since 
some distributions may only package released versions. In that case, 
their users might not ever see the deprecation warning if it's 
introduced only between 2.3 and 2.4.

Maybe support for timg should also be dropped? Are there major 
distributions where chafa isn't available?

Sotiris
Details
Message ID
<171978130782.7.18323902468429445638.368272282@ploum.eu>
In-Reply-To
<20240630165254.GA154953@patsas> (view parent)
DKIM signature
pass
Download raw message
On 24 jun 30 07:52, Sotiris Papatheodorou wrote:
>On 2024-06-30, Klaus Alexander Seistrup wrote:
>>Depending on which answers we get on the list, I'd say:
>>
>>1. Progessive: Add warnings now that support for PIL will be removed in
>>offpunk 2.4, then
>>2. Go radical: Remove support for PIL and remove support for old chafas
>>and timgs from offpunk 2.4.
>
>Agreed, with a preference towards option 1, adding a deprecation
>warning. Maybe support for PIL should be removed in version 2.5, since
>some distributions may only package released versions. In that case,
>their users might not ever see the deprecation warning if it's
>introduced only between 2.3 and 2.4.

Thanks for your answers. Posting the problem on the mailing-list made 
the answer obvious.

I’ve added a deprecation warning to the code and, indeed, I will keep it 
until 2.5 if I’ve no feedback about it. Then remove the python-pil code.
>
>Maybe support for timg should also be dropped? Are there major
>distributions where chafa isn't available?

That’s a very good question. Timg support was initially implemented 
because, in some situation, chafa was lacking some features. It is not 
the case anymore.

Timg support is thus, for me, only there for those who could not install 
chafa >= 1.10. It looks like Ubuntu 22.04 is concerned but, as far as I 
could see on repology, it is the only major platform where timg is 
available but chafa is too old. 

At some point, it would be needed to remove support for timg but it is 
less urgent as timg is only an external binary (unlike python-pil which 
is a loaded libraries). The question is "when will we reach that point?"

Thanks everyone for your input.
Reply to thread Export thread (mbox)