[arch-commits] Commit in python-requests/repos (3 files)

Felix Yan felixonmars at archlinux.org
Sun Dec 25 02:36:41 UTC 2016


    Date: Sunday, December 25, 2016 @ 02:36:40
  Author: felixonmars
Revision: 284714

archrelease: copy trunk to staging-any

Added:
  python-requests/repos/staging-any/
  python-requests/repos/staging-any/PKGBUILD
    (from rev 284713, python-requests/trunk/PKGBUILD)
  python-requests/repos/staging-any/certs.patch
    (from rev 284713, python-requests/trunk/certs.patch)

-------------+
 PKGBUILD    |   74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 certs.patch |   13 ++++++++++
 2 files changed, 87 insertions(+)

Copied: python-requests/repos/staging-any/PKGBUILD (from rev 284713, python-requests/trunk/PKGBUILD)
===================================================================
--- staging-any/PKGBUILD	                        (rev 0)
+++ staging-any/PKGBUILD	2016-12-25 02:36:40 UTC (rev 284714)
@@ -0,0 +1,74 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Massimiliano Torromeo <massimiliano.torromeo at gmail.com>
+
+pkgbase=python-requests
+pkgname=('python-requests' 'python2-requests')
+pkgver=2.12.4
+pkgrel=2
+pkgdesc="Python HTTP for Humans"
+arch=('any')
+url="http://python-requests.org"
+license=('Apache')
+makedepends=('python-setuptools' 'python2-setuptools' 'python-chardet' 'python2-chardet'
+             'python-urllib3' 'python2-urllib3' 'python-pysocks' 'python2-pysocks' 'git')
+checkdepends=('python-pytest-httpbin' 'python2-pytest-httpbin' 'python-pytest-mock'
+              'python2-pytest-mock')
+source=("git+https://github.com/kennethreitz/requests.git#tag=v$pkgver"
+        certs.patch)
+sha256sums=('SKIP'
+            'e35e779d8640f35ea2ea51112f967d927b44d59483af4cd2c0945c84e79bb7c7')
+
+prepare() {
+  cd "$srcdir"/requests
+
+  patch -p1 -i "$srcdir"/certs.patch
+  sed -r 's#(\W|^)requests/cacert\.pem(\W|$)##' -i MANIFEST.in
+  rm -f requests/cacert.pem
+
+  rm -r requests/packages/{urllib3,chardet}
+  sed -e '/packages.chardet/d' \
+      -e '/packages.urllib3/d' \
+      -i setup.py
+
+  cd "$srcdir"
+  cp -a requests{,-py2}
+  find requests-py2 -name \*.py -exec sed -r 's|^#!(.*)python$|#!\1python2|' -i {} +
+}
+
+build() {
+  cd "$srcdir"/requests
+  python setup.py build
+
+  cd "$srcdir"/requests-py2
+  python2 setup.py build
+}
+
+check() {
+  cd "$srcdir"/requests
+  test -f "$(python -m requests.certs)"
+  py.test tests
+
+  cd "$srcdir"/requests-py2
+  test -f "$(python2 -m requests.certs)"
+  py.test2 tests || warning "Tests failed"
+}
+
+package_python-requests() {
+  depends=('python-urllib3' 'python-chardet')
+  optdepends=('python-pysocks: SOCKS proxy support')
+
+  cd "$srcdir"/requests
+  python setup.py install --skip-build -O1 --root="$pkgdir"
+  install -m0644 -D "LICENSE" "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}
+
+package_python2-requests() {
+  depends=('python2-urllib3' 'python2-chardet')
+  optdepends=('python2-ndg-httpsclient: HTTPS requests with SNI support'
+              'python2-grequests: asynchronous requests with gevent'
+              'python2-pysocks: SOCKS proxy support')
+
+  cd "$srcdir"/requests-py2
+  python2 setup.py install --skip-build -O1 --root="$pkgdir"
+}

Copied: python-requests/repos/staging-any/certs.patch (from rev 284713, python-requests/trunk/certs.patch)
===================================================================
--- staging-any/certs.patch	                        (rev 0)
+++ staging-any/certs.patch	2016-12-25 02:36:40 UTC (rev 284714)
@@ -0,0 +1,13 @@
+diff --git a/requests/certs.py b/requests/certs.py
+index 07e6475..33db011 100644
+--- a/requests/certs.py
++++ b/requests/certs.py
+@@ -19,7 +19,7 @@ except ImportError:
+     def where():
+         """Return the preferred certificate bundle."""
+         # vendored bundle inside Requests
+-        return os.path.join(os.path.dirname(__file__), 'cacert.pem')
++        return "/etc/ssl/certs/ca-certificates.crt"
+ 
+ if __name__ == '__main__':
+     print(where())



More information about the arch-commits mailing list