Date: Monday, November 4, 2019 @ 17:12:09 Author: foutrelis Revision: 524106
Python 3.8 rebuild Added: python-pint/trunk/python-3.8.patch Modified: python-pint/trunk/PKGBUILD ------------------+ PKGBUILD | 14 +++++++++++--- python-3.8.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 3 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2019-11-04 16:56:29 UTC (rev 524105) +++ PKGBUILD 2019-11-04 17:12:09 UTC (rev 524106) @@ -3,7 +3,7 @@ pkgname=python-pint pkgver=0.9 -pkgrel=2 +pkgrel=3 pkgdesc="A unit library for Python" arch=('any') license=('BSD') @@ -11,9 +11,17 @@ depends=('python') makedepends=('python-setuptools') checkdepends=('python-numpy' 'python-uncertainties') -source=("https://pypi.io/packages/source/P/Pint/Pint-$pkgver.tar.gz") -sha512sums=('d79e0ff6377393f9dd8ce6a938440e8ed3c947642716974a3d69461d75776a39677d6651e6c081076f31e67a7dbffeb2fded42e61c9975f814b5eb24ab626fb6') +source=("https://pypi.io/packages/source/P/Pint/Pint-$pkgver.tar.gz" + python-3.8.patch) +sha512sums=('d79e0ff6377393f9dd8ce6a938440e8ed3c947642716974a3d69461d75776a39677d6651e6c081076f31e67a7dbffeb2fded42e61c9975f814b5eb24ab626fb6' + '8a2a6d8c3c82471b18f262d65ac8194c3deeee49cd1751892210ea2d6a0e8d4502c97aae70135ae6ca9a92524598475bab0ef50cfa3b9594987e7c75a492722e') +prepare() { + cd Pint-$pkgver + # https://github.com/hgrecco/pint/pull/824 + patch -Np1 -i ../python-3.8.patch +} + check() { cd Pint-$pkgver python setup.py test Added: python-3.8.patch =================================================================== --- python-3.8.patch (rev 0) +++ python-3.8.patch 2019-11-04 17:12:09 UTC (rev 524106) @@ -0,0 +1,50 @@ +From fb7ace52712958a512470c909b3ccf448620a166 Mon Sep 17 00:00:00 2001 +From: xtreak <tir.kar...@gmail.com> +Date: Sat, 29 Jun 2019 04:58:59 +0000 +Subject: [PATCH] Use context manager for assertWarns and fix + DeprecationWarning + +--- + pint/testsuite/parameterized.py | 7 ++++++- + pint/testsuite/test_quantity.py | 3 ++- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/pint/testsuite/parameterized.py b/pint/testsuite/parameterized.py +index 9b92037..7c45915 100644 +--- a/pint/testsuite/parameterized.py ++++ b/pint/testsuite/parameterized.py +@@ -32,6 +32,11 @@ from functools import wraps + import collections + import unittest + ++try: ++ from collections.abc import Callable ++except ImportError: ++ from collections import Callable ++ + def add_metaclass(metaclass): + """Class decorator for creating a class with a metaclass.""" + def wrapper(cls): +@@ -69,7 +74,7 @@ class ParameterizedTestCaseMetaClass(type): + new_class_dict = {} + + for attr_name, attr_value in list(class_dict.items()): +- if isinstance(attr_value, collections.Callable) and hasattr(attr_value, 'param_names'): ++ if isinstance(attr_value, Callable) and hasattr(attr_value, 'param_names'): + # print("Processing attr_name = %r; attr_value = %r" % ( + # attr_name, attr_value)) + +diff --git a/pint/testsuite/test_quantity.py b/pint/testsuite/test_quantity.py +index c7f41cb..89f8776 100644 +--- a/pint/testsuite/test_quantity.py ++++ b/pint/testsuite/test_quantity.py +@@ -416,7 +416,8 @@ class TestQuantityToCompact(QuantityTestCase): + def test_nonnumeric_magnitudes(self): + ureg = self.ureg + x = "some string"*ureg.m +- self.assertRaises(RuntimeError, self.compareQuantity_compact(x,x)) ++ with self.assertWarns(RuntimeWarning): ++ self.compareQuantity_compact(x,x) + + class TestQuantityBasicMath(QuantityTestCase): +