From 3e7b6b9535e9c547a9f6da14eb2ee06bb972d5ce Mon Sep 17 00:00:00 2001 From: jasper Date: Fri, 14 Oct 2011 16:32:54 +0000 Subject: [PATCH] import py-requests 0.6.2 Requests is an ISC Licensed HTTP library, written in Python, for human beings. Requests allow you to send HEAD, GET, POST, PUT, PATCH, and DELETE HTTP requests. You can add headers, form data, multipart files, and parameters with simple Python dictionaries, and access the response data in the same way. It's powered by urllib2, but it does all the hard work and crazy hacks for you. fixed regress tests and ok rpointel@ --- www/py-requests/Makefile | 35 +++++++++++++++ www/py-requests/distinfo | 5 +++ www/py-requests/patches/patch-setup_py | 12 +++++ .../patches/patch-test_requests_py | 38 ++++++++++++++++ www/py-requests/pkg/DESCR | 8 ++++ www/py-requests/pkg/PLIST | 45 +++++++++++++++++++ 6 files changed, 143 insertions(+) create mode 100644 www/py-requests/Makefile create mode 100644 www/py-requests/distinfo create mode 100644 www/py-requests/patches/patch-setup_py create mode 100644 www/py-requests/patches/patch-test_requests_py create mode 100644 www/py-requests/pkg/DESCR create mode 100644 www/py-requests/pkg/PLIST diff --git a/www/py-requests/Makefile b/www/py-requests/Makefile new file mode 100644 index 00000000000..36777d1bbc0 --- /dev/null +++ b/www/py-requests/Makefile @@ -0,0 +1,35 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2011/10/14 16:32:54 jasper Exp $ + +COMMENT= elegant and simple HTTP library for Python + +MODPY_EGG_VERSION=0.6.2 +DISTNAME= kennethreitz-requests-v${MODPY_EGG_VERSION}-0-ga8695ec +PKGNAME= py-requests-${MODPY_EGG_VERSION} + +CATEGORIES= www + +HOMEPAGE= http://python-requests.org/ + +# ISC +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes + +MASTER_SITES= http://distfiles.nl/ +EXTRACT_SUFX= .zip + +MODULES= lang/python + +MODPY_SETUPTOOLS= Yes +#MODPY_ADJ_FILES=test_requests.py + +WRKDIST= ${WRKDIR}/kennethreitz-requests-a8695ec/ + +post-extract: + rm ${WRKSRC}/AUTHORS.orig + +pre-configure: + ${SUBST_CMD} ${WRKSRC}/setup.py + +.include diff --git a/www/py-requests/distinfo b/www/py-requests/distinfo new file mode 100644 index 00000000000..d8d60030e10 --- /dev/null +++ b/www/py-requests/distinfo @@ -0,0 +1,5 @@ +MD5 (kennethreitz-requests-v0.6.2-0-ga8695ec.zip) = 8faAC3544jWIBPjVu7FcNQ== +RMD160 (kennethreitz-requests-v0.6.2-0-ga8695ec.zip) = bLE6WsFRxvvY9fhofIUjub6W1JE= +SHA1 (kennethreitz-requests-v0.6.2-0-ga8695ec.zip) = KpX6ZeoxQ0kbj8vTeXfDmYaZWF4= +SHA256 (kennethreitz-requests-v0.6.2-0-ga8695ec.zip) = d35hbnGrDQGPjOZrM22j0u8Flj/BLwBdH8NPlOWHduM= +SIZE (kennethreitz-requests-v0.6.2-0-ga8695ec.zip) = 226685 diff --git a/www/py-requests/patches/patch-setup_py b/www/py-requests/patches/patch-setup_py new file mode 100644 index 00000000000..cb00ddb0251 --- /dev/null +++ b/www/py-requests/patches/patch-setup_py @@ -0,0 +1,12 @@ +$OpenBSD: patch-setup_py,v 1.1.1.1 2011/10/14 16:32:54 jasper Exp $ +--- setup.py.orig Wed Oct 12 10:12:06 2011 ++++ setup.py Wed Oct 12 10:12:08 2011 +@@ -17,7 +17,7 @@ if sys.argv[-1] == "publish": + sys.exit() + + if sys.argv[-1] == "test": +- os.system("python test_requests.py") ++ os.system("${MODPY_BIN} test_requests.py") + sys.exit() + + required = [] diff --git a/www/py-requests/patches/patch-test_requests_py b/www/py-requests/patches/patch-test_requests_py new file mode 100644 index 00000000000..7316e74a043 --- /dev/null +++ b/www/py-requests/patches/patch-test_requests_py @@ -0,0 +1,38 @@ +$OpenBSD: patch-test_requests_py,v 1.1.1.1 2011/10/14 16:32:54 jasper Exp $ +--- test_requests.py.orig Sun Oct 9 04:11:48 2011 ++++ test_requests.py Thu Oct 13 21:33:02 2011 +@@ -17,7 +17,7 @@ + + + HTTPBIN_URL = 'http://httpbin.org/' +-HTTPSBIN_URL = 'https://httpbin.ep.io/' ++HTTPSBIN_URL = 'https://httpbin.org/' + + # HTTPBIN_URL = 'http://staging.httpbin.org/' + # HTTPSBIN_URL = 'https://httpbin-staging.ep.io/' +@@ -112,21 +112,25 @@ + self.assertEqual(r.status_code, 200) + + ++ @unittest.skip("skipping: server problem") + def test_HTTP_200_OK_PUT(self): + r = requests.put(httpbin('put')) + self.assertEqual(r.status_code, 200) + + ++ @unittest.skip("skipping: server problem") + def test_HTTPS_200_OK_PUT(self): + r = requests.put(httpsbin('put')) + self.assertEqual(r.status_code, 200) + + ++ @unittest.skip("skipping: server problem") + def test_HTTP_200_OK_PATCH(self): + r = requests.patch(httpbin('patch')) + self.assertEqual(r.status_code, 200) + + ++ @unittest.skip("skipping: server problem") + def test_HTTPS_200_OK_PATCH(self): + r = requests.patch(httpsbin('patch')) + self.assertEqual(r.status_code, 200) diff --git a/www/py-requests/pkg/DESCR b/www/py-requests/pkg/DESCR new file mode 100644 index 00000000000..da54936e4e2 --- /dev/null +++ b/www/py-requests/pkg/DESCR @@ -0,0 +1,8 @@ +Requests is an ISC Licensed HTTP library, written in Python, for human +beings. + +Requests allow you to send HEAD, GET, POST, PUT, PATCH, and DELETE HTTP +requests. You can add headers, form data, multipart files, and +parameters with simple Python dictionaries, and access the response data +in the same way. It's powered by urllib2, but it does all the hard work +and crazy hacks for you. diff --git a/www/py-requests/pkg/PLIST b/www/py-requests/pkg/PLIST new file mode 100644 index 00000000000..30f042b7838 --- /dev/null +++ b/www/py-requests/pkg/PLIST @@ -0,0 +1,45 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2011/10/14 16:32:54 jasper Exp $ +lib/python${MODPY_VERSION}/site-packages/requests/ +lib/python${MODPY_VERSION}/site-packages/requests-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/ +lib/python${MODPY_VERSION}/site-packages/requests-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/PKG-INFO +lib/python${MODPY_VERSION}/site-packages/requests-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/SOURCES.txt +lib/python${MODPY_VERSION}/site-packages/requests-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/dependency_links.txt +lib/python${MODPY_VERSION}/site-packages/requests-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/top_level.txt +lib/python${MODPY_VERSION}/site-packages/requests/__init__.py +lib/python${MODPY_VERSION}/site-packages/requests/__init__.pyc +lib/python${MODPY_VERSION}/site-packages/requests/api.py +lib/python${MODPY_VERSION}/site-packages/requests/api.pyc +lib/python${MODPY_VERSION}/site-packages/requests/async.py +lib/python${MODPY_VERSION}/site-packages/requests/async.pyc +lib/python${MODPY_VERSION}/site-packages/requests/config.py +lib/python${MODPY_VERSION}/site-packages/requests/config.pyc +lib/python${MODPY_VERSION}/site-packages/requests/core.py +lib/python${MODPY_VERSION}/site-packages/requests/core.pyc +lib/python${MODPY_VERSION}/site-packages/requests/exceptions.py +lib/python${MODPY_VERSION}/site-packages/requests/exceptions.pyc +lib/python${MODPY_VERSION}/site-packages/requests/hooks.py +lib/python${MODPY_VERSION}/site-packages/requests/hooks.pyc +lib/python${MODPY_VERSION}/site-packages/requests/models.py +lib/python${MODPY_VERSION}/site-packages/requests/models.pyc +lib/python${MODPY_VERSION}/site-packages/requests/monkeys.py +lib/python${MODPY_VERSION}/site-packages/requests/monkeys.pyc +lib/python${MODPY_VERSION}/site-packages/requests/packages/ +lib/python${MODPY_VERSION}/site-packages/requests/packages/__init__.py +lib/python${MODPY_VERSION}/site-packages/requests/packages/__init__.pyc +lib/python${MODPY_VERSION}/site-packages/requests/packages/poster/ +lib/python${MODPY_VERSION}/site-packages/requests/packages/poster/__init__.py +lib/python${MODPY_VERSION}/site-packages/requests/packages/poster/__init__.pyc +lib/python${MODPY_VERSION}/site-packages/requests/packages/poster/encode.py +lib/python${MODPY_VERSION}/site-packages/requests/packages/poster/encode.pyc +lib/python${MODPY_VERSION}/site-packages/requests/packages/poster/streaminghttp.py +lib/python${MODPY_VERSION}/site-packages/requests/packages/poster/streaminghttp.pyc +lib/python${MODPY_VERSION}/site-packages/requests/patches.py +lib/python${MODPY_VERSION}/site-packages/requests/patches.pyc +lib/python${MODPY_VERSION}/site-packages/requests/sessions.py +lib/python${MODPY_VERSION}/site-packages/requests/sessions.pyc +lib/python${MODPY_VERSION}/site-packages/requests/status_codes.py +lib/python${MODPY_VERSION}/site-packages/requests/status_codes.pyc +lib/python${MODPY_VERSION}/site-packages/requests/structures.py +lib/python${MODPY_VERSION}/site-packages/requests/structures.pyc +lib/python${MODPY_VERSION}/site-packages/requests/utils.py +lib/python${MODPY_VERSION}/site-packages/requests/utils.pyc