Page MenuHomePhabricator

Make mwparserfromhell mandatory
Closed, ResolvedPublicFeature

Description

Feature summary:

pywikibot.textlib needs a wikitext parser. Either mwparserfromhell or wikitextparser is supported. But none of them are required via requitements.txt or setup.py. In result Pywikibot user have to install the wikitext parser additionally. An ImportWarning is shown if one of these libraries is missing:

ImportError: 
Pywikibot is missing a MediaWiki markup parser which is necessary.
Please update the required module with either

    pip install "mwparserfromhell>=0.5.0"

or

    pip install "wikitextparser>=0.47.5"

I propose to make mwparserfromhell mandatory because it is preinstalled on Toolforge. In additon commons_information and patrol scripts needs it.

Benefits:
No additional installation is necessary if Pywikibot is installed from Python Package Index or if requirements.txt is used to install dependencies. If both mwparserfromhell and wikitextparser are installed, wikitextparser is used.

See also:
T326452, T106763

Event Timeline

Xqt triaged this task as Medium priority.Jan 8 2023, 10:20 AM

Change 876339 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [IMPR] Make mwparserfromhell mandatory

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

Change 876339 merged by jenkins-bot:

[pywikibot/core@master] [IMPR] Make mwparserfromhell mandatory

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

Xqt claimed this task.

Change 905545 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [fix] Decrease needed mwpfh version to 0.5.2

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

Change 905545 merged by Xqt:

[pywikibot/core@master] [fix] Decrease needed mwpfh version to 0.5.2

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

Change 908467 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@stable] [fix] Decrease needed mwpfh version to 0.5.2

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

Change 908467 merged by Xqt:

[pywikibot/core@stable] [fix] Decrease needed mwpfh version to 0.5.2

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