Skip to content
Snippets Groups Projects
Commit 985c5b41 authored by Leo's avatar Leo
Browse files

community/py3-pybind11: upgrade to 2.6.2

parent 169327c2
No related branches found
No related tags found
1 merge request!17505community/py3-pybind11: upgrade to 2.6.2
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=py3-pybind11
_pkgname=pybind11
pkgver=2.6.1
pkgrel=2
pkgver=2.6.2
pkgrel=0
pkgdesc="Seamless operability between C++11 and Python"
url="https://github.com/pybind/pybind11"
arch="noarch"
......@@ -17,8 +17,7 @@ checkdepends="
py3-pytest
"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/pybind/pybind11/archive/v$pkgver.tar.gz
fix.patch"
source="$pkgname-$pkgver.tar.gz::https://github.com/pybind/pybind11/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
replaces="py-pybind11" # Backwards compatibility
......@@ -62,5 +61,4 @@ dev() {
default_dev
}
sha512sums="8730efec82eef8dc09a58ca3e3b28fca45880cef85d32aa5524a8fe64e23d5f6dff4ca1b48b3034a287199bd56f4db4d6806c5358bef66fde84ed0fbf80ec264 py3-pybind11-2.6.1.tar.gz
f71c2ab76ad7a60fc6a5e5eca127a725452d5cc8464b02562ac8419f8397d5453e18261dca3659b4821477e76e87e7c44cbf917e1a7c915cce07ef9a1652d2a2 fix.patch"
sha512sums="1eb346ff6b8f827053265340925e2c8038b1e2a89c352fc09f15ebe86128e7ba1f48c4368b193941f034b30bee7f72a94343e05d4841fdbbd0e4d91ed3d32025 py3-pybind11-2.6.2.tar.gz"
From 830f8eda87fa06614a0328c3fce00060f4135e4c Mon Sep 17 00:00:00 2001
From: Yannick Jadoul <yannick.jadoul@belgacom.net>
Date: Thu, 24 Dec 2020 15:53:23 +0100
Subject: [PATCH] tests: update pytest 6.2.1 and fix
test_python_alreadyset_in_destructor (#2741)
* Update pytest to 6.2.1 in tests/requirements.txt
* Pin pytest to last supported version for 3.5
* Suppress PytestUnraisableExceptionWarning and use sys.__unraisablehook__ instead of sys.unraisablehook
* Fix filterwarnings mark on old pytest and old Python versions
* Cleanup ignore_pytest_unraisable_warning decorator
---
tests/requirements.txt | 3 ++-
tests/test_exceptions.py | 13 ++++++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/tests/requirements.txt b/tests/requirements.txt
index 80ed6171d..a6253e004 100644
--- a/tests/requirements.txt
+++ b/tests/requirements.txt
@@ -3,6 +3,7 @@ numpy==1.16.6; python_version<"3.6" and sys_platform!="win32"
numpy==1.18.0; platform_python_implementation=="PyPy" and sys_platform=="darwin" and python_version>="3.6"
numpy==1.19.3; (platform_python_implementation!="PyPy" or sys_platform=="linux") and python_version>="3.6" and python_version<"3.10"
pytest==4.6.9; python_version<"3.5"
-pytest==5.4.3; python_version>="3.5"
+pytest==6.1.2; python_version=="3.5"
+pytest==6.2.1; python_version>="3.6"
scipy==1.2.3; (platform_python_implementation!="PyPy" or sys_platform=="linux") and python_version<"3.6"
scipy==1.5.2; (platform_python_implementation!="PyPy" or sys_platform=="linux") and python_version>="3.6" and python_version<"3.9"
diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py
index 95eac7092..c6cb65299 100644
--- a/tests/test_exceptions.py
+++ b/tests/test_exceptions.py
@@ -50,13 +50,24 @@ def test_python_call_in_catch():
assert d["good"] is True
+def ignore_pytest_unraisable_warning(f):
+ unraisable = "PytestUnraisableExceptionWarning"
+ if hasattr(pytest, unraisable): # Python >= 3.8 and pytest >= 6
+ dec = pytest.mark.filterwarnings("ignore::pytest.{}".format(unraisable))
+ return dec(f)
+ else:
+ return f
+
+
+@ignore_pytest_unraisable_warning
def test_python_alreadyset_in_destructor(monkeypatch, capsys):
hooked = False
triggered = [False] # mutable, so Python 2.7 closure can modify it
if hasattr(sys, "unraisablehook"): # Python 3.8+
hooked = True
- default_hook = sys.unraisablehook
+ # Don't take `sys.unraisablehook`, as that's overwritten by pytest
+ default_hook = sys.__unraisablehook__
def hook(unraisable_hook_args):
exc_type, exc_value, exc_tb, err_msg, obj = unraisable_hook_args
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment