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

Felix Yan felixonmars at archlinux.org
Thu May 16 18:48:38 UTC 2019


    Date: Thursday, May 16, 2019 @ 18:48:37
  Author: felixonmars
Revision: 353474

archrelease: copy trunk to testing-any

Added:
  python-requests/repos/testing-any/
  python-requests/repos/testing-any/0001-Support-pytest-4.patch
    (from rev 353473, python-requests/trunk/0001-Support-pytest-4.patch)
  python-requests/repos/testing-any/PKGBUILD
    (from rev 353473, python-requests/trunk/PKGBUILD)
  python-requests/repos/testing-any/certs.patch
    (from rev 353473, python-requests/trunk/certs.patch)

-----------------------------+
 0001-Support-pytest-4.patch |   44 +++++++++++++++++++++++++
 PKGBUILD                    |   72 ++++++++++++++++++++++++++++++++++++++++++
 certs.patch                 |   14 ++++++++
 3 files changed, 130 insertions(+)

Copied: python-requests/repos/testing-any/0001-Support-pytest-4.patch (from rev 353473, python-requests/trunk/0001-Support-pytest-4.patch)
===================================================================
--- testing-any/0001-Support-pytest-4.patch	                        (rev 0)
+++ testing-any/0001-Support-pytest-4.patch	2019-05-16 18:48:37 UTC (rev 353474)
@@ -0,0 +1,44 @@
+From e1eee5262b86d046358c2cc1ba1f4b47da0bbc6d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro at hroncok.cz>
+Date: Mon, 8 Apr 2019 18:04:22 +0200
+Subject: [PATCH] Support pytest 4
+
+Fixes https://github.com/kennethreitz/requests/issues/5048
+
+See https://docs.pytest.org/en/latest/deprecations.html#marks-in-pytest-mark-parametrize
+
+(cherry picked from commit 7a33a8e523be6aa40c7e5435d3c5d92f2cc6e9a0)
+---
+ setup.py            | 2 +-
+ tests/test_utils.py | 3 ++-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 10ce2c62..c26616df 100755
+--- a/setup.py
++++ b/setup.py
+@@ -54,7 +54,7 @@ test_requirements = [
+     'pytest-mock',
+     'pytest-xdist',
+     'PySocks>=1.5.6, !=1.5.7',
+-    'pytest>=2.8.0'
++    'pytest>=3'
+ ]
+ 
+ about = {}
+diff --git a/tests/test_utils.py b/tests/test_utils.py
+index 59b0b0ef..62c51494 100644
+--- a/tests/test_utils.py
++++ b/tests/test_utils.py
+@@ -33,7 +33,8 @@ class TestSuperLen:
+         'stream, value', (
+             (StringIO.StringIO, 'Test'),
+             (BytesIO, b'Test'),
+-            pytest.mark.skipif('cStringIO is None')((cStringIO, 'Test')),
++            pytest.param(cStringIO, 'Test',
++                         marks=pytest.mark.skipif('cStringIO is None')),
+         ))
+     def test_io_streams(self, stream, value):
+         """Ensures that we properly deal with different kinds of IO streams."""
+-- 
+2.21.0

Copied: python-requests/repos/testing-any/PKGBUILD (from rev 353473, python-requests/trunk/PKGBUILD)
===================================================================
--- testing-any/PKGBUILD	                        (rev 0)
+++ testing-any/PKGBUILD	2019-05-16 18:48:37 UTC (rev 353474)
@@ -0,0 +1,72 @@
+# 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.22.0
+pkgrel=1
+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-idna' 'python2-idna')
+checkdepends=('python-pytest-httpbin' 'python2-pytest-httpbin' 'python-pytest-mock'
+              'python2-pytest-mock' 'python-pysocks' 'python2-pysocks' 'python-pyopenssl'
+              'python2-pyopenssl')
+source=("$pkgbase-$pkgver.tar.gz::https://github.com/kennethreitz/requests/archive/v$pkgver.tar.gz"
+        "0001-Support-pytest-4.patch"
+        certs.patch)
+sha512sums=('1259c270e343fc860322b105904232226f26b3b363e9d102d599020fcc7b6e1d524dc6c650181ce3152caebe11d2c60045ddd9c9fc04560294caa284e209c386'
+            '36ac0f06bbeb893e4cc4108e7421de5b9c5e5bff82d5f0e227a1ebde0a5df4ca57236762b45e5025aea4724f1fc320f9f32665a57c77b958e9c05efbe317ccc1'
+            '424a3bb01b23409284f6c9cd2bc22d92df31b85cfd96e1d1b16b5d68adeca670dfed4fff7977d8b10980102b0f780eacc465431021fcd661f3a17168a02a39a3')
+
+prepare() {
+  cd "$srcdir"/requests-$pkgver
+  # pytest 4 support
+  patch -p1 -i ../0001-Support-pytest-4.patch
+  sed -e '/certifi/d' \
+      -e "s/,<.*'/'/" \
+      -i setup.py
+  patch -p1 -i "$srcdir"/certs.patch
+
+  cd "$srcdir"
+  cp -a requests-$pkgver{,-py2}
+  find requests-$pkgver-py2 -name \*.py -exec sed -r 's|^#!(.*)python$|#!\1python2|' -i {} +
+}
+
+build() {
+  cd "$srcdir"/requests-$pkgver
+  python setup.py build
+
+  cd "$srcdir"/requests-$pkgver-py2
+  python2 setup.py build
+}
+
+check() {
+  # Seems to be a problem about pytest-httpbin
+
+  cd "$srcdir"/requests-$pkgver
+  py.test tests -k "not test_https_warnings"
+
+  cd "$srcdir"/requests-$pkgver-py2
+  py.test2 tests -k "not test_https_warnings"
+}
+
+package_python-requests() {
+  depends=('python-urllib3' 'python-chardet' 'python-idna')
+  optdepends=('python-pysocks: SOCKS proxy support')
+
+  cd "$srcdir"/requests-$pkgver
+  python setup.py install --skip-build -O1 --root="$pkgdir"
+}
+
+package_python2-requests() {
+  depends=('python2-urllib3' 'python2-chardet' 'python2-idna')
+  optdepends=('python2-ndg-httpsclient: HTTPS requests with SNI support'
+              'python2-grequests: asynchronous requests with gevent'
+              'python2-pysocks: SOCKS proxy support')
+
+  cd "$srcdir"/requests-$pkgver-py2
+  python2 setup.py install --skip-build -O1 --root="$pkgdir"
+}

Copied: python-requests/repos/testing-any/certs.patch (from rev 353473, python-requests/trunk/certs.patch)
===================================================================
--- testing-any/certs.patch	                        (rev 0)
+++ testing-any/certs.patch	2019-05-16 18:48:37 UTC (rev 353474)
@@ -0,0 +1,14 @@
+diff --git a/requests/certs.py b/requests/certs.py
+index d1a378d7..4e0bffd4 100644
+--- a/requests/certs.py
++++ b/requests/certs.py
+@@ -12,7 +12,8 @@ If you are packaging Requests, e.g., for a Linux distribution or a managed
+ environment, you can change the definition of where() to return a separately
+ packaged CA bundle.
+ """
+-from certifi import where
++def where():
++    return "/etc/ssl/certs/ca-certificates.crt"
+ 
+ if __name__ == '__main__':
+     print(where())



More information about the arch-commits mailing list