diff options
Diffstat (limited to 'dev-python/quantities')
-rw-r--r-- | dev-python/quantities/Manifest | 1 | ||||
-rw-r--r-- | dev-python/quantities/files/quantities-0.12.5-numpy-1.21.patch | 29 | ||||
-rw-r--r-- | dev-python/quantities/quantities-0.12.5.ebuild | 36 |
3 files changed, 66 insertions, 0 deletions
diff --git a/dev-python/quantities/Manifest b/dev-python/quantities/Manifest index fa90e3a5b653..bbd182155d6e 100644 --- a/dev-python/quantities/Manifest +++ b/dev-python/quantities/Manifest @@ -1 +1,2 @@ DIST python-quantities-0.12.4.tar.gz 104093 BLAKE2B 84587726ef3c2f4c7dce4ea538363aecc42aa88c31d2990f834f2de9540b52d6ca0c437c1876a4c2dd5512b4be3af95cc64a1294ea60555ed1b51819f7f46125 SHA512 b5d181880d0789e6fbd55837c5ce65b677764a718be4550f1f553131e171caa59f8fc84d67e69563a293cda01e7b0678074fb311b3766f0013e658a9fa00471f +DIST python-quantities-0.12.5.tar.gz 105130 BLAKE2B db1cf09fa2efc249bc722abe34ed71d0f59d85595f70baf44203785c32179a3598be8aac225adadfd7d5f09c44ec077dcef310ee2fe7ce4d49a1533b04cb9de6 SHA512 db81e45d464e65d6b144d05e1b990fccc5c17ab7fdd47c7bb0c0094ebcacd6af52a3692492561af3a694741810ddac03e4c887d7c6effed833f196493da5f156 diff --git a/dev-python/quantities/files/quantities-0.12.5-numpy-1.21.patch b/dev-python/quantities/files/quantities-0.12.5-numpy-1.21.patch new file mode 100644 index 000000000000..34dd5a075412 --- /dev/null +++ b/dev-python/quantities/files/quantities-0.12.5-numpy-1.21.patch @@ -0,0 +1,29 @@ +From f32e0ce2feeb588eb8b7236700c8c1176e2bc499 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Tue, 17 Aug 2021 08:24:07 +0200 +Subject: [PATCH] fix expected np.arctan2() exception for numpy 1.21 + +NumPy 1.21 has changed the exception type for incorrect np.arctan2() +arguments from ValueError to TypeError. Adjust the test appropriately. + +Fixes #190 +--- + quantities/tests/test_umath.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/quantities/tests/test_umath.py b/quantities/tests/test_umath.py +index f5aeb78..a7ebb18 100644 +--- a/quantities/tests/test_umath.py ++++ b/quantities/tests/test_umath.py +@@ -226,7 +226,7 @@ class TestUmath(TestCase): + np.arctan2(3*pq.V, 3*pq.V), + np.radians(45)*pq.dimensionless + ) +- self.assertRaises(ValueError, np.arctan2, (1*pq.m, 1*pq.m)) ++ self.assertRaises((TypeError, ValueError), np.arctan2, (1*pq.m, 1*pq.m)) + + def test_hypot(self): + self.assertQuantityEqual(np.hypot(3 * pq.m, 4 * pq.m), 5 * pq.m) +-- +2.32.0 + diff --git a/dev-python/quantities/quantities-0.12.5.ebuild b/dev-python/quantities/quantities-0.12.5.ebuild new file mode 100644 index 000000000000..fe5b4e6f264f --- /dev/null +++ b/dev-python/quantities/quantities-0.12.5.ebuild @@ -0,0 +1,36 @@ +# Copyright 2020-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} ) +DISTUTILS_USE_SETUPTOOLS=no + +inherit distutils-r1 + +MY_P="python-quantities-${PV}" +DESCRIPTION="Support for physical quantities with units, based on numpy" +HOMEPAGE="https://github.com/python-quantities/python-quantities" +SRC_URI=" + https://github.com/python-quantities/python-quantities/archive/v${PV}.tar.gz + -> ${MY_P}.tar.gz" +S=${WORKDIR}/${MY_P} + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +RDEPEND=" + dev-python/numpy[$PYTHON_USEDEP] +" + +distutils_enable_tests pytest + +PATCHES=( + "${FILESDIR}"/${P}-numpy-1.21.patch +) + +EPYTEST_DESELECT=( + # unexpected success + quantities/tests/test_umath.py::TestUmath::test_fix +) |