jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/440869 )
Change subject: [doc] Narrow or fix multiple links ......................................................................
[doc] Narrow or fix multiple links
- to phabricator, mediawiki.org, pypi, github, travis, etc. + also use __url__ where applicable + remove Special:MyLanguage as they can be outdated; let the user choose his/her preferred option
Change-Id: If199ded6c799347a7feb1e98c4811d1692457fb9 --- M README.rst M docs/getting_help.rst M generate_user_files.py M pywikibot/__init__.py M pywikibot/comms/http.py M pywikibot/config2.py M pywikibot/epydoc.cfg M pywikibot/i18n.py M pywikibot/login.py M pywikibot/pagegenerators.py M pywikibot/tools/ip.py M scripts/interwiki.py M scripts/maintenance/diff_checker.py M scripts/misspelling.py M scripts/script_wui.py M scripts/states_redirect.py M setup.py M tests/README.rst M tests/api_tests.py 19 files changed, 52 insertions(+), 54 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/README.rst b/README.rst index 8567536..5fe87db 100644 --- a/README.rst +++ b/README.rst @@ -18,7 +18,7 @@ =========
The Pywikibot framework is a Python library that interfaces with the -`MediaWiki API https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page`_ +`MediaWiki API https://www.mediawiki.org/wiki/API:Main_page`_ version 1.14 or higher.
Also included are various general function scripts that can be adapted for @@ -44,7 +44,7 @@ pip install pywikibot
Our `installation -guide https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Pywikibot/Installation`_ +guide https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation`_ has more details for advanced usage.
Basic Usage @@ -79,7 +79,7 @@ ------------
Our code is maintained on Wikimedia's `Gerrit installation https://gerrit.wikimedia.org/`_, -`learn https://www.mediawiki.org/wiki/Special:MyLanguage/Developer_access`_ how to get +`learn https://www.mediawiki.org/wiki/Developer_access`_ how to get started.
.. include:: CODE_OF_CONDUCT.rst diff --git a/docs/getting_help.rst b/docs/getting_help.rst index c39ca87..5a062b1 100644 --- a/docs/getting_help.rst +++ b/docs/getting_help.rst @@ -2,8 +2,8 @@ ------------
.. note:: - Please see `Manual:Pywikibot/Communication https://www.mediawiki.org/w/index.php?title=Manual%3APywikibot%2FCommunication`_. + Please see `Manual:Pywikibot/Communication https://www.mediawiki.org/wiki/Manual:Pywikibot/Communication`_.
.. tip:: Please report bugs at `Phabricator https://phabricator.wikimedia.org/`_. - You may use `this report form https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projectPHIDs=pywikibot-core`_. + You may use `this report form https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?tags=pywikibot-core`_. diff --git a/generate_user_files.py b/generate_user_files.py index 79da3a7..0dbd20c 100755 --- a/generate_user_files.py +++ b/generate_user_files.py @@ -21,7 +21,7 @@ _orig_no_user_config = os.environ.get('PYWIKIBOT2_NO_USER_CONFIG') os.environ['PYWIKIBOT2_NO_USER_CONFIG'] = '2' import pywikibot # noqa: E402 -from pywikibot import config # noqa: E402 +from pywikibot import config, __url__ # noqa: E402
# Reset this flag in case another script is run by pwb after this script if not _orig_no_user_config: @@ -263,11 +263,10 @@
# For each different username entered, ask if user wants to save a # BotPassword (username, BotPassword name, BotPassword pass) - msg = fill('See https://www.mediawiki.org/wiki/' - 'Manual:Pywikibot/BotPasswords to know how to get codes.' + msg = fill('See {}/BotPasswords to know how to get codes.' 'Please note that plain text in {} and anyone with read ' 'access to that directory will be able read the file.' - .format(_fncpass)) + .format(__url__, _fncpass)) botpasswords = [] userset = {user.name for user in userlist} for username in userset: diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py index 763b378..b1a30bc 100644 --- a/pywikibot/__init__.py +++ b/pywikibot/__init__.py @@ -8,7 +8,7 @@ from __future__ import absolute_import, unicode_literals
__version__ = __release__ = '3.1.dev0' -__url__ = 'https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Pywikibot' +__url__ = 'https://www.mediawiki.org/wiki/Manual:Pywikibot'
import atexit import datetime diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index 67ac5b6..0369214 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -29,10 +29,9 @@
import requests
-from pywikibot import __version__ +from pywikibot import __version__, __url__, config from pywikibot.bot import calledModuleName from pywikibot.comms import threadedhttp -from pywikibot import config from pywikibot.exceptions import ( FatalServerError, Server504Error, Server414Error ) @@ -338,9 +337,9 @@ return config.authenticate[path] warn('config.authenticate["{path}"] has invalid value.\n' 'It should contain 2 or 4 items, not {length}.\n' - 'See https://www.mediawiki.org/wiki/Manual:Pywikibot/OAuth ' - 'for more info.' - .format(path=path, length=len(config.authenticate[path]))) + 'See {url}/OAuth for more info.' + .format(path=path, length=len(config.authenticate[path]), + url=__url__)) return None
diff --git a/pywikibot/config2.py b/pywikibot/config2.py index fb85461..388ee8e 100644 --- a/pywikibot/config2.py +++ b/pywikibot/config2.py @@ -193,7 +193,7 @@ # one site # # Pywikibot also support OAuth 1.0a via mwoauth -# https://pypi.python.org/pypi/mwoauth +# https://pypi.org/project/mwoauth # # You can add OAuth tokens to your user-config.py of the following form: # @@ -565,7 +565,7 @@
# Should interwiki.py output a graph PNG file on conflicts? # You need pydot for this: -# https://pypi.python.org/pypi/pydot/1.0.2 +# https://pypi.org/project/pydot/1.0.2 # https://code.google.com/p/pydot/ interwiki_graph = False
diff --git a/pywikibot/epydoc.cfg b/pywikibot/epydoc.cfg index 8dbe58f..c22e23c 100644 --- a/pywikibot/epydoc.cfg +++ b/pywikibot/epydoc.cfg @@ -26,7 +26,7 @@
# url # The documented project's URL. -url: https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Pywikibot +url: https://www.mediawiki.org/wiki/Manual:Pywikibot
# frames # Whether or not to include a frames-based table of contents. diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index 49315d1..95afaf5 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -703,7 +703,7 @@ raise TranslationError( 'Unable to load messages package %s for bundle %s' '\nIt can happen due to lack of i18n submodule or files. ' - 'Read %s/i18n' + 'See %s/i18n' % (_messages_package_name, twtitle, __url__))
source_needed = False @@ -733,11 +733,11 @@ break else: raise TranslationError( - 'No %s translation has been defined for TranslateWiki key' - ' %r\nIt can happen due to lack of i18n submodule or files. ' - 'Read https://mediawiki.org/wiki/PWB/i18n' + 'No %s translation has been defined for TranslateWiki key %r\n' + 'It can happen due to lack of i18n submodule or files. See ' + '%s/i18n' % ('English' if 'en' in langs else "'%s'" % lang, - twtitle)) + twtitle, __url__)) # send the language code back via the given mutable list parameter if source_needed: source.append(alt) diff --git a/pywikibot/login.py b/pywikibot/login.py index 2780dbc..3558dcc 100644 --- a/pywikibot/login.py +++ b/pywikibot/login.py @@ -24,7 +24,7 @@
import pywikibot
-from pywikibot import config +from pywikibot import config, __url__ from pywikibot.exceptions import NoUsername from pywikibot.tools import deprecated_args, normalize_username, PY2
@@ -135,10 +135,10 @@ main_username = self.username if '@' in self.username: warn( - 'When using BotPasswords it is recommended that you store your ' - 'login credentials in a password_file instead. ' - 'See https://www.mediawiki.org/wiki/Manual:Pywikibot/BotPasswords ' - 'for instructions and more information.') + 'When using BotPasswords it is recommended that you store ' + 'your login credentials in a password_file instead. See ' + '{}/BotPasswords for instructions and more information.' + .format(__url__)) main_username = self.username.partition('@')[0]
try: diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index 85790cb..180b6a0 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -2652,7 +2652,7 @@ Page generator using Yahoo! search results.
To use this generator, you need to install the package 'pYsearch'. - https://pypi.python.org/pypi/pYsearch + https://pypi.org/project/pYsearch
To use this generator, install pYsearch """ @@ -2712,7 +2712,7 @@
To use this generator, you need to install the package 'google':
- L{https://pypi.python.org/pypi/google%7D + L{https://pypi.org/project/google%7D
This package has been available since 2010, hosted on github since 2012, and provided by pypi since 2013. diff --git a/pywikibot/tools/ip.py b/pywikibot/tools/ip.py index c768f30..a4d131d 100644 --- a/pywikibot/tools/ip.py +++ b/pywikibot/tools/ip.py @@ -38,7 +38,7 @@ if ip_address and ip_address.__module__ == 'ipaddress': if sys.version_info[0] < 3: # This backport fails many tests - # https://pypi.python.org/pypi/py2-ipaddress + # https://pypi.org/project/py2-ipaddress # It accepts u'1111' as a valid IP address. try: ip_address(u'1111') @@ -48,7 +48,7 @@ pass
# This backport only fails a few tests if given a unicode object - # https://pypi.python.org/pypi/ipaddress + # https://pypi.org/project/ipaddress # However while it rejects u'1111', it will consider '1111' valid try: ip_address(b'1111') diff --git a/scripts/interwiki.py b/scripts/interwiki.py index 366b391..b36175f 100755 --- a/scripts/interwiki.py +++ b/scripts/interwiki.py @@ -320,7 +320,7 @@ interwiki_shownew: should interwiki.py display every new link it discovers?
interwiki_graph: output a graph PNG file on conflicts? You need pydot for - this: https://pypi.python.org/pypi/pydot/1.0.2 + this: https://pypi.org/project/pydot/1.0.2 https://code.google.com/p/pydot/
interwiki_graph_format: the file format for interwiki graphs diff --git a/scripts/maintenance/diff_checker.py b/scripts/maintenance/diff_checker.py index 5f75727..7839153 100644 --- a/scripts/maintenance/diff_checker.py +++ b/scripts/maintenance/diff_checker.py @@ -30,6 +30,8 @@
from unidiff import PatchSet
+from pywikibot import __url__ + if version_info.major == 3: PY2 = False from tokenize import tokenize, STRING @@ -148,10 +150,8 @@ if not check(latest_patchset): raise SystemExit( 'diff-checker failed.\n' - 'Please review ' - '<https://www.mediawiki.org/wiki/' - 'Manual:Pywikibot/Development/Guidelines#Miscellaneous> ' - 'and update your patch-set accordingly.' + 'Please review <{}/Development/Guidelines#Miscellaneous> ' + 'and update your patch-set accordingly.'.format(__url__) )
diff --git a/scripts/misspelling.py b/scripts/misspelling.py index 4cff5ab..2ea30ba 100755 --- a/scripts/misspelling.py +++ b/scripts/misspelling.py @@ -46,7 +46,7 @@
Help Pywikibot team to provide support for your wiki by submitting a bug to: -https://phabricator.wikimedia.org/maniphest/task/create/?projects=pywikibot-... +https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?tags=pywikibot... with category containing misspelling pages or a template for these misspellings.\n"""
diff --git a/scripts/script_wui.py b/scripts/script_wui.py index 9eb267d..020acd5 100755 --- a/scripts/script_wui.py +++ b/scripts/script_wui.py @@ -30,7 +30,7 @@ # @section FRAMEWORK # # Python wikipedia bot framework, DrTrigonBot. -# @see https://www.mediawiki.org/wiki/Pywikibot +# @see https://www.mediawiki.org/wiki/Manual:Pywikibot # @see https://de.wikipedia.org/wiki/Benutzer:DrTrigonBot # # @section LICENSE @@ -85,7 +85,7 @@ import crontab
import pywikibot -# pywikibot.botirc depends on https://pypi.python.org/pypi/irc +# pywikibot.botirc depends on https://pypi.org/project/irc import pywikibot.botirc
from pywikibot.tools.formatter import color_format diff --git a/scripts/states_redirect.py b/scripts/states_redirect.py index 742b6f9..bdac42b 100755 --- a/scripts/states_redirect.py +++ b/scripts/states_redirect.py @@ -32,7 +32,7 @@ import pycountry except ImportError: pywikibot.error('This script requires the python-pycountry module') - pywikibot.error('See: https://pypi.python.org/pypi/pycountry') + pywikibot.error('See: https://pypi.org/project/pycountry') pywikibot.exception() sys.exit(1)
diff --git a/setup.py b/setup.py index 1616365..2bf1b9c 100644 --- a/setup.py +++ b/setup.py @@ -121,9 +121,9 @@ # tools.ip does not have a hard dependency on an IP address module, # as it falls back to using regexes if one is not available. # The functional backport of py3 ipaddress is acceptable: - # https://pypi.python.org/pypi/ipaddress + # https://pypi.org/project/ipaddress # However the Debian package python-ipaddr is also supported: - # https://pypi.python.org/pypi/ipaddr + # https://pypi.org/project/ipaddr # Other backports are likely broken. # ipaddr 2.1.10+ is distributed with Debian and Fedora. See T105443. dependencies.append('ipaddr>=2.1.10') @@ -242,7 +242,7 @@ install_requires=dependencies, dependency_links=dependency_links, extras_require=extra_deps, - url='https://www.mediawiki.org/wiki/Pywikibot', + url='https://www.mediawiki.org/wiki/Manual:Pywikibot', download_url='https://tools.wmflabs.org/pywikibot/', test_suite="tests.collector", tests_require=test_deps, diff --git a/tests/README.rst b/tests/README.rst index 1c3601f..1edfab7 100644 --- a/tests/README.rst +++ b/tests/README.rst @@ -120,8 +120,8 @@ travis-ci.org according to the configuration in .travis.yml .
When changes are merged into the main repository, they are replicated to -https://github.com/wikimedia/pywikibot-core , and travis tests are run and -published at travis-ci.org/wikimedia/pywikibot-core/builds . These tests +https://github.com/wikimedia/pywikibot , and travis tests are run and +published at https://travis-ci.org/wikimedia/pywikibot/builds . These tests use the Wikimedia global (SUL) account 'Pywikibot-test', which has a password securely stored in .travis.yml . See section env:global:secure.
@@ -129,10 +129,10 @@ code changes that have not been merged into the main repository. To do this:
1. create a github and travis-ci account -2. fork the main github repository https://github.com/wikimedia/pywikibot-core +2. fork the main github repository https://github.com/wikimedia/pywikibot 3. enable builds from the travis profile page: https://travis-ci.org/profile 4. push changes into the forked git repository -5. watch the build at https://travis-ci.org/<username>/pywikibot-core/builds +5. watch the build at https://travis-ci.org/<username>/pywikibot/builds
Only travis-ci builds from the main repository can access the password for the Wikimedia account 'Pywikibot-test'. All tests which require a logged in user @@ -141,7 +141,7 @@ To enable 'user' tests on travis-ci builds for a different repository, add a username and password to travis:
-1. Go to https://travis-ci.org/<username>/pywikibot-core/settings/env_vars +1. Go to https://travis-ci.org/<username>/pywikibot/settings 2. Add a new variable named PYWIKIBOT2_USERNAME and a value of a valid Wikimedia SUL username 3. Add another variable named USER_PASSWORD, with the private password for @@ -171,10 +171,10 @@ 1. create a github and appveyor account 2. fork the main github repository 3. create a project in ci.appveyor.com -4. go to https://ci.appveyor.com/project/<username>/pywikibot-core/settings +4. go to https://ci.appveyor.com/project/<username>/pywikibot/settings and enter the custom configuration .yml filename: .appveyor.yml 5. push changes into the forked git repository -6. watch the build at https://ci.appveyor.com/<username>/pywikibot-core/history +6. watch the build at https://ci.appveyor.com/<username>/pywikibot/history
The 'user' tests are not yet enabled on appveyor builds.
@@ -187,14 +187,14 @@ 1. create a github and circleci account 2. fork the main github repository 3. create a project in circleci.com -4. go to https://circleci.com/gh/<username>/pywikibot-core/edit#env-vars +4. go to https://circleci.com/gh/<username>/pywikibot/edit#env-vars and add the following variables:
- PYWIKIBOT2_NO_USER_CONFIG=2 - TOXENV=py27,py34
5. push changes into the forked git repository -6. watch the build at https://circleci.com/gh/<username>/pywikibot-core +6. watch the build at https://circleci.com/gh/<username>/pywikibot
PYWIKIBOT2_NO_USER_CONFIG=2 is needed because 'python setup.py test' is run.
diff --git a/tests/api_tests.py b/tests/api_tests.py index cc4d535..e73fa9a 100644 --- a/tests/api_tests.py +++ b/tests/api_tests.py @@ -1061,7 +1061,7 @@ site = self.get_site() site.tokens._tokens.setdefault(site.user(), {})['edit'] = 'INVALID' page = pywikibot.Page(site, 'Pywikibot bad token test') - page.text = ('This page is testing whether pywikibot-core rerequests ' + page.text = ('This page is testing whether pywikibot rerequests ' 'a token when a badtoken error was received.') page.save(summary='Bad token test')
pywikibot-commits@lists.wikimedia.org