Page MenuHomePhabricator

[RfC] Drop compat module
Closed, ResolvedPublic

Description

core branch is now 10 years old and decommission of compat was one year ago. The compat module was created in 2012 and older catlib and userlib where merged into that folder in 2014.

The framework is not using this compatibility modul anymore and bot operators get a deprecation waring for their private scripts when the module is used.

I guess it is time to drop this module because all scripts should use the core framework equivalent parts. It might be more difficult to keep this backward compatibility alive and btw its usage is unsure because the behavioris never testet. Finally not all parts of userlib and catlib has been ported.

Now I propose to remove this backward compatibility module because it had to be invoked explicitly and could be replaced by the framework equivalent implemetations.

Event Timeline

Change 398024 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [compat] drop compat module

https://gerrit.wikimedia.org/r/398024

It sounds like a backward incompatible change. Should we announce it? Should it wait for Pywikibot v4? I don't know how pywikibot is going to handle backward incompatible changes (T106121).

Would be good to start using SemVer.

Unless there is an immediate issue, please keep this minor backwards compatibility. Most of my stuff is now in Core but look have a library of Compat handy things that once broken are unlikely to be revisited. Deliberately breaking them does not make much sense.

Gain: Some code clean up
Pain: A lot of our long time users will have broken scrips they have to update

If I look at it like that, it's not worth it. Please explain why this is needed now.

Change 427663 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [compat] Update conversion description

https://gerrit.wikimedia.org/r/427663

Change 427663 merged by jenkins-bot:
[pywikibot/core@master] [compat] Update conversion description

https://gerrit.wikimedia.org/r/427663

Unless there is an immediate issue, please keep this minor backwards compatibility. Most of my stuff is now in Core but look have a library of Compat handy things that once broken are unlikely to be revisited. Deliberately breaking them does not make much sense.

compat scripts has to be converted to core framework anway. README-conversion.txt, compat2core.py and the debug option to show the deprecated stuff are able to help the conversion process. There are remaining issues like such described in T136513.

Regarding to the compat module I think it shouldn't be necessary anymore after this long time and it shouldn't be used anyway. There is no reason to use pywikibot.compat.catlib.Category instead of pywikibot.Category or pywikibot.compat.userlib.User instead of pywikibot.User or pywikibot.compat.query.GetData(request) instead of pywikibot.data.api.request(**request).submit(). Ok the last one looks a bit strange but there a a lot of high level Page or Site methods which could be used instead. What might be the reason to keep this old stuff? Older releases of the pywikibot framework are tagged with a version number and can be downloaded easily if needed.

In T183085#4648389, @Zoranzoki21 wrote:

Status of that?

I think a FutureWarning should be placed first instead of the hidden deprecation warning.

Change 467645 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [compat] do not actively support compat module

https://gerrit.wikimedia.org/r/467645

Change 467645 merged by jenkins-bot:
[pywikibot/core@master] [compat] do not actively support compat module

https://gerrit.wikimedia.org/r/467645

Change 481331 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [compat] Remove compat.rst subpackage tree

https://gerrit.wikimedia.org/r/481331

Change 481331 merged by jenkins-bot:
[pywikibot/core@master] [compat] Remove compat.rst subpackage tree

https://gerrit.wikimedia.org/r/481331

Change 571535 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [cleanup] Throw a FutureWarning if compat module is used

https://gerrit.wikimedia.org/r/571535

Change 571535 merged by jenkins-bot:
[pywikibot/core@master] [cleanup] Throw a FutureWarning if compat module is used

https://gerrit.wikimedia.org/r/571535

Change 398024 merged by jenkins-bot:
[pywikibot/core@master] [compat] Remove compat module

https://gerrit.wikimedia.org/r/398024

Change 582561 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [cleanup] Remove pywikibot/compat related settings

https://gerrit.wikimedia.org/r/582561

Change 582561 merged by jenkins-bot:
[pywikibot/core@master] [cleanup] Remove pywikibot/compat related settings

https://gerrit.wikimedia.org/r/582561