jenkins-bot has submitted this change and it was merged.
Change subject: Require flickrapi 1.4.5 for Python 2
......................................................................
Require flickrapi 1.4.5 for Python 2
flickrapi 1.4.4 installs a logger, which breaks script tests.
flickrapi 1.4.5 and flickrapi 2.x do not have this problem.
Require at least 1.4.5 to avoid this problem, and allow users
to remain on a stable version with less dependencies.
This issue is not relevant to Python 3, as only flickrapi 2.x
will work on Python 3, and setuptools automatically selects it.
Bug: 71454
Change-Id: I58b732a3dae69797fe9bc27067a666c091be2e93
---
M requirements.txt
M setup.py
2 files changed, 17 insertions(+), 6 deletions(-)
Approvals:
John Vandenberg: Looks good to me, but someone else must approve
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/requirements.txt b/requirements.txt
index 08d005c..7547aef 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -38,6 +38,12 @@
argparse
# scripts/flickrripper.py
+# On Python 2, flickrapi 1.4.x or 2.x may be used. Only 2.x works on Python 3.
+# The following automatically selects 2.x on all Python versions, which depends
+# on requests 2.x, which may cause pip to report an error like the following:
+# pkg_resources.VersionConflict: (requests 1.2.3 (/usr/lib/python2.7/site-packages),
Requirement.parse('requests>=2.2.1'))
+# If you see that on Python 2, change this to flickrapi==1.4.5
+# On Python 3, force pip to install requests 2.2.1, or remove flickrapi below.
Pillow
flickrapi
diff --git a/setup.py b/setup.py
index 564ad08..6bc7a38 100644
--- a/setup.py
+++ b/setup.py
@@ -33,11 +33,19 @@
script_deps = {
'script_wui.py': ['irc', 'lunatic-python',
'crontab'],
# Note: None of the 'lunatic-python' repos on github support MS Windows.
- 'flickrripper.py': ['Pillow', 'flickrapi'],
- # Note: 'PIL' is not available via pip2.7 on MS Windows,
- # however it is available with setuptools.
+ 'flickrripper.py': ['Pillow'],
'states_redirect.py': ['pycountry']
}
+# flickrapi 1.4.4 installs a root logger in verbose mode; 1.4.5 fixes this.
+# The problem doesnt exist in flickrapi 2.x.
+# pywikibot accepts flickrapi 1.4.5+ on Python 2, as it has been stable for a
+# long time, and only depends on python-requests 1.x, whereas flickrapi 2.x
+# depends on python-requests 2.x, which is first packaged in Ubuntu 14.04
+# and will be first packaged for Fedora Core 21.
+# flickrapi 1.4.x does not run on Python 3, and setuptools can only
+# select flickrapi 2.x for Python 3 installs.
+script_deps['flickrripper.py'].append('flickrapi' if sys.version_info[0]
> 2
+ else 'flickrapi>=1.4.5')
dependency_links = [
'https://git.wikimedia.org/zip/?r=pywikibot/externals/httplib2.git&format=gz#egg=httplib2-0.8-pywikibot1',
@@ -63,8 +71,6 @@
print("ERROR: Python 3.3 or higher is required!")
sys.exit(1)
-
dependency_links.append('hg+https://bitbucket.org/sybren/flickrapi#egg=…
-
if os.name != 'nt':
# See bug 66010, Windows users will have issues
# when trying to build the C modules.
@@ -80,7 +86,6 @@
# so scripts can be compiled in test suite.
if 'PYSETUP_TEST_EXTRAS' in os.environ:
test_deps += list(itertools.chain(*(script_deps.values())))
-
# late import of setuptools due to monkey-patching above
from ez_setup import use_setuptools
--
To view, visit
https://gerrit.wikimedia.org/r/171491
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I58b732a3dae69797fe9bc27067a666c091be2e93
Gerrit-PatchSet: 9
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
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: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>