jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] script_tests: Remove weblinkchecker dependency
......................................................................
[FIX] script_tests: Remove weblinkchecker dependency
When the `memento_client` dependency for `weblinkchecker` was introduced in
3bf9bfac it was added to the script tests. But the script runs fine without it
when it's not installed and causes an unexpected success. But this didn't cause
a problem because the script included the file name extension so it wasn't
expecting a failure as it was expecting it from a script with an additional
`.py` extension.
Change-Id: I8510cfa2553d5d5ad7e04c633b60b0a7ed9687be
---
M tests/script_tests.py
1 file changed, 0 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/script_tests.py b/tests/script_tests.py
index 3756ddd..10cd8d1 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -45,7 +45,6 @@
'panoramiopicker': ['BeautifulSoup'],
'states_redirect': ['pycountry'],
'patrol': ['mwlib'],
- 'weblinkchecker.py': ['memento_client'],
}
if PYTHON_VERSION < (2, 7):
--
To view, visit https://gerrit.wikimedia.org/r/241303
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8510cfa2553d5d5ad7e04c633b60b0a7ed9687be
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] Don't limit cryptography module on 2.6
......................................................................
[IMPROV] Don't limit cryptography module on 2.6
The cryptography module does complain on Python 2.6 that it's outdated. So it's
using the newest version which doesn't issue that warning. But that could
compromise the security as it won't include security patches.
This is now not limiting that version anymore and installing the newest version
on Python 2.6 as well. By default the deprecation warning is hidden but if the
user still wishes to suppress this warning they can install version 0.8.2 or
before.
Bug: T108061
Change-Id: If5270a0b2214c2f3b124d50180a122bfeeadc3cb
---
M requests-requirements.txt
M requirements.txt
M setup.py
M tests/utils.py
4 files changed, 16 insertions(+), 13 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/requests-requirements.txt b/requests-requirements.txt
index 2923433..778c9f6 100644
--- a/requests-requirements.txt
+++ b/requests-requirements.txt
@@ -1,9 +1,5 @@
requests
-# Dependency of pyOpenSSL. Use specific version to avoid expected
-# DeprecationWarning
-cryptography<=0.8.2 ; python_version < '2.7'
-
# requests security extra
# Bug T105767 on Python 2.7 release 9+
pyOpenSSL ; python_full_version < '2.7.9' or python_version >= '3'
diff --git a/requirements.txt b/requirements.txt
index c7db758..cad79bf 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -21,10 +21,6 @@
# mandatory; see README.conversion.txt
requests
-# Dependency of pyOpenSSL. Use specific version to avoid expected
-# DeprecationWarning
-cryptography<=0.8.2 ; python_version < '2.7'
-
# requests security extra
pyOpenSSL ; python_full_version < '2.7.9'
ndg-httpsclient ; python_full_version < '2.7.9'
diff --git a/setup.py b/setup.py
index 2a2d63f..6a120b1 100644
--- a/setup.py
+++ b/setup.py
@@ -107,11 +107,6 @@
if sys.version_info[0] == 2:
if PY26:
- # requests security extra includes pyOpenSSL. cryptography is the
- # dependency of pyOpenSSL. 0.8.2 is the newest and compatible version
- # for Python 2.6, which won't raise unexpected DeprecationWarning.
- extra_deps['security'].append('cryptography<=0.8.2')
-
script_deps['replicate_wiki.py'] = ['argparse']
dependencies.append('future>=0.15.0') # provides collections backports
diff --git a/tests/utils.py b/tests/utils.py
index 654b91b..69f2fae 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -44,6 +44,9 @@
OSWIN32 = (sys.platform == 'win32')
+PYTHON_26_CRYPTO_WARN = ('Python 2.6 is no longer supported by the Python core '
+ 'team, please upgrade your Python.')
+
class DrySiteNote(RuntimeWarning):
@@ -231,6 +234,12 @@
if PYTHON_VERSION >= (3, 5, 0):
if str(entry.message) == ('inspect.getargspec() is deprecated, '
'use inspect.signature() instead'):
+ return
+ # Avoid failures because cryptography is mentioning Python 2.6
+ # is outdated
+ if PYTHON_VERSION < (2, 7):
+ if (isinstance(entry, DeprecationWarning) and
+ str(entry.message) == PYTHON_26_CRYPTO_WARN):
return
log.append(entry)
@@ -557,9 +566,16 @@
"""
Execute a command and capture outputs.
+ On Python 2.6 it adds an option to ignore the deprecation warning from
+ the cryptography package after the first entry of the command parameter.
+
@param command: executable to run and arguments to use
@type command: list of unicode
"""
+ if PYTHON_VERSION < (2, 7):
+ command.insert(
+ 1, '-W ignore:{0}:DeprecationWarning'.format(PYTHON_26_CRYPTO_WARN))
+
# Any environment variables added on Windows must be of type
# str() on Python 2.
env = os.environ.copy()
--
To view, visit https://gerrit.wikimedia.org/r/241251
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If5270a0b2214c2f3b124d50180a122bfeeadc3cb
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FEAT] Test Python 3.5 on Travis
......................................................................
[FEAT] Test Python 3.5 on Travis
As Python 3.5 has been officially released we should test on this. There are
minor issues with deprecations as `inspect.getargspec` has been deprecated. But
apart from a deprecation message it still works and will only be broken with
Python 3.6.
Bug: T106209
Change-Id: Ic8256184d1c1dbf841def5ad3846155564e05b75
---
M .travis.yml
M tests/utils.py
2 files changed, 7 insertions(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.travis.yml b/.travis.yml
index 01b04ad..eaca16b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,6 +8,7 @@
- '2.7'
- '3.3'
- '3.4'
+ - '3.5'
- '2.6'
# OSX builds do not yet support Python
diff --git a/tests/utils.py b/tests/utils.py
index fb2fafb..654b91b 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -227,6 +227,12 @@
else:
skip_lines -= 1
+ # Avoid failures because getargspec hasn't been removed yet: T106209
+ if PYTHON_VERSION >= (3, 5, 0):
+ if str(entry.message) == ('inspect.getargspec() is deprecated, '
+ 'use inspect.signature() instead'):
+ return
+
log.append(entry)
log = super(WarningSourceSkipContextManager, self).__enter__()
--
To view, visit https://gerrit.wikimedia.org/r/241147
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic8256184d1c1dbf841def5ad3846155564e05b75
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Fix interwikiFormat support for Link
......................................................................
Fix interwikiFormat support for Link
interwikiFormat is supposed to support a dictionary of Page or Link
objects. There were several merges of core and compat 'textlib' to
keep the two in sync, such as core's 8978bfb6, and the support for
Link was broken somewhere along the way.
Add tests for Link in addition to existing tests for Page.
Also add a ValueError exception if it contains any other type.
Change-Id: Ibb39ea8b3079083feec93249eb6abe4b997feb74
---
M pywikibot/textlib.py
M tests/textlib_tests.py
2 files changed, 16 insertions(+), 5 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 18b9d7d..5998ac0 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -941,14 +941,15 @@
ar = interwikiSort(list(links.keys()), insite)
s = []
for site in ar:
- try:
+ if isinstance(links[site], pywikibot.Link):
+ links[site] = pywikibot.Page(links[site])
+ if isinstance(links[site], pywikibot.Page):
title = links[site].title(asLink=True, forceInterwiki=True,
insite=insite)
link = title.replace('[[:', '[[')
s.append(link)
- except AttributeError:
- s.append(pywikibot.Site(site, insite.family).linkto(
- links[site], othersite=insite))
+ else:
+ raise ValueError('links dict must contain Page or Link objects')
if insite.code in insite.family.interwiki_on_one_line:
sep = u' '
else:
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index ff37a56..e50d5ef 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -104,7 +104,7 @@
cached = True
- def test_interwiki_format(self):
+ def test_interwiki_format_Page(self):
"""Test formatting interwiki links using Page instances."""
interwikis = {
'de': pywikibot.Page(pywikibot.Link('de:German', self.site)),
@@ -114,6 +114,16 @@
% {'LS': config.LS},
textlib.interwikiFormat(interwikis, self.site))
+ def test_interwiki_format_Link(self):
+ """Test formatting interwiki links using Page instances."""
+ interwikis = {
+ 'de': pywikibot.Link('de:German', self.site),
+ 'fr': pywikibot.Link('fr:French', self.site),
+ }
+ self.assertEqual('[[de:German]]%(LS)s[[fr:French]]%(LS)s'
+ % {'LS': config.LS},
+ textlib.interwikiFormat(interwikis, self.site))
+
class TestFormatCategory(DefaultDrySiteTestCase):
--
To view, visit https://gerrit.wikimedia.org/r/240649
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibb39ea8b3079083feec93249eb6abe4b997feb74
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>