diff options
author | Kubilay Kocak <koobs@FreeBSD.org> | 2016-03-06 11:51:57 +0000 |
---|---|---|
committer | Kubilay Kocak <koobs@FreeBSD.org> | 2016-03-06 11:51:57 +0000 |
commit | e4b316f3b38d292076199c476c4ce1858eb77b06 (patch) | |
tree | 79127e1b9d69b92d5c5bc5d97333d71a6690bafd | |
parent | 5b63de467e6b4bfe0fd2f41c9620b1fa8575f14d (diff) |
www/py-grequests: Update to 0.3.0, Modernize
- Update PORTVERSION and distinfo checksum (0.3.0)
- Update TEST_DEPENDS and test target to new framework
- Remove TESTS option bits accordingly
- Enable NO_ARCH (Architecture independent)
- Remove unnecessary setup.py patch (upstreamed)
- Remove patch for test_grequests.py (backport)
- Backport patch for removing failing test [1]
[1] https://github.com/kennethreitz/grequests/pull/83
Notes
Notes:
svn path=/head/; revision=410455
-rw-r--r-- | www/py-grequests/Makefile | 17 | ||||
-rw-r--r-- | www/py-grequests/distinfo | 4 | ||||
-rw-r--r-- | www/py-grequests/files/patch-2ffb8088 | 33 | ||||
-rw-r--r-- | www/py-grequests/files/patch-setup.py | 14 | ||||
-rw-r--r-- | www/py-grequests/files/patch-tests__test_grequests.py | 23 |
5 files changed, 41 insertions, 50 deletions
diff --git a/www/py-grequests/Makefile b/www/py-grequests/Makefile index faef09ab27ca..f822bb231bcf 100644 --- a/www/py-grequests/Makefile +++ b/www/py-grequests/Makefile @@ -2,9 +2,8 @@ # $FreeBSD$ PORTNAME= grequests -PORTVERSION= 0.2.0 +PORTVERSION= 0.3.0 DISTVERSIONPREFIX= v -PORTREVISION= 2 CATEGORIES= www python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -15,14 +14,8 @@ LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}gevent>0:${PORTSDIR}/devel/py-gevent \ - ${PYTHON_PKGNAMEPREFIX}requests>=1.0.0:${PORTSDIR}/www/py-requests -TEST_DEPENDS:= ${RUN_DEPENDS} \ - ${PYTHON_PKGNAMEPREFIX}nose>0:${PORTSDIR}/devel/py-nose - -OPTIONS_DEFINE= TESTS - -TESTS_DESC= Install test suite requirements -TESTS_BUILD_DEPENDS= ${TEST_DEPENDS} + ${PYTHON_PKGNAMEPREFIX}requests>0:${PORTSDIR}/www/py-requests +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}nose>0:${PORTSDIR}/devel/py-nose USE_GITHUB= yes GH_ACCOUNT= kennethreitz @@ -30,7 +23,9 @@ GH_ACCOUNT= kennethreitz USES= python USE_PYTHON= autoplist distutils -regression-test: build +NO_ARCH= yes + +do-test: @cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test .include <bsd.port.mk> diff --git a/www/py-grequests/distinfo b/www/py-grequests/distinfo index 07684c8913fa..c500d677d5da 100644 --- a/www/py-grequests/distinfo +++ b/www/py-grequests/distinfo @@ -1,2 +1,2 @@ -SHA256 (kennethreitz-grequests-v0.2.0_GH0.tar.gz) = 7e8972ee76b8914dd4cab60df8f63d1b2b7970c390c8f43325491754d3292800 -SIZE (kennethreitz-grequests-v0.2.0_GH0.tar.gz) = 4107 +SHA256 (kennethreitz-grequests-v0.3.0_GH0.tar.gz) = 9c53602bb15d02881d1e0bfa12d58ba53fc9741e8c9e68ad1249b8e9097fa3be +SIZE (kennethreitz-grequests-v0.3.0_GH0.tar.gz) = 5449 diff --git a/www/py-grequests/files/patch-2ffb8088 b/www/py-grequests/files/patch-2ffb8088 new file mode 100644 index 000000000000..13baf85e37f1 --- /dev/null +++ b/www/py-grequests/files/patch-2ffb8088 @@ -0,0 +1,33 @@ +From 2ffb8088f24039aabef574b2680cb373fdb4604a Mon Sep 17 00:00:00 2001 +From: Yuri Prezument <y@yprez.com> +Date: Tue, 23 Feb 2016 13:05:14 +0200 +Subject: [PATCH] Remove failing test + +Remove test_map_timeout_exception_handler_returns_false() test. +The functionality for this was removed in https://github.com/kennethreitz/grequests/commit/394cc +--- + tests.py | 11 ----------- + 1 file changed, 11 deletions(-) + +diff --git a/tests.py b/tests.py +index b3789e3..2b4ef0f 100644 +--- tests.py ++++ tests.py +@@ -130,17 +130,6 @@ def test_map_timeout_no_exception_handler(self): + self.assertTrue(responses[1].ok) + self.assertEqual(len(responses), 2) + +- def test_map_timeout_exception_handler_returns_false(self): +- """ +- if you don't want your exceptions to show up in the map result +- """ +- def exception_handler(request, exception): +- return False +- reqs = [grequests.get(httpbin('delay/1'), timeout=0.001), grequests.get(httpbin('/'))] +- responses = grequests.map(reqs, exception_handler=exception_handler) +- self.assertTrue(responses[0].ok) +- self.assertEqual(len(responses), 1) +- + def test_map_timeout_exception_handler_no_return(self): + """ + ensure default behaviour for a handler that returns None diff --git a/www/py-grequests/files/patch-setup.py b/www/py-grequests/files/patch-setup.py deleted file mode 100644 index 4341b18bb660..000000000000 --- a/www/py-grequests/files/patch-setup.py +++ /dev/null @@ -1,14 +0,0 @@ -# Support test command w/ tests_require & test_suite -# https://github.com/kennethreitz/grequests/pull/47 - ---- ./setup.py.orig 2014-02-16 17:35:13.772145487 +1100 -+++ ./setup.py 2014-02-16 17:36:15.191123632 +1100 -@@ -56,5 +56,7 @@ - 'Programming Language :: Python', - 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', - 'Topic :: Software Development :: Libraries :: Python Modules' -- ] -+ ], -+ tests_require = ['nose'], -+ test_suite = 'nose.collector', - ) diff --git a/www/py-grequests/files/patch-tests__test_grequests.py b/www/py-grequests/files/patch-tests__test_grequests.py deleted file mode 100644 index c9434b96b55a..000000000000 --- a/www/py-grequests/files/patch-tests__test_grequests.py +++ /dev/null @@ -1,23 +0,0 @@ -# Fix: request use **kwargs with its hooks. -# https://github.com/kennethreitz/grequests/commit/f50782ad63607b85e5e009f4a0a4ce0a8a6aef0d - ---- ./tests/test_grequests.py.orig 2014-02-16 17:23:40.926364751 +1100 -+++ ./tests/test_grequests.py 2014-02-16 17:24:14.491232949 +1100 -@@ -38,7 +38,7 @@ - def test_hooks(self): - result = {} - -- def hook(r): -+ def hook(r, **kwargs): - result[r.url] = True - return r - -@@ -49,7 +49,7 @@ - def test_callback_kwarg(self): - result = {'ok': False} - -- def callback(r): -+ def callback(r, **kwargs): - result['ok'] = True - return r - |