Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Feb 2012 16:09:06 GMT
From:      Olivier Duchateau <duchateau.olivier@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/164857: [UPDATE] www/py-requests to 0.10.1
Message-ID:  <201202071609.q17G96t7065788@red.freebsd.org>
Resent-Message-ID: <201202071610.q17GAJM7061010@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         164857
>Category:       ports
>Synopsis:       [UPDATE] www/py-requests to 0.10.1
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 07 16:10:18 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Olivier Duchateau
>Release:        FreeBSD 9.0-RELEASE i386
>Organization:
>Environment:
>Description:
This port works on Python 3.x It needs textproc/py-chardet [1].

[1] http://www.freebsd.org/cgi/query-pr.cgi?pr=164855
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -urN /usr/ports/www/py-requests/Makefile py-requests/Makefile
--- /usr/ports/www/py-requests/Makefile	2012-01-14 19:11:44.000000000 +0000
+++ py-requests/Makefile	2012-02-07 16:18:20.000000000 +0000
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	requests
-PORTVERSION=	0.8.6
+PORTVERSION=	0.10.1
 CATEGORIES=	www python
 MASTER_SITES=	CHEESESHOP
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -17,11 +17,22 @@
 LICENSE=	ISCL
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-RUN_DEPENDS=	${PYTHON_SITELIBDIR}/gevent/__init__.py:${PORTSDIR}/devel/py-gevent
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}urllib3>=1.2:${PORTSDIR}/net/py-urllib3
+RUN_DEPENDS=	${PYTHON_SITELIBDIR}/gevent/__init__.py:${PORTSDIR}/devel/py-gevent \
+	${PYTHON_SITELIBDIR}/certifi/__init__.py:${PORTSDIR}/security/py-certify \
+	${PYTHON_PKGNAMEPREFIX}urllib3>=1.2:${PORTSDIR}/net/py-urllib3 \
+	${PYTHON_PKGNAMEPREFIX}chardet2>=2.0.1:${PORTSDIR}/textproc/py-chardet
 
 USE_PYTHON=	2.6+
 USE_PYDISTUTILS=	easy_install
 
+REINPLACE_ARGS=	-i ""
+
 PLIST_FILES=	%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%
 
+post-patch:
+	@${FIND} ${WRKSRC} -type f -name '*.orig' -exec ${RM} -f \{\} \;
+	@${FIND} ${WRKSRC} -type f -name '*.py' | \
+		${XARGS} ${REINPLACE_CMD} 's|is_linux|is_freebsd|g'
+
 .include <bsd.port.mk>
diff -urN /usr/ports/www/py-requests/distinfo py-requests/distinfo
--- /usr/ports/www/py-requests/distinfo	2012-01-14 19:11:44.000000000 +0000
+++ py-requests/distinfo	2012-02-07 16:18:20.000000000 +0000
@@ -1,2 +1,2 @@
-SHA256 (requests-0.8.6.tar.gz) = b9ad56ff5971b7a4005598e5a9588584ee1153fbf027ed76a7d13585f71489f7
-SIZE (requests-0.8.6.tar.gz) = 52670
+SHA256 (requests-0.10.1.tar.gz) = da6031575a30c7b65ea99465183468349b3645e6bf5322e49d53f565b27ed2b5
+SIZE (requests-0.10.1.tar.gz) = 63234
diff -urN /usr/ports/www/py-requests/files/patch-MANIFEST.in py-requests/files/patch-MANIFEST.in
--- /usr/ports/www/py-requests/files/patch-MANIFEST.in	1970-01-01 00:00:00.000000000 +0000
+++ py-requests/files/patch-MANIFEST.in	2012-02-07 16:18:20.000000000 +0000
@@ -0,0 +1,5 @@
+--- MANIFEST.in.orig	2012-01-22 09:30:39.000000000 +0000
++++ MANIFEST.in	2012-02-07 15:15:00.000000000 +0000
+@@ -1 +1 @@
+-include README.rst LICENSE NOTICE HISTORY.rst test_requests.py
++include README.rst LICENSE NOTICE HISTORY.rst
diff -urN /usr/ports/www/py-requests/files/patch-requests.egg-info_SOURCES.txt py-requests/files/patch-requests.egg-info_SOURCES.txt
--- /usr/ports/www/py-requests/files/patch-requests.egg-info_SOURCES.txt	1970-01-01 00:00:00.000000000 +0000
+++ py-requests/files/patch-requests.egg-info_SOURCES.txt	2012-02-07 16:18:20.000000000 +0000
@@ -0,0 +1,27 @@
+--- requests.egg-info/SOURCES.txt.orig	2012-01-23 07:22:50.000000000 +0000
++++ requests.egg-info/SOURCES.txt	2012-02-07 15:14:04.000000000 +0000
+@@ -4,7 +4,6 @@
+ NOTICE
+ README.rst
+ setup.py
+-test_requests.py
+ requests/__init__.py
+ requests/api.py
+ requests/async.py
+@@ -28,15 +27,3 @@
+ requests/packages/oreos/core.py
+ requests/packages/oreos/monkeys.py
+ requests/packages/oreos/structures.py
+-requests/packages/urllib3/__init__.py
+-requests/packages/urllib3/_collections.py
+-requests/packages/urllib3/connectionpool.py
+-requests/packages/urllib3/exceptions.py
+-requests/packages/urllib3/filepost.py
+-requests/packages/urllib3/poolmanager.py
+-requests/packages/urllib3/request.py
+-requests/packages/urllib3/response.py
+-requests/packages/urllib3/packages/__init__.py
+-requests/packages/urllib3/packages/six.py
+-requests/packages/urllib3/packages/mimetools_choose_boundary/__init__.py
+-requests/packages/urllib3/packages/ssl_match_hostname/__init__.py
+\ No newline at end of file
diff -urN /usr/ports/www/py-requests/files/patch-requests_compat.py py-requests/files/patch-requests_compat.py
--- /usr/ports/www/py-requests/files/patch-requests_compat.py	1970-01-01 00:00:00.000000000 +0000
+++ py-requests/files/patch-requests_compat.py	2012-02-07 16:18:20.000000000 +0000
@@ -0,0 +1,21 @@
+--- requests/compat.py.orig	2012-01-23 06:35:35.000000000 +0000
++++ requests/compat.py	2012-02-07 15:46:29.000000000 +0000
+@@ -4,7 +4,6 @@
+ pythoncompat
+ """
+ 
+-
+ import sys
+ 
+ # -------
+@@ -66,8 +65,8 @@
+ # Windows-based system.
+ is_windows = 'win32' in str(sys.platform).lower()
+ 
+-# Standard Linux 2+ system.
+-is_linux = ('linux' in str(sys.platform).lower())
++# Standard system.
++is_linux = ('freebsd' in str(sys.platform).lower())
+ is_osx = ('darwin' in str(sys.platform).lower())
+ is_hpux = ('hpux' in str(sys.platform).lower())   # Complete guess.
+ is_solaris = ('solar==' in str(sys.platform).lower())   # Complete guess.
diff -urN /usr/ports/www/py-requests/files/patch-requests_models.py py-requests/files/patch-requests_models.py
--- /usr/ports/www/py-requests/files/patch-requests_models.py	1970-01-01 00:00:00.000000000 +0000
+++ py-requests/files/patch-requests_models.py	2012-02-07 16:18:20.000000000 +0000
@@ -0,0 +1,21 @@
+--- requests/models.py.orig	2011-12-28 09:56:17.000000000 +0100
++++ requests/models.py	2012-01-12 17:54:01.000000000 +0100
+@@ -19,12 +19,12 @@
+ from .status_codes import codes
+ from .packages import oreos
+ from .auth import HTTPBasicAuth, HTTPProxyAuth
+-from .packages.urllib3.response import HTTPResponse
+-from .packages.urllib3.exceptions import MaxRetryError
+-from .packages.urllib3.exceptions import SSLError as _SSLError
+-from .packages.urllib3.exceptions import HTTPError as _HTTPError
+-from .packages.urllib3 import connectionpool, poolmanager
+-from .packages.urllib3.filepost import encode_multipart_formdata
++from urllib3.response import HTTPResponse
++from urllib3.exceptions import MaxRetryError
++from urllib3.exceptions import SSLError as _SSLError
++from urllib3.exceptions import HTTPError as _HTTPError
++from urllib3 import connectionpool, poolmanager
++from urllib3.filepost import encode_multipart_formdata
+ from .exceptions import (
+     ConnectionError, HTTPError, RequestException, Timeout, TooManyRedirects,
+     URLRequired, SSLError)
diff -urN /usr/ports/www/py-requests/files/patch-requests_packages___init__.py py-requests/files/patch-requests_packages___init__.py
--- /usr/ports/www/py-requests/files/patch-requests_packages___init__.py	1970-01-01 00:00:00.000000000 +0000
+++ py-requests/files/patch-requests_packages___init__.py	2012-02-07 16:18:20.000000000 +0000
@@ -0,0 +1,7 @@
+--- requests/packages/__init__.py.orig	2011-12-06 23:55:15.000000000 +0100
++++ requests/packages/__init__.py	2012-01-12 18:46:03.000000000 +0100
+@@ -1,3 +1,3 @@
+ from __future__ import absolute_import
+ 
+-from . import urllib3
++#from . import urllib3
diff -urN /usr/ports/www/py-requests/files/patch-requests_sessions.py py-requests/files/patch-requests_sessions.py
--- /usr/ports/www/py-requests/files/patch-requests_sessions.py	1970-01-01 00:00:00.000000000 +0000
+++ py-requests/files/patch-requests_sessions.py	2012-02-07 16:18:20.000000000 +0000
@@ -0,0 +1,11 @@
+--- requests/sessions.py.orig	2011-12-28 10:51:45.000000000 +0100
++++ requests/sessions.py	2012-01-12 23:30:39.000000000 +0100
+@@ -13,7 +13,7 @@
+ from .models import Request
+ from .hooks import dispatch_hook
+ from .utils import header_expand
+-from .packages.urllib3.poolmanager import PoolManager
++from urllib3.poolmanager import PoolManager
+ 
+ 
+ def merge_kwargs(local_kwarg, default_kwarg):
diff -urN /usr/ports/www/py-requests/files/patch-setup.py py-requests/files/patch-setup.py
--- /usr/ports/www/py-requests/files/patch-setup.py	1970-01-01 00:00:00.000000000 +0000
+++ py-requests/files/patch-setup.py	2012-02-07 16:18:20.000000000 +0000
@@ -0,0 +1,46 @@
+--- setup.py.orig	2012-01-23 06:48:28.000000000 +0000
++++ setup.py	2012-02-07 16:11:32.000000000 +0000
+@@ -4,10 +4,9 @@
+ import os
+ import sys
+ import requests
+-from requests.compat import is_py3
+ 
+ try:
+-    from setuptools import setup
++    from setuptools import setup, find_packages
+ except ImportError:
+     from distutils.core import setup
+ 
+@@ -21,12 +20,8 @@
+     os.system('python test_requests.py')
+     sys.exit()
+ 
+-required = ['certifi>=0.0.7',]
+-
+-if is_py3:
+-    required.append('chardet2')
+-else:
+-    required.append('chardet>=1.0.0')
++# FreeBSD ports tree, provides only chardet2
++required = ['certifi>=0.0.7', 'chardet2>=1.0.0']
+ 
+ 
+ setup(
+@@ -38,15 +33,7 @@
+     author='Kenneth Reitz',
+     author_email='me@kennethreitz.com',
+     url='http://python-requests.org',
+-    packages=[
+-        'requests',
+-        'requests.packages',
+-        'requests.packages.urllib3',
+-        'requests.packages.urllib3.packages',
+-        'requests.packages.urllib3.packages.ssl_match_hostname',
+-        'requests.packages.urllib3.packages.mimetools_choose_boundary',
+-        'requests.packages.oreos'
+-    ],
++    packages=find_packages(where='.', exclude=['requests.packages.url*']),
+     package_data={'': ['LICENSE', 'NOTICE']},
+     include_package_data=True,
+     install_requires=required,


>Release-Note:
>Audit-Trail:
>Unformatted:



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