jenkins-bot has submitted this change and it was merged.
Change subject: Use hg repository for flickrapi on py3
......................................................................
Use hg repository for flickrapi on py3
The packaged flickrapi does not support py3 and forcibly
exits setup.py. The hg repository for flickrapi does
include py3 support.
Also print setuptools version in travis builds.
Change-Id: I4649765068cb7879dbf83b546d518b4fd58b6ce8
---
M .travis.yml
M setup.py
2 files changed, 10 insertions(+), 5 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.travis.yml b/.travis.yml
index a4f914d..918f5f1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -33,6 +33,7 @@
- cd ../..
- if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then export PY3=1; fi
+ - python -c "import setuptools; print(setuptools.__version__)"
script:
- if [[ "$USE_NOSE" == "1" ]]; then nosetests -v -a '!site,!net' tests; else python setup.py test; fi
diff --git a/setup.py b/setup.py
index df8abaa..3c75371 100644
--- a/setup.py
+++ b/setup.py
@@ -37,6 +37,12 @@
# however it is available with setuptools.
}
+dependency_links=[
+ 'https://git.wikimedia.org/zip/?r=pywikibot/externals/httplib2.git&format=gz…',
+ 'git+https://github.com/AlereDevices/lunatic-python.git#egg=lunatic-python',
+ 'git+https://github.com/jayvdb/parse-crontab.git#egg=crontab',
+]
+
if sys.version_info[0] == 2:
if sys.version_info < (2, 6, 5):
raise RuntimeError("ERROR: Pywikibot only runs under Python 2.6.5 or higher")
@@ -58,6 +64,8 @@
if sys.version_info[1] < 3:
print("ERROR: Python 3.3 or higher is required!")
sys.exit(1)
+
+ dependency_links.append('hg+https://bitbucket.org/sybren/flickrapi#egg=flickrapi')
if os.name != 'nt':
# See bug 66010, Windows users will have issues
@@ -112,12 +120,8 @@
for package in find_packages()
if package.startswith('pywikibot.')],
install_requires=dependencies,
+ dependency_links=dependency_links,
extras_require=extra_deps,
- dependency_links=[
- 'https://git.wikimedia.org/zip/?r=pywikibot/externals/httplib2.git&format=gz…',
- 'git+https://github.com/AlereDevices/lunatic-python.git#egg=lunatic-python',
- 'git+https://github.com/jayvdb/parse-crontab.git#egg=crontab',
- ],
url='https://www.mediawiki.org/wiki/Pywikibot',
download_url='https://github.com/wikimedia/pywikibot-core/archive/master.zip#egg=pywikibo…',
test_suite="tests.collector",
--
To view, visit https://gerrit.wikimedia.org/r/159201
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4649765068cb7879dbf83b546d518b4fd58b6ce8
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FEAT] Travis: Check Python 3
......................................................................
[FEAT] Travis: Check Python 3
With b9d252ec558531816f18d05adfce9e9559af7421 Python 3 support is
possible and only the pwb_tests fail. This runs now also a 3.3 test
on Travis but skips pwb_tests on Python 3.
Change-Id: If7fd171c64f612c780bee00beb46d20fd45d1fae
---
M .travis.yml
M tests/pwb_tests.py
2 files changed, 2 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.travis.yml b/.travis.yml
index 2eee812..a4f914d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -32,7 +32,7 @@
- python setup.py install
- cd ../..
- - if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then export USE_NOSE=1; fi
+ - if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then export PY3=1; fi
script:
- if [[ "$USE_NOSE" == "1" ]]; then nosetests -v -a '!site,!net' tests; else python setup.py test; fi
diff --git a/tests/pwb_tests.py b/tests/pwb_tests.py
index e725a9d..109505e 100644
--- a/tests/pwb_tests.py
+++ b/tests/pwb_tests.py
@@ -23,6 +23,7 @@
return subprocess.Popen(command, stdout=subprocess.PIPE).communicate()[0]
+(a)unittest.skipIf(sys.version_info[0] > 2, "The mapping is different in Python 3")
class TestPwb(TestCase):
"""
--
To view, visit https://gerrit.wikimedia.org/r/160283
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If7fd171c64f612c780bee00beb46d20fd45d1fae
Gerrit-PatchSet: 3
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: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Site tests: Only test deleted revs if there are any
......................................................................
[FIX] Site tests: Only test deleted revs if there are any
Change-Id: I337fa2fce7a3cbfc3aa2d0fa5b87c3010a8d51c7
---
M tests/site_tests.py
1 file changed, 6 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 4bfd22e..d3d7b84 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -947,7 +947,12 @@
pywikibot.warning(
"Cannot test Site.deleted_revs; no sysop account configured.")
return
- dr = list(mysite.deletedrevs(total=10, page=mainpage))[0]
+ gen = mysite.deletedrevs(total=10, page=mainpage)
+ for dr in gen:
+ break
+ else:
+ raise unittest.SkipTest(
+ '{0} contains no deleted revisions.'.format(mainpage))
self.assertLessEqual(len(dr['revisions']), 10)
self.assertTrue(all(isinstance(rev, dict)
for rev in dr['revisions']))
--
To view, visit https://gerrit.wikimedia.org/r/160280
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I337fa2fce7a3cbfc3aa2d0fa5b87c3010a8d51c7
Gerrit-PatchSet: 1
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: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Delete duplicated revision deletion tests
......................................................................
Delete duplicated revision deletion tests
In 2008, two sets of tests become identical due to changes in the API.
https://www.mediawiki.org/wiki/Special:Code/pywikipedia/6035
Change-Id: I2a82d58b41dbfc0d7f92b16e9ea56ae00fcf9c75
---
M tests/site_tests.py
1 file changed, 0 insertions(+), 4 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py
index b2fb360..4bfd22e 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -951,10 +951,6 @@
self.assertLessEqual(len(dr['revisions']), 10)
self.assertTrue(all(isinstance(rev, dict)
for rev in dr['revisions']))
- dr2 = list(mysite.deletedrevs(page=mainpage, total=10))[0]
- self.assertLessEqual(len(dr2['revisions']), 10)
- self.assertTrue(all(isinstance(rev, dict)
- for rev in dr2['revisions']))
for item in mysite.deletedrevs(start="2008-10-11T01:02:03Z",
page=mainpage, total=5):
for rev in item['revisions']:
--
To view, visit https://gerrit.wikimedia.org/r/160257
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2a82d58b41dbfc0d7f92b16e9ea56ae00fcf9c75
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: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Use https for OpenStreetMap and Translatewiki
......................................................................
Use https for OpenStreetMap and Translatewiki
Change-Id: Id4c7967cf9209ed2c78e944884a393582a0dcc34
---
M pywikibot/families/i18n_family.py
M pywikibot/families/osm_family.py
2 files changed, 8 insertions(+), 0 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/families/i18n_family.py b/pywikibot/families/i18n_family.py
index 9a1047f..73930a1 100644
--- a/pywikibot/families/i18n_family.py
+++ b/pywikibot/families/i18n_family.py
@@ -22,3 +22,7 @@
def version(self, code):
"""Return the version for this family."""
return "1.23alpha"
+
+ def protocol(self, code):
+ """Return https as the protocol for this family."""
+ return "https"
diff --git a/pywikibot/families/osm_family.py b/pywikibot/families/osm_family.py
index fa878ae..fbb9fe6 100644
--- a/pywikibot/families/osm_family.py
+++ b/pywikibot/families/osm_family.py
@@ -22,3 +22,7 @@
def version(self, code):
"""Return the version for this family."""
return "1.22.7"
+
+ def protocol(self, code):
+ """Return https as the protocol for this family."""
+ return "https"
--
To view, visit https://gerrit.wikimedia.org/r/160182
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id4c7967cf9209ed2c78e944884a393582a0dcc34
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: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Siebrand <siebrand(a)kitano.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Raise exception on unknown MediaWiki exception
......................................................................
Raise exception on unknown MediaWiki exception
Some MediaWiki exceptions should be handled by backing off
and retrying, however others will not resolve themselves
and need to be a python exception
There was a list of three exception that caused a re-try,
but d5cc2b9 removed the list and always retried when there
was a MediaWiki exception.
This change effectively reverts d5cc2b9, but also adds
APIMWException as a subclass of APIError, and adds information
about the three exceptions which should cause an API retry.
Bug: 70754
Change-Id: I3c4d23bfc4f8feb01fc6e349d271fceb746412d8
---
M pywikibot/data/api.py
1 file changed, 32 insertions(+), 2 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 0e846ae..919b7c1 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -75,6 +75,17 @@
return self.info
+class APIMWException(APIError):
+
+ """The API site returned an error about a MediaWiki internal exception."""
+
+ def __init__(self, mediawiki_exception_class_name, info, **kwargs):
+ """Save error dict returned by MW API."""
+ self.mediawiki_exception_class_name = mediawiki_exception_class_name
+ code = 'internal_api_error_' + mediawiki_exception_class_name
+ super(APIMWException, self).__init__(code, info, **kwargs)
+
+
class TimeoutError(Error):
pass
@@ -512,6 +523,7 @@
self._handle_warnings(result)
if "error" not in result:
return result
+
if "*" in result["error"]:
# help text returned
result['error']['help'] = result['error'].pop("*")
@@ -524,9 +536,26 @@
u"Pausing due to database lag: " + info)
self.site.throttle.lag(int(lag.group("lag")))
continue
+
if code.startswith(u'internal_api_error_'):
- self.wait()
- continue
+ class_name = code[len(u'internal_api_error_'):]
+ if class_name in ['DBConnectionError', # r 4984 & r 4580
+ 'DBQueryError', # bug 58158
+ 'ReadOnlyError' # bug 59227
+ ]:
+
+ pywikibot.log(u'MediaWiki exception %s; retrying.'
+ % class_name)
+ self.wait()
+ continue
+
+ pywikibot.log(u"MediaWiki exception %s: query=\n%s"
+ % (class_name,
+ pprint.pformat(self.params)))
+ pywikibot.log(u" response=\n%s" % result)
+
+ raise APIMWException(class_name, info, **result["error"])
+
# bugs 46535, 62126, 64494, 66619
# maybe removed when it 46535 is solved
if code == "failed-save" and \
@@ -540,6 +569,7 @@
% pprint.pformat(self.params))
pywikibot.log(u" response=\n%s"
% result)
+
raise APIError(code, info, **result["error"])
except TypeError:
raise RuntimeError(result)
--
To view, visit https://gerrit.wikimedia.org/r/159968
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3c4d23bfc4f8feb01fc6e349d271fceb746412d8
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>