From owner-svn-ports-all@freebsd.org Mon Jul 3 11:22:53 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85A009E468A; Mon, 3 Jul 2017 11:22:53 +0000 (UTC) (envelope-from koobs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F1AF684DA; Mon, 3 Jul 2017 11:22:53 +0000 (UTC) (envelope-from koobs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v63BMqF4060930; Mon, 3 Jul 2017 11:22:52 GMT (envelope-from koobs@FreeBSD.org) Received: (from koobs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v63BMqEP060926; Mon, 3 Jul 2017 11:22:52 GMT (envelope-from koobs@FreeBSD.org) Message-Id: <201707031122.v63BMqEP060926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: koobs set sender to koobs@FreeBSD.org using -f From: Kubilay Kocak Date: Mon, 3 Jul 2017 11:22:52 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r444937 - in head/net/py-rainbowstream: . files X-SVN-Group: ports-head X-SVN-Commit-Author: koobs X-SVN-Commit-Paths: in head/net/py-rainbowstream: . files X-SVN-Commit-Revision: 444937 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jul 2017 11:22:53 -0000 Author: koobs Date: Mon Jul 3 11:22:52 2017 New Revision: 444937 URL: https://svnweb.freebsd.org/changeset/ports/444937 Log: 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 MFH: 2017Q3 Added: head/net/py-rainbowstream/files/patch-rainbowstream_rainbow.py (contents, props changed) Modified: head/net/py-rainbowstream/Makefile head/net/py-rainbowstream/files/patch-setup.py Modified: head/net/py-rainbowstream/Makefile ============================================================================== --- head/net/py-rainbowstream/Makefile Mon Jul 3 10:44:07 2017 (r444936) +++ head/net/py-rainbowstream/Makefile Mon Jul 3 11:22:52 2017 (r444937) @@ -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 Added: head/net/py-rainbowstream/files/patch-rainbowstream_rainbow.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/py-rainbowstream/files/patch-rainbowstream_rainbow.py Mon Jul 3 11:22:52 2017 (r444937) @@ -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: head/net/py-rainbowstream/files/patch-setup.py ============================================================================== --- head/net/py-rainbowstream/files/patch-setup.py Mon Jul 3 10:44:07 2017 (r444936) +++ head/net/py-rainbowstream/files/patch-setup.py Mon Jul 3 11:22:52 2017 (r444937) @@ -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]