Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jul 2017 11:22:52 +0000 (UTC)
From:      Kubilay Kocak <koobs@FreeBSD.org>
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
Message-ID:  <201707031122.v63BMqEP060926@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <petr.fischer me com>
  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]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707031122.v63BMqEP060926>