[arch-commits] Commit in python-vcrpy/repos (3 files)
Felix Yan
felixonmars at archlinux.org
Sat Jul 21 09:08:36 UTC 2018
Date: Saturday, July 21, 2018 @ 09:08:36
Author: felixonmars
Revision: 362689
archrelease: copy trunk to community-staging-any
Added:
python-vcrpy/repos/community-staging-any/
python-vcrpy/repos/community-staging-any/PKGBUILD
(from rev 362688, python-vcrpy/trunk/PKGBUILD)
python-vcrpy/repos/community-staging-any/python3.7.patch
(from rev 362688, python-vcrpy/trunk/python3.7.patch)
-----------------+
PKGBUILD | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
python3.7.patch | 39 +++++++++++++++++++++++++++++++++++
2 files changed, 98 insertions(+)
Copied: python-vcrpy/repos/community-staging-any/PKGBUILD (from rev 362688, python-vcrpy/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD (rev 0)
+++ community-staging-any/PKGBUILD 2018-07-21 09:08:36 UTC (rev 362689)
@@ -0,0 +1,59 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+pkgbase=python-vcrpy
+pkgname=('python-vcrpy' 'python2-vcrpy')
+pkgver=1.13.0
+pkgrel=1
+pkgdesc='Automatically mock your HTTP interactions to simplify and speed up testing'
+arch=('any')
+license=('MIT')
+url='https://github.com/kevin1024/vcrpy'
+makedepends=('python-setuptools' 'python2-setuptools' 'python-yaml' 'python2-yaml' 'python-wrapt'
+ 'python2-wrapt' 'python-six' 'python2-six' 'python-yarl' 'python2-contextlib2'
+ 'python2-mock')
+checkdepends=('python-pytest-runner' 'python2-pytest-runner' 'python-pytest-httpbin'
+ 'python2-pytest-httpbin' 'python-mock')
+source=("$pkgbase-$pkgver.tar.gz::https://github.com/kevin1024/vcrpy/archive/v$pkgver.tar.gz"
+ python3.7.patch)
+sha512sums=('dda875faa6c5e29c26c774b45b27e046437cf9add0b7e73bd5be545062dbde46b91e90fbc0dafe1efd5c76e447068fabd3018c6ff35db1e8bb009e50a72bd341'
+ '369676b91ec3f0118112391d6b30bf4787211ec8fe9e35b79eb32b8179b02f70495c6b7d58e4d756c8530038a3fc7fc288cc636cd4a78193ecc8798b28d238dc')
+
+prepare() {
+ patch -d vcrpy-$pkgver -p1 -i "$srcdir"/python3.7.patch
+ cp -a vcrpy-$pkgver{,-py2}
+}
+
+build() {
+ cd "$srcdir"/vcrpy-$pkgver
+ python setup.py build
+
+ cd "$srcdir"/vcrpy-$pkgver-py2
+ python2 setup.py build
+}
+
+check() {
+ cd "$srcdir"/vcrpy-$pkgver
+ python setup.py pytest
+
+ cd "$srcdir"/vcrpy-$pkgver-py2
+ python2 setup.py pytest
+}
+
+package_python-vcrpy() {
+ depends=('python-yaml' 'python-wrapt' 'python-six' 'python-yarl')
+
+ cd vcrpy-$pkgver
+ python setup.py install --root="$pkgdir" --optimize=1
+ install -D -m644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt
+}
+
+package_python2-vcrpy() {
+ depends=('python2-yaml' 'python2-wrapt' 'python2-six' 'python2-contextlib2' 'python2-mock')
+
+ cd vcrpy-$pkgver-py2
+ python2 setup.py install --root="$pkgdir" --optimize=1
+ install -D -m644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt
+}
+
+# vim:set ts=2 sw=2 et:
Copied: python-vcrpy/repos/community-staging-any/python3.7.patch (from rev 362688, python-vcrpy/trunk/python3.7.patch)
===================================================================
--- community-staging-any/python3.7.patch (rev 0)
+++ community-staging-any/python3.7.patch 2018-07-21 09:08:36 UTC (rev 362689)
@@ -0,0 +1,39 @@
+diff --git a/tests/integration/test_urllib2.py b/tests/integration/test_urllib2.py
+index 8a633ba..3c0b021 100644
+--- a/tests/integration/test_urllib2.py
++++ b/tests/integration/test_urllib2.py
+@@ -1,6 +1,7 @@
+ # -*- coding: utf-8 -*-
+ '''Integration tests with urllib2'''
+
++import ssl
+ from six.moves.urllib.request import urlopen
+ from six.moves.urllib_parse import urlencode
+ import pytest_httpbin.certs
+@@ -12,7 +13,9 @@ from assertions import assert_cassette_has_one_response
+
+
+ def urlopen_with_cafile(*args, **kwargs):
+- kwargs['cafile'] = pytest_httpbin.certs.where()
++ context = ssl.create_default_context(cafile=pytest_httpbin.certs.where())
++ context.check_hostname = False
++ kwargs['context'] = context
+ try:
+ return urlopen(*args, **kwargs)
+ except TypeError:
+diff --git a/vcr/cassette.py b/vcr/cassette.py
+index d64dec6..3b6f54e 100644
+--- a/vcr/cassette.py
++++ b/vcr/cassette.py
+@@ -136,7 +136,10 @@ class CassetteContextDecorator(object):
+ except Exception:
+ to_yield = coroutine.throw(*sys.exc_info())
+ else:
+- to_yield = coroutine.send(to_send)
++ try:
++ to_yield = coroutine.send(to_send)
++ except StopIteration:
++ break
+
+ def _handle_function(self, fn):
+ with self as cassette:
More information about the arch-commits
mailing list