ansible-community / antsibull-core

Library for tooling for building various things related to ansible

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Migrate away from unmaintained twiggy

gotmax23 opened this issue · comments

twiggy is apparently unmaintained upstream and has not had any commits in two years. We should switch to the builtin logging module or something else.

Considering that twiggy uses deprecated stdlib that has been reported in 2021, and a fix has been around since then as well, without any maintainer feedback to the issue or PR, I tend to agree.

Getting rid of it is more complex, though, since the code is used by both antsibull-core, and antsibull-docs and antsibull itself. I guess we need to do this in an antsibull-core 3.0.0 release, and antsibull-docs and antsibull must make a hard dependency bump (in new major releases, which is easy for antsibull but harder for antsibull-docs).

This is harder to replace, as I don't think logging has an equivalent to twiggy's .fields() API which we widely use. Still, I'd like to use the same approach as we did for sh: prepare to replace antsibull_core's logging API that uses twiggy in antsibull-core v2 and remove it in v3.

With 'remove it in v3', you mean 'change the API implementation to stop using twiggy, and use Python logging instead'?

Yeah, I guess. I don't think there's anything to prepare in antsibull-core v2 like we did for sh. We'd need to rewrite antsibull_core.logging and the logging configuration schemas, replace the calls to twiggy.dict_config in the antsibull-build and antsibull-docs CLI code, and handle any incompatibilities (e.g. calls to .fields()) all at the same time.