jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/475037 )
Change subject: docs/requirements-py3.txt: Use sphinx >= 1.8
......................................................................
docs/requirements-py3.txt: Use sphinx >= 1.8
Use rstcheck >= 3.3.1 in tox.ini which fixes an incompatibility with
sphinx 1.8+ and use sphinx >= 1.8 for building the docs.
Bug: T204189
Change-Id: I3cc5618db175f9f366bfaa2cdb6a918446387da3
---
M docs/requirements-py3.txt
M tox.ini
2 files changed, 2 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/docs/requirements-py3.txt b/docs/requirements-py3.txt
index 194ce1b..d7647fc 100644
--- a/docs/requirements-py3.txt
+++ b/docs/requirements-py3.txt
@@ -2,6 +2,6 @@
# using sphinx on python3.4.
# requirements.txt and pywikibot[security] are also needed
-sphinx<1.8.0
+sphinx >= 1.8
sphinx-epytext>=0.0.4
unidiff
diff --git a/tox.ini b/tox.ini
index 9f468e8..68da0e9 100644
--- a/tox.ini
+++ b/tox.ini
@@ -105,7 +105,7 @@
deps =
-rrequirements.txt
-rdocs/requirements-py3.txt
- rstcheck
+ rstcheck >= 3.3.1
[flake8]
# The following are intentionally ignored, possibly pending consensus
--
To view, visit https://gerrit.wikimedia.org/r/475037
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3cc5618db175f9f366bfaa2cdb6a918446387da3
Gerrit-Change-Number: 475037
Gerrit-PatchSet: 1
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/474537 )
Change subject: [PEP8] Fix W504 errors in pywikibot/page.py
......................................................................
[PEP8] Fix W504 errors in pywikibot/page.py
Fixed the W504 error occurrences in the following file:
- pywikibot/page.py
Bug: T207836
Change-Id: I657eb5a78d1157ba5ff4d997f1f6eb06da651971
---
M pywikibot/page.py
1 file changed, 29 insertions(+), 29 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 736d34b..6d51e2c 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -199,8 +199,8 @@
# copy all of source's attributes to this object
# without overwriting non-None values
self.__dict__.update((k, v) for k, v in source.__dict__.items()
- if k not in self.__dict__ or
- self.__dict__[k] is None)
+ if k not in self.__dict__
+ or self.__dict__[k] is None)
if title:
# overwrite title
self._link = Link(title, source=source.site,
@@ -336,9 +336,9 @@
target_code = config.mylang
target_family = config.family
if force_interwiki or \
- (allow_interwiki and
- (self.site.family.name != target_family
- or self.site.code != target_code)):
+ (allow_interwiki
+ and (self.site.family.name != target_family
+ or self.site.code != target_code)):
if self.site.family.name != target_family \
and self.site.family.name != self.site.code:
title = '%s:%s:%s' % (
@@ -425,8 +425,8 @@
def full_url(self):
"""Return the full URL."""
- return self.site.base_url(self.site.article_path +
- self.title(as_url=True))
+ return self.site.base_url(self.site.article_path
+ + self.title(as_url=True))
def autoFormat(self):
"""
@@ -488,8 +488,8 @@
def _latest_cached_revision(self):
"""Get the latest revision if cached and has text, otherwise None."""
- if (hasattr(self, '_revid') and self._revid in self._revisions and
- self._revisions[self._revid].text is not None):
+ if (hasattr(self, '_revid') and self._revid in self._revisions
+ and self._revisions[self._revid].text is not None):
return self._revisions[self._revid]
else:
return None
@@ -1314,15 +1314,15 @@
return summary
family = self.site.family.name
if config.cosmetic_changes_mylang_only:
- cc = ((family == config.family and
- self.site.lang == config.mylang) or
- family in list(config.cosmetic_changes_enable.keys()) and
- self.site.lang in config.cosmetic_changes_enable[family])
+ cc = ((family == config.family
+ and self.site.lang == config.mylang)
+ or family in list(config.cosmetic_changes_enable.keys())
+ and self.site.lang in config.cosmetic_changes_enable[family])
else:
cc = True
cc = (cc and not
- (family in list(config.cosmetic_changes_disable.keys()) and
- self.site.lang in config.cosmetic_changes_disable[family]))
+ (family in list(config.cosmetic_changes_disable.keys())
+ and self.site.lang in config.cosmetic_changes_disable[family]))
if not cc:
return summary
@@ -4029,8 +4029,8 @@
for prop in claims:
for claim in claims[prop]:
- if (prop not in diffto_claims or
- claim not in diffto_claims[prop]):
+ if (prop not in diffto_claims
+ or claim not in diffto_claims[prop]):
temp[prop].append(claim)
claim_ids.add(claim['id'])
@@ -5198,16 +5198,16 @@
false otherwise
@rtype: bool
"""
- if (isinstance(self.target, WikibasePage) and
- isinstance(value, basestring)):
+ if (isinstance(self.target, WikibasePage)
+ and isinstance(value, basestring)):
return self.target.id == value
- if (isinstance(self.target, pywikibot.WbTime) and
- not isinstance(value, pywikibot.WbTime)):
+ if (isinstance(self.target, pywikibot.WbTime)
+ and not isinstance(value, pywikibot.WbTime)):
return self.target.year == int(value)
- if (isinstance(self.target, pywikibot.Coordinate) and
- isinstance(value, basestring)):
+ if (isinstance(self.target, pywikibot.Coordinate)
+ and isinstance(value, basestring)):
coord_args = [float(x) for x in value.split(',')]
if len(coord_args) >= 3:
precision = coord_args[2]
@@ -5219,11 +5219,11 @@
except TypeError:
pass
- return (abs(self.target.lat - coord_args[0]) <= precision and
- abs(self.target.lon - coord_args[1]) <= precision)
+ return (abs(self.target.lat - coord_args[0]) <= precision
+ and abs(self.target.lon - coord_args[1]) <= precision)
- if (isinstance(self.target, pywikibot.WbMonolingualText) and
- isinstance(value, basestring)):
+ if (isinstance(self.target, pywikibot.WbMonolingualText)
+ and isinstance(value, basestring)):
return self.target.text == value
return self.target == value
@@ -5613,8 +5613,8 @@
prefix = self._text[old_position:colon_position].lower()
# All spaces after a prefix are discarded
colon_position += 1
- while (len(self._text) > colon_position and
- self._text[colon_position] == ' '):
+ while (len(self._text) > colon_position
+ and self._text[colon_position] == ' '):
colon_position += 1
ns = self._site.namespaces.lookup_name(prefix)
if ns:
--
To view, visit https://gerrit.wikimedia.org/r/474537
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I657eb5a78d1157ba5ff4d997f1f6eb06da651971
Gerrit-Change-Number: 474537
Gerrit-PatchSet: 1
Gerrit-Owner: Nathan fraignt <nathanklumpenaar10(a)outlook.com>
Gerrit-Reviewer: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/474637 )
Change subject: Ignore RequestsDependencyWarning for cryptography during tests
......................................................................
Ignore RequestsDependencyWarning for cryptography during tests
The minimum recommended cryptography_version is hardcoded in requests/__init__.py.[1]
[1]:
https://github.com/requests/requests/blob/57d7284c1a245cf9fbcecb594f50471d8…
Bug: T209153
Change-Id: I8dd4c4f85e51907bbcfcb38d6d0569aaf55326e8
---
M tests/utils.py
1 file changed, 8 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/utils.py b/tests/utils.py
index 4036155..c0ce35b 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -23,6 +23,12 @@
from collections import Mapping
from types import ModuleType
+try:
+ from cryptography import __version__ as cryptography_version
+ cryptography_version = list(map(int, cryptography_version.split('.')))
+except ImportError:
+ cryptography_version = None
+
import pywikibot
from pywikibot.comms import threadedhttp
from pywikibot import config
@@ -641,6 +647,8 @@
command.insert(1, '-W ignore:{0}:DeprecationWarning'.format(
'Pywikibot will soon drop support for Python 2.7.2 and 2.7.3, '
'please update your Python.'))
+ if cryptography_version and cryptography_version < [1, 3, 4]:
+ command.insert(1, '-W ignore:Old version of cryptography:Warning')
# Any environment variables added on Windows must be of type
# str() on Python 2.
if OSWIN32 and PY2:
--
To view, visit https://gerrit.wikimedia.org/r/474637
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I8dd4c4f85e51907bbcfcb38d6d0569aaf55326e8
Gerrit-Change-Number: 474637
Gerrit-PatchSet: 2
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/474525 )
Change subject: [PEP8] Fix W504 errors in 3 files
......................................................................
[PEP8] Fix W504 errors in 3 files
Fixed W504 errors in order to have a consistent code style.
This has the consequence of introducing W503 instead.
W504: unary operator at end of line.
W503: unary operator at beginning of line.
Bug: T207836
Change-Id: I2d1924f71b0a669b650fbf17c053f28c1e5ef0ee
---
M scripts/checkimages.py
M scripts/isbn.py
M scripts/match_images.py
3 files changed, 26 insertions(+), 28 deletions(-)
Approvals:
Xqt: Looks good to me, but someone else must approve
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index f27350b..46aa3bb 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -749,8 +749,8 @@
self.notification)
# Check maximum number of notifications for this talk page
- if (self.num_notify is not None and
- self.num_notify[self.talk_page.title()] == 0):
+ if (self.num_notify is not None
+ and self.num_notify[self.talk_page.title()] == 0):
pywikibot.output('Maximum notifications reached, skip.')
return
@@ -872,13 +872,13 @@
# It's not only on commons but the image needs a check
# the second usually is a url or something like that.
# Compare the two in equal way, both url.
- repme = ((self.list_entry +
- "is also on '''Commons''': [[commons:File:%s]]")
+ repme = ((self.list_entry
+ + "is also on '''Commons''': [[commons:File:%s]]")
% (self.imageName,
commons_image_with_this_hash.title(
with_ns=False)))
- if (self.image.title(as_url=True) ==
- commons_image_with_this_hash.title(as_url=True)):
+ if (self.image.title(as_url=True)
+ == commons_image_with_this_hash.title(as_url=True)):
repme += ' (same name)'
self.report_image(self.imageName, self.rep_page, self.com, repme,
addings=False)
@@ -915,8 +915,8 @@
for dup_page in duplicates:
if (dup_page.title(as_url=True) != self.image.title(
- as_url=True) or
- self.timestamp is None):
+ as_url=True)
+ or self.timestamp is None):
try:
self.timestamp = (
dup_page.latest_file_info.timestamp)
@@ -941,8 +941,8 @@
except pywikibot.NoPage:
continue
- if not (re.findall(dupRegex, DupPageText) or
- re.findall(dupRegex, older_page_text)):
+ if not (re.findall(dupRegex, DupPageText)
+ or re.findall(dupRegex, older_page_text)):
pywikibot.output(
'{} is a duplicate and has to be tagged...'
.format(dup_page))
@@ -1024,10 +1024,8 @@
% self.image.title(as_url=True))
for dup_page in duplicates:
- if (
- dup_page.title(as_url=True) ==
- self.image.title(as_url=True)
- ):
+ if (dup_page.title(as_url=True)
+ == self.image.title(as_url=True)):
# the image itself, not report also this as duplicate
continue
repme += '\n** [[:{}{}]]'.format(
@@ -1259,9 +1257,9 @@
for template_selected in templatesInTheImageRaw:
tp = pywikibot.Page(self.site, template_selected)
for templateReal in self.licenses_found:
- if (tp.title(as_url=True, with_ns=False).lower() ==
- templateReal.title(as_url=True,
- with_ns=False).lower()):
+ if (tp.title(as_url=True, with_ns=False).lower()
+ == templateReal.title(as_url=True,
+ with_ns=False).lower()):
if templateReal not in self.allLicenses:
self.allLicenses.append(templateReal)
break
@@ -1307,10 +1305,10 @@
self.some_problem = False
else:
if not self.seems_ok and self.license_found:
- rep_text_license_fake = ((self.list_entry +
- "seems to have a ''fake license'', "
- 'license detected: '
- '<nowiki>%s</nowiki>') %
+ rep_text_license_fake = ((self.list_entry
+ + "seems to have a ''fake license'',"
+ ' license detected:'
+ ' <nowiki>%s</nowiki>') %
(self.imageName, self.license_found))
printWithTimeZone(
'{} seems to have a fake license: {}, reporting...'
diff --git a/scripts/isbn.py b/scripts/isbn.py
index f6912db..33fa573 100755
--- a/scripts/isbn.py
+++ b/scripts/isbn.py
@@ -1305,8 +1305,8 @@
sum += (i + 1) * int(self.digits()[i])
checksum = sum % 11
lastDigit = self.digits()[-1]
- if not ((checksum == 10 and lastDigit in 'Xx') or
- (lastDigit.isdigit() and checksum == int(lastDigit))):
+ if not (checksum == 10 and lastDigit in 'Xx'
+ or lastDigit.isdigit() and checksum == int(lastDigit)):
raise InvalidIsbnException('The ISBN checksum of {0} is incorrect.'
.format(self.code))
@@ -1653,9 +1653,9 @@
# FIXME: See T85483 and run() in WikidataBot
site = pywikibot.Site()
data_site = site.data_repository()
- use_wikibase = (data_site is not None and
- data_site.family == site.family and
- data_site.code == site.code)
+ use_wikibase = (data_site is not None
+ and data_site.family == site.family
+ and data_site.code == site.code)
for arg in local_args:
if arg.startswith('-prop-isbn-10:'):
diff --git a/scripts/match_images.py b/scripts/match_images.py
index b923d16..1c15517 100755
--- a/scripts/match_images.py
+++ b/scripts/match_images.py
@@ -83,8 +83,8 @@
bottomleftScore = match_images(imageA_bottomleft, imageB_bottomleft)
bottomrightScore = match_images(imageA_bottomright, imageB_bottomright)
centerScore = match_images(imageA_center, imageB_center)
- averageScore = (wholeScore + topleftScore + toprightScore +
- bottomleftScore + bottomrightScore + centerScore) / 6
+ averageScore = (wholeScore + topleftScore + toprightScore
+ + bottomleftScore + bottomrightScore + centerScore) / 6
pywikibot.output('Whole image {0:>7.2%}\n'
'Top left of image {1:>7.2%}\n'
--
To view, visit https://gerrit.wikimedia.org/r/474525
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2d1924f71b0a669b650fbf17c053f28c1e5ef0ee
Gerrit-Change-Number: 474525
Gerrit-PatchSet: 5
Gerrit-Owner: Nils ANDRE <nils.andre.chang(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)