Date: Mon, 3 Jul 2017 11:26:15 +0000 (UTC) From: Kubilay Kocak <koobs@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r444938 - in branches/2017Q3/net/py-rainbowstream: . files Message-ID: <201707031126.v63BQFvI061249@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: koobs Date: Mon Jul 3 11:26:14 2017 New Revision: 444938 URL: https://svnweb.freebsd.org/changeset/ports/444938 Log: MFH: r444937 net/py-rainbowstream: Make pocket (really) optional rainbowstream has configurable Pocket support (via settings) but declares the dependency in install_requires, making it a compulsory run-time dependency checked/varified by setuptools. When first committed, given the pocket Python package had not yet been ported, it was (obviously) not included in RUN_DEPENDS, but it was not removed from setup.py:install_requires, resulting in the following runtime error: pkg_resources.DistributionNotFound: The 'pocket' distribution was not found and is required by rainbowstream This could be rectified by the user by installing the package from pip, which is convenient, but which we explicitly recommend against [1]. This commit patches setup.py moving pocket to setup.py:extras_require and the main module to conditionally import pocket, instead of failing as follows: from pocket import Pocket ImportError: No module named pocket While I'm here: - Remove upper bound/limit on 3.x version support [1] See devel/py-pip/pkg-message PR: 220312 Reported by: Petr Fischer <petr.fischer me com> Approved by: ports-secteam (blanket) Added: branches/2017Q3/net/py-rainbowstream/files/patch-rainbowstream_rainbow.py - copied unchanged from r444937, head/net/py-rainbowstream/files/patch-rainbowstream_rainbow.py Modified: branches/2017Q3/net/py-rainbowstream/Makefile branches/2017Q3/net/py-rainbowstream/files/patch-setup.py Directory Properties: branches/2017Q3/ (props changed) Modified: branches/2017Q3/net/py-rainbowstream/Makefile ============================================================================== --- branches/2017Q3/net/py-rainbowstream/Makefile Mon Jul 3 11:22:52 2017 (r444937) +++ branches/2017Q3/net/py-rainbowstream/Makefile Mon Jul 3 11:26:14 2017 (r444938) @@ -3,6 +3,7 @@ PORTNAME= rainbowstream PORTVERSION= 1.3.5 +PORTREVISION= 1 CATEGORIES= net python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -21,8 +22,8 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}dateutil>0:devel/p ${PYTHON_PKGNAMEPREFIX}pillow>0:graphics/py-pillow \ ${PYTHON_PKGNAMEPREFIX}pysocks>0:net/py-pysocks -# Actually 2.7,3.2-3.4 -USES= python:2.7-3.4 +# Actually 2.7,3.2- +USES= python:2.7- USE_PYTHON= autoplist concurrent distutils NO_ARCH= yes Copied: branches/2017Q3/net/py-rainbowstream/files/patch-rainbowstream_rainbow.py (from r444937, head/net/py-rainbowstream/files/patch-rainbowstream_rainbow.py) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2017Q3/net/py-rainbowstream/files/patch-rainbowstream_rainbow.py Mon Jul 3 11:26:14 2017 (r444938, copy of r444937, head/net/py-rainbowstream/files/patch-rainbowstream_rainbow.py) @@ -0,0 +1,17 @@ +# Make pocket actually optional +# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220312 + +--- rainbowstream/rainbow.py.orig 2017-07-03 10:00:26 UTC ++++ rainbowstream/rainbow.py +@@ -20,7 +20,10 @@ from twitter.oauth import OAuth, read_to + from twitter.oauth_dance import oauth_dance + from twitter.util import printNicely + +-from pocket import Pocket ++try: ++ from pocket import Pocket ++except ImportError: ++ pckt = None + + from .draw import * + from .colors import * Modified: branches/2017Q3/net/py-rainbowstream/files/patch-setup.py ============================================================================== --- branches/2017Q3/net/py-rainbowstream/files/patch-setup.py Mon Jul 3 11:22:52 2017 (r444937) +++ branches/2017Q3/net/py-rainbowstream/files/patch-setup.py Mon Jul 3 11:26:14 2017 (r444938) @@ -1,6 +1,9 @@ ---- setup.py.orig 2016-08-04 08:41:32 UTC +# Make pocket actually optional +# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220312 + +--- setup.py.orig 2016-08-16 14:49:45 UTC +++ setup.py -@@ -9,7 +9,7 @@ version = '1.3.3' +@@ -15,14 +15,17 @@ version = '1.3.5' install_requires = [ "python-dateutil", "arrow", @@ -9,3 +12,22 @@ "pyfiglet", "twitter", "Pillow", + "PySocks", +- "pocket" + ] + ++extras_require = { ++ 'pocket': ["pocket"], ++} ++ + # Default user (considers non virtualenv method) + user = os.environ.get('SUDO_USER', os.environ['USER']) + +@@ -65,6 +68,7 @@ setup(name='rainbowstream', + include_package_data=True, + zip_safe=True, + install_requires=install_requires, ++ extras_require=extras_require, + entry_points=""" + # -*- Entry points: -*- + [console_scripts]
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707031126.v63BQFvI061249>