diff options
author | koobs <koobs@FreeBSD.org> | 2014-02-16 15:01:03 +0800 |
---|---|---|
committer | koobs <koobs@FreeBSD.org> | 2014-02-16 15:01:03 +0800 |
commit | 058640e4a1e0f93db6fcf4b30fa0138ecf97b237 (patch) | |
tree | ca3267b32e42c079c17e97692701838440dfc55d /www | |
parent | 95b2f65086db7be20166a5d677136de1efae5d91 (diff) | |
download | freebsd-ports-gnome-058640e4a1e0f93db6fcf4b30fa0138ecf97b237.tar.gz freebsd-ports-gnome-058640e4a1e0f93db6fcf4b30fa0138ecf97b237.tar.zst freebsd-ports-gnome-058640e4a1e0f93db6fcf4b30fa0138ecf97b237.zip |
www/py-grequests: Modernise and fix tests
- Enable STAGE support
- Enable AUTOPLIST support, delete pkg-plist
- RUN_DEPENDS: Use requests 2.x
- Deprecate easy_install target
- Update LICENSE (BSD2CLAUSE)
- Add TEST_DEPENDS
- Make tests work using standard setup.py test command [1]
- Backport commit for tests using requests hook **kwargs [2]
[1] https://github.com/kennethreitz/grequests/pull/47
[2] https://github.com/kennethreitz/grequests/commit/f50782ad63607b85e5e009f4a0a4ce0a8a6aef0d
Diffstat (limited to 'www')
-rw-r--r-- | www/py-grequests/Makefile | 12 | ||||
-rw-r--r-- | www/py-grequests/files/patch-setup.py | 12 | ||||
-rw-r--r-- | www/py-grequests/files/patch-tests__test_grequests.py | 23 | ||||
-rw-r--r-- | www/py-grequests/pkg-plist | 11 |
4 files changed, 38 insertions, 20 deletions
diff --git a/www/py-grequests/Makefile b/www/py-grequests/Makefile index 2060140ca6fd..0f16b19dcf65 100644 --- a/www/py-grequests/Makefile +++ b/www/py-grequests/Makefile @@ -3,17 +3,19 @@ PORTNAME= grequests PORTVERSION= 0.2.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= www python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= koobs@FreeBSD.org COMMENT= Requests with Gevent to make asyncronous HTTP requests -LICENSE= BSD +LICENSE= BSD2CLAUSE RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}gevent>0:${PORTSDIR}/devel/py-gevent \ - ${PYTHON_PKGNAMEPREFIX}requests1>=1.0.0:${PORTSDIR}/www/py-requests1 + ${PYTHON_PKGNAMEPREFIX}requests>=1.0.0:${PORTSDIR}/www/py-requests +TEST_DEPENDS:= ${RUN_DEPENDS} \ + ${PYTHON_PKGNAMEPREFIX}nose>0:${PORTSDIR}/devel/py-nose USE_GITHUB= yes GH_ACCOUNT= kennethreitz @@ -21,10 +23,10 @@ GH_TAGNAME= v${DISTVERSION} GH_COMMIT= aee3be6 USE_PYTHON= yes -USE_PYDISTUTILS= easy_install +USE_PYDISTUTILS= yes +PYDISTUTILS_AUTOPLIST= yes regression-test: build @cd ${WRKSRC} && ${PYTHON_CMD} ${PYSETUP} test -NO_STAGE= yes .include <bsd.port.mk> diff --git a/www/py-grequests/files/patch-setup.py b/www/py-grequests/files/patch-setup.py index 7b55740efc84..4341b18bb660 100644 --- a/www/py-grequests/files/patch-setup.py +++ b/www/py-grequests/files/patch-setup.py @@ -1,10 +1,14 @@ ---- ./setup.py.orig 2013-03-05 10:04:42.000000000 +1100 -+++ ./setup.py 2013-04-29 20:25:38.800634016 +1000 -@@ -56,5 +56,6 @@ +# 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' - ] + ], -+ test_suite='tests' ++ 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 new file mode 100644 index 000000000000..c9434b96b55a --- /dev/null +++ b/www/py-grequests/files/patch-tests__test_grequests.py @@ -0,0 +1,23 @@ +# 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 + diff --git a/www/py-grequests/pkg-plist b/www/py-grequests/pkg-plist deleted file mode 100644 index 201e09822f91..000000000000 --- a/www/py-grequests/pkg-plist +++ /dev/null @@ -1,11 +0,0 @@ -%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/PKG-INFO -%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/SOURCES.txt -%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/dependency_links.txt -%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/not-zip-safe -%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/requires.txt -%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/top_level.txt -%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/grequests.py -%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/grequests.pyc -%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/grequests.pyo -@dirrm %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO -@dirrm %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%% |