Page MenuHomePhabricator

-graph option of interwiki is not documented
Closed, ResolvedPublic

Description

Issue:
In interwiki script a -graph option was introduced in Pywikibot 2.0 with rPWBC4d47c6f0, which was a backport from Pywikibot 1.0 (added there with rPWBOaa64036d). However, this option was never documented.

Other possible improvements
(not for good first task I guess)

  • remove the config.interwiki_graph to clean up the config settings
  • use ConfigParserBot instead to configure the options

Event Timeline

Xqt triaged this task as Low priority.Mon, Feb 2, 9:00 AM
Xqt added a project: Pywikibot-Documentation.

Thank you for tagging this task with good first task for Wikimedia newcomers!

Newcomers often may not be aware of things that may seem obvious to seasoned contributors, so please take a moment to reflect on how this task might look to somebody who has never contributed to Wikimedia projects.

A good first task is a self-contained, non-controversial task with a clear approach. It should be well-described with pointers to help a completely new contributor, for example it should clearly point to the codebase URL and provide clear steps to help a contributor get set up for success. We've included some guidelines at https://phabricator.wikimedia.org/tag/good_first_task/ !

Thank you for helping us drive new contributions to our projects <3

Hi! I’m Surya, new to Wikimedia development and preparing for GSoC 2026.I would like to work on this documentation task.
Could someone please confirm if it is still suitable for beginners?

Change #1236808 had a related patch set uploaded (by Ayushisr20; author: Ayushisr20):

[pywikibot/core@master] docs: document -graph option for interwiki script

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

Hi @Xqt , regarding the potential code improvement:

I have analyzed scripts/interwiki.py and located the legacy argument parsing in InterwikiBotConfig.readOptions (around line 551-552) where -graph directly modifies the global config.interwiki_graph.

Since @NAGAM_SURYA_NARAYANA is working on the documentation, I would like to tackle the code refactoring. My plan is to:

Decouple the script from the global config object by adding a graph attribute to InterwikiBotConfig.

Update Subject.assemble() to use this local attribute when initializing GraphDrawer.

May I be assigned the refactoring part (Other possible improvements) of this task?

Thank you! I will go through the New Developers page and Communication Tips. Please let me know if this task is appropriate for me to work on after reviewing it.

I would be happy to work on the documentation part of this task as I am a beginner, while others handle the code refactoring. Please let me know if this division works for the maintainers.
Thank you!

@anoexpected: good idea to have a local variable (attribute) but keep in mind that the config setting is the default and can be overridden by -graph option.

Thanks for the feedback @Xqt! You are absolutely right, I missed that the local attribute should inherit the default from the config file first.

I have updated the patch so that InterwikiBotConfig.graph initializes with config.interwiki_graph. This ensures user-config.py settings are respected as the default, while still allowing the -graph argument to override it locally.

I have updated the patch so that InterwikiBotConfig.graph initializes with config.interwiki_graph. This ensures user-config.py settings are respected as the default, while still allowing the -graph argument to override it locally.

Sounds good, thanks. I’ll review it once the patch is up

Change #1237162 had a related patch set uploaded (by Anotida Expected; author: Anotida Expected):

[pywikibot/core@master] Refactor: Decouple interwiki.py from global config.interwiki_graph

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

@NAGAM_SURYA_NARAYANA: patches are already submitted by @Ayushii.sr and @Stitipragyan_barik but both does not solve this issue. Script options are always documented inside the script itself that it can be shown with the global -help option. For reference, see the interwiki script.

But is this a challenge? Usually, the assigned developer is working on a task. (Bug report life cycle). Please sort out among yourselves who will work on what—you can also collaborate if needed. I am fine with every patch improving the framwork.

Hello @Xqt,
Thank you for the clarification. I understand that the patches are already submitted and that the script options should be documented inside the script for global help.
Since this task is already being handled, I’m happy to support in any way needed or take up another related task. Please let me know how I can contribute.

Change #1237167 had a related patch set uploaded (by Stitipragyan barik; author: Stitipragyan barik):

[pywikibot/core@master] docs: move -graph documentation to interwiki.py Bug: T416116

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

Change #1237174 had a related patch set uploaded (by Stitipragyan barik; author: Stitipragyan barik):

[pywikibot/core@master] docs: update -graph documentation in interwiki.py Bug: T416116

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

Since this task is already being handled, I’m happy to support in any way needed or take up another related task. Please let me know how I can contribute.

Maybe T416566 is for beginners, but not so quite simple. I would lead you.

@Xqt can you check is this patch solve or need to change where

Thank you, @Xqt!

I appreciate the guidance. I’d be happy to take a look at T416566 and work on it under your direction.
Please let me know the first steps I should follow, and I will get started.

Thanks again for supporting me as a newcomer.

NAGAM_SURYA_NARAYANA: I made a comment in the other task. There are also two easy task for beginners (T415976 and T414239). All to do there is to run a script with the right options.

Change #1237162 merged by jenkins-bot:

[pywikibot/core@master] Refactor: Decouple interwiki.py from global config.interwiki_graph

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

Thanks, I’ll start with one of the easy tasks to get familiar with the workflow. I’m picking T415976 (urwikisource) first, will run the required script with the right options, and submit a patch. After that, I’ll continue with T416566.

Change #1237162 merged by jenkins-bot:

[pywikibot/core@master] Refactor: Decouple interwiki.py from global config.interwiki_graph

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

Thank you @anoexpected, great job. Please add yourself to the AUTHORS.rst file.

Thanks @Xqt! I have uploaded a separate patch to add my name to AUTHORS.rst here: https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1237211

I really enjoyed working on this. I'll check the workboard for my next task, but if you have any specific priorities that need attention, please let me know!

The related issue (add -graph to interwiki documentation) is still open.

Thanks @Xqt! I missed that the documentation update was required here. I will update the module docstring in interwiki.py to include the -graph parameter description and submit a patch shortly.

Change #1237219 had a related patch set uploaded (by Stitipragyan barik; author: Stitipragyan barik):

[pywikibot/core@master] docs: Add -graph documentation

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

Thanks @Xqt! I missed that the documentation update was required here. I will update the module docstring in interwiki.py to include the -graph parameter description and submit a patch shortly.

The task is already assigned, and was merged now. If you are interested, you might want to take a look at T416145 instead. It is a bit more challenging, but I would be happy to guide you step by step.

@Stitipragyan_barik: Thank you for your last patch. It will be merged into the repository now. The result should be visible in the interwiki script documentation in about half an hour. Some remarks:

  • If you are working on patches, you should amend the previous patch when making changes instead of pushing a new patch every time. I will abandon the remaining ones now.
  • You may add yourself to the AUTHORS.rst file.

Change #1237167 abandoned by Xqt:

[pywikibot/core@master] docs: move -graph documentation to interwiki.py Bug: T416116

Reason:

Follow up: https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1237219

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

Change #1237174 abandoned by Xqt:

[pywikibot/core@master] docs: update -graph documentation in interwiki.py Bug: T416116

Reason:

Follow-up: https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1237219

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

Change #1236808 abandoned by Xqt:

[pywikibot/core@master] docs: document -graph option for interwiki script

Reason:

Already done in https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1237219

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

Change #1237219 merged by jenkins-bot:

[pywikibot/core@master] docs: Add -graph documentation

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

Thanks @Xqt! I missed that the documentation update was required here. I will update the module docstring in interwiki.py to include the -graph parameter description and submit a patch shortly.

The task is already assigned, and was merged now. If you are interested, you might want to take a look at T416145 instead. It is a bit more challenging, but I would be happy to guide you step by step.

Understood! I see the other patch was just uploaded. I appreciate the guidance and I am definitely up for the challenge. I will head over to T416145 and start reviewing it now.

@Xqt Thank you for merging my patch and for the guidance! I will make sure to amend future patches instead of creating new ones. I will also add myself to the AUTHORS.rst file. I really appreciate your help and feedback.