Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1024840?usp=email )
Change subject: Revert "[IMPR] add a new -usernames option to scripts.version.py" ......................................................................
Revert "[IMPR] add a new -usernames option to scripts.version.py"
This reverts commit 75d16f94404461bee8af26c5db904d3b2706326c.
Change-Id: I9a76c8055601a320cefde734d10a336336c8d018 --- M .github/workflows/doctest.yml M .github/workflows/login_tests-ci.yml M .github/workflows/oauth_tests-ci.yml M .github/workflows/pywikibot-ci.yml M .github/workflows/sysop_write_tests-ci.yml M pywikibot/scripts/version.py 6 files changed, 7 insertions(+), 22 deletions(-)
Approvals: Xqt: Verified; Looks good to me, approved
diff --git a/.github/workflows/doctest.yml b/.github/workflows/doctest.yml index fd33f88..fae76f3 100644 --- a/.github/workflows/doctest.yml +++ b/.github/workflows/doctest.yml @@ -67,7 +67,7 @@ - name: doctest with pytest timeout-minutes: 5 run: | - python pwb.py version -usernames + python pwb.py version pytest --version coverage run -m pytest pywikibot --doctest-modules --ignore-glob="*gui.py" --ignore-glob="*memento.py"
diff --git a/.github/workflows/login_tests-ci.yml b/.github/workflows/login_tests-ci.yml index 5554e7d..5cc02a2 100644 --- a/.github/workflows/login_tests-ci.yml +++ b/.github/workflows/login_tests-ci.yml @@ -110,7 +110,7 @@ - name: Test with unittest timeout-minutes: 2 run: | - python pwb.py version -usernames + python pwb.py version coverage run -m unittest -vv tests/site_login_logout_tests.py
- name: Show coverage statistics diff --git a/.github/workflows/oauth_tests-ci.yml b/.github/workflows/oauth_tests-ci.yml index 288bb6b..db48feb 100644 --- a/.github/workflows/oauth_tests-ci.yml +++ b/.github/workflows/oauth_tests-ci.yml @@ -101,7 +101,7 @@ env: PYWIKIBOT_TEST_OAUTH: ${{ secrets[format('{0}', steps.token.outputs.uppercase)] }} run: | - python pwb.py version -usernames + python pwb.py version coverage run -m unittest -vv tests/oauth_tests.py
- name: Show coverage statistics diff --git a/.github/workflows/pywikibot-ci.yml b/.github/workflows/pywikibot-ci.yml index 1da1d35..c57535b 100644 --- a/.github/workflows/pywikibot-ci.yml +++ b/.github/workflows/pywikibot-ci.yml @@ -124,7 +124,7 @@ ${{ (matrix.site == 'wikisource:zh' || matrix.test_no_rc) && 1 || 0 }} PYWIKIBOT_TEST_PROD_ONLY: ${{ matrix.test_prod_only && 1 || 0 }} run: | - python pwb.py version -usernames + python pwb.py version if [ ${{matrix.site || 0}} != 'wikipedia:test' ]; then coverage run -m unittest discover -vv -p "*_tests.py"; else diff --git a/.github/workflows/sysop_write_tests-ci.yml b/.github/workflows/sysop_write_tests-ci.yml index 3828404..ca3f527 100644 --- a/.github/workflows/sysop_write_tests-ci.yml +++ b/.github/workflows/sysop_write_tests-ci.yml @@ -80,7 +80,7 @@ PYWIKIBOT_TEST_OAUTH: ${{ secrets[format('{0}', steps.token.outputs.uppercase)] }} PYWIKIBOT_TEST_WRITE: ${{ matrix.domain == 'test.wikipedia.org' && 1 || 0}} run: | - python pwb.py version -usernames + python pwb.py version pytest -s -r A -a "rights or write" --cov=.;
- name: Show coverage statistics diff --git a/pywikibot/scripts/version.py b/pywikibot/scripts/version.py index e18b658..1178caf 100755 --- a/pywikibot/scripts/version.py +++ b/pywikibot/scripts/version.py @@ -1,14 +1,8 @@ #!/usr/bin/env python3 """Script to determine the Pywikibot version (tag, revision and date).
-The following option is supported: - --usernames print usernames for each registered family - .. versionchanged:: 7.0 version script was moved to the framework scripts folder -.. versionadded:: 9.1 - the *-usernames* option. """ # # (C) Pywikibot team, 2007-2024 @@ -57,11 +51,7 @@
def main(*args: str) -> None: - """Print pywikibot version and important settings. - - .. versionchanged:: 9.1 - usernames are printed with ``-usernames`` option only. - """ + """Print pywikibot version and important settings.""" pywikibot.info('Pywikibot: ' + getversion()) pywikibot.info('Release version: ' + pywikibot.__version__) pywikibot.info('packaging version: ' + packaging.__version__) @@ -100,12 +90,7 @@ os.environ.get(environ_name, 'Not set') or "''"))
pywikibot.info('Config base dir: ' + pywikibot.config.base_dir) - - if '-usernames' in sys.argv: - usernames_items = pywikibot.config.usernames.items() - else: - usernames_items = {} - for family, usernames in usernames_items: + for family, usernames in pywikibot.config.usernames.items(): if not usernames: continue pywikibot.info(f"Usernames for family '{family}':")
pywikibot-commits@lists.wikimedia.org