Page MenuHomePhabricator

Drop "2" from names of environmental variables
Closed, ResolvedPublic

Description

Currently environmetal variables include "2" in them, for example: PYWIKIBOT2_USERNAME, PYWIKIBOT2_NO_USER_CONFIG, PYWIKIBOT2_TEST_WRITE, etc.
This is outdated, as the current version of pywikibot is 3. So number 2 needs to be removed from all environmental variables names (with backwards compatibility), i.e PYWIKIBOT2_USERNAME -> PYWIKIBOT_USERNAME

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptJan 11 2018, 2:25 AM
nikitavbv triaged this task as Low priority.Jan 11 2018, 2:25 AM
jayvdb added a subscriber: Xqt.Jan 11 2018, 9:16 AM

PYWIKIBOT2_TEST_ are easy. They are only used in our tests. Travis CI configs will be effected. Some forks may be using these in their CI, which will break if they are renamed. I suspect this isnt a big enough problem to worry about. Easy to fix.

The others will need backwards compatibility , especially PYWIKIBOT2_NO_USER_CONFIG , as these variables are how people use Pywikibot as a library.

Can't we just check the new variable name too, and mark the old one as depreciated, as usual for code functions ?

Can't we just check the new variable name too, and mark the old one as depreciated, as usual for code functions ?

I think that's exactly what is meant under "backwards compatibility"

Change 449931 had a related patch set uploaded (by Dalba; owner: dalba):
[pywikibot/core@master] Rename PYWIKIBOT2_TEST_* environment variables to PYWIKIBOT_TEST_*

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

Change 449931 merged by jenkins-bot:
[pywikibot/core@master] Rename PYWIKIBOT2_TEST_* environment variables to PYWIKIBOT_TEST_*

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

Dvorapa added a subscriber: Dvorapa.

Still to do:

  • PYWIKIBOT2_DIR
  • PYWIKIBOT2_DIR_PWB
  • PYWIKIBOT2_USER_CONFIG
  • PYWIKIBOT2_NO_USER_CONFIG
zhuyifei1999 added a subscriber: zhuyifei1999.
Dalba claimed this task.Aug 3 2018, 11:39 AM

Change 450214 had a related patch set uploaded (by Dalba; owner: dalba):
[pywikibot/core@master] Rename all PYWIKIBOT2_* environment varialbes to PYWIKIBOT_*

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

Change 450214 merged by jenkins-bot:
[pywikibot/core@master] Rename all PYWIKIBOT2_* environment variables to PYWIKIBOT_*

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

Xqt closed this task as Resolved.Aug 3 2018, 7:15 PM