[arch-commits] Commit in python-pint/repos (3 files)
Evangelos Foutras
foutrelis at archlinux.org
Mon Nov 4 17:12:21 UTC 2019
Date: Monday, November 4, 2019 @ 17:12:20
Author: foutrelis
Revision: 524107
archrelease: copy trunk to community-staging-any
Added:
python-pint/repos/community-staging-any/
python-pint/repos/community-staging-any/PKGBUILD
(from rev 524106, python-pint/trunk/PKGBUILD)
python-pint/repos/community-staging-any/python-3.8.patch
(from rev 524106, python-pint/trunk/python-3.8.patch)
------------------+
PKGBUILD | 34 ++++++++++++++++++++++++++++++++++
python-3.8.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 84 insertions(+)
Copied: python-pint/repos/community-staging-any/PKGBUILD (from rev 524106, python-pint/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD (rev 0)
+++ community-staging-any/PKGBUILD 2019-11-04 17:12:20 UTC (rev 524107)
@@ -0,0 +1,34 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Matthew Sloan matthew at sloan.cc
+
+pkgname=python-pint
+pkgver=0.9
+pkgrel=3
+pkgdesc="A unit library for Python"
+arch=('any')
+license=('BSD')
+url="https://pint.readthedocs.org"
+depends=('python')
+makedepends=('python-setuptools')
+checkdepends=('python-numpy' 'python-uncertainties')
+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
+}
+
+package() {
+ cd Pint-$pkgver
+ python setup.py install --root="$pkgdir" --optimize=1
+ install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}
Copied: python-pint/repos/community-staging-any/python-3.8.patch (from rev 524106, python-pint/trunk/python-3.8.patch)
===================================================================
--- community-staging-any/python-3.8.patch (rev 0)
+++ community-staging-any/python-3.8.patch 2019-11-04 17:12:20 UTC (rev 524107)
@@ -0,0 +1,50 @@
+From fb7ace52712958a512470c909b3ccf448620a166 Mon Sep 17 00:00:00 2001
+From: xtreak <tir.karthi at 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):
+
More information about the arch-commits
mailing list