commit:     c01ca5e9ecb1a56e9c77b6599da2af2578ff6b24
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 26 00:22:53 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 26 00:29:58 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c01ca5e9

dev-python/qiskit-aer: enable py3.11

Closes: https://bugs.gentoo.org/896868
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/qiskit-aer-0.11.2-terra-test.patch       | 45 ++++++++++++++++++++++
 dev-python/qiskit-aer/qiskit-aer-0.11.2-r1.ebuild  | 36 +++++++++--------
 2 files changed, 66 insertions(+), 15 deletions(-)

diff --git a/dev-python/qiskit-aer/files/qiskit-aer-0.11.2-terra-test.patch 
b/dev-python/qiskit-aer/files/qiskit-aer-0.11.2-terra-test.patch
new file mode 100644
index 000000000000..e9f65dd6a42a
--- /dev/null
+++ b/dev-python/qiskit-aer/files/qiskit-aer-0.11.2-terra-test.patch
@@ -0,0 +1,45 @@
+https://github.com/Qiskit/qiskit-aer/commit/cec5c11513118fa8d701e2bef1376dc3db7263c3
+
+From cec5c11513118fa8d701e2bef1376dc3db7263c3 Mon Sep 17 00:00:00 2001
+From: Jun Doi <[email protected]>
+Date: Fri, 27 Jan 2023 18:55:59 +0900
+Subject: [PATCH] Fix test_aer_statevector (#1710)
+
+* fix test_aer_statevector
+
+* add plot directive to docs
+
+* fix test_aer_statevector and remove reno
+
+Co-authored-by: Hiroshi Horii <[email protected]>
+--- a/docs/conf.py
++++ b/docs/conf.py
+@@ -67,6 +67,7 @@ extensions = [
+     'sphinx_tabs.tabs',
+     'jupyter_sphinx',
+     'reno.sphinxext',
++    'matplotlib.sphinxext.plot_directive',
+ ]
+ html_static_path = ['_static']
+ templates_path = ['_templates']
+--- a/test/terra/states/test_aer_statevector.py
++++ b/test/terra/states/test_aer_statevector.py
+@@ -1347,13 +1347,14 @@ class TestAerStatevector(common.QiskitAerTestCase):
+             ([-1, 1j], ["-", "+i"]),
+             ([1e-16 + 1j], ["i"]),
+             ([-1 + 1e-16 * 1j], ["-"]),
+-            ([-1, -1 - 1j], ["-", "+ (-1 - i)"]),
++            ([-1, -1 - 1j], ["-", "+(-1 - i)"]),
+             ([np.sqrt(2) / 2, np.sqrt(2) / 2], ["\\frac{\\sqrt{2}}{2}", 
"+\\frac{\\sqrt{2}}{2}"]),
+             ([1 + np.sqrt(2)], ["(1 + \\sqrt{2})"]),
+         ]
+-        for numbers, latex_terms in cases:
+-            terms = numbers_to_latex_terms(numbers)
+-            self.assertListEqual(terms, latex_terms)
++        with self.assertWarns(DeprecationWarning):
++            for numbers, latex_terms in cases:
++                terms = numbers_to_latex_terms(numbers, 15)
++                self.assertListEqual(terms, latex_terms)
+ 
+     def test_statevector_draw_latex_regression(self):
+         """Test numerical rounding errors are not printed"""

diff --git a/dev-python/qiskit-aer/qiskit-aer-0.11.2-r1.ebuild 
b/dev-python/qiskit-aer/qiskit-aer-0.11.2-r1.ebuild
index f9de54e64534..07d45fbdb52d 100644
--- a/dev-python/qiskit-aer/qiskit-aer-0.11.2-r1.ebuild
+++ b/dev-python/qiskit-aer/qiskit-aer-0.11.2-r1.ebuild
@@ -4,9 +4,9 @@
 EAPI=8
 
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{9..10} )
+PYTHON_COMPAT=( python3_{9..11} )
 
-inherit distutils-r1
+inherit distutils-r1 multiprocessing
 
 DESCRIPTION="High performance simulator for quantum circuits that includes 
noise models"
 HOMEPAGE="
@@ -35,7 +35,11 @@ DEPEND="
        virtual/cblas[eselect-ldso]
        sci-libs/openblas[eselect-ldso]
 "
-
+RDEPEND="
+       ${DEPEND}
+       >=dev-python/qiskit-terra-0.21.0[${PYTHON_USEDEP}]
+       >=dev-python/scipy-1.0[${PYTHON_USEDEP}]
+"
 BDEPEND="
        >=dev-util/cmake-3.17
        >=dev-python/scikit-build-0.11.0[${PYTHON_USEDEP}]
@@ -43,21 +47,19 @@ BDEPEND="
        test? (
                dev-python/ddt[${PYTHON_USEDEP}]
                dev-python/fixtures[${PYTHON_USEDEP}]
+               dev-python/pytest-xdist[${PYTHON_USEDEP}]
        )
 "
 
-RDEPEND="
-       ${DEPEND}
-       >=dev-python/qiskit-terra-0.21.0[${PYTHON_USEDEP}]
-       >=dev-python/scipy-1.0[${PYTHON_USEDEP}]
-"
+PATCHES=(
+       # Remove cmake dependency from setup.py because of
+       # invalid dependency description. We put this dependency check in 
BDEPEND.
+       "${FILESDIR}/qiskit-aer-0.10.3-remove-cmake-dependency.patch"
+       "${FILESDIR}/qiskit-aer-0.11.2-terra-test.patch"
+)
 
 distutils_enable_tests pytest
 
-# Remove cmake dependency from setup.py because of
-# invalid dependency description. We put this dependency check in BDEPEND.
-PATCHES=( "${FILESDIR}/qiskit-aer-0.10.3-remove-cmake-dependency.patch" )
-
 check_openblas() {
        local libdir=$(get_libdir) me="openblas"
 
@@ -75,7 +77,7 @@ check_openblas() {
 pkg_setup() {
        if use test; then
                check_openblas
-               if [ $? -ne 0 ]; then
+               if [[ $? -ne 0 ]]; then
                        die "Set blas implementation to openblas using 'eselect 
blas set openblas'!"
                fi
        fi
@@ -92,11 +94,15 @@ python_prepare_all() {
 python_test() {
        local EPYTEST_DESELECT=(
                # TODO
-               
test/terra/states/test_aer_statevector.py::TestAerStatevector::test_number_to_latex_terms
+               
test/terra/states/test_aer_statevector.py::TestAerStatevector::test_drawings
+
+               # TODO: GLIBCXX_ASSERTIONS, bug #897758
+               
test/terra/backends/aer_simulator/test_algorithms.py::TestAlgorithms::test_extended_stabilizer_sparse_output_probs
+               
test/terra/backends/aer_simulator/test_options.py::TestOptions::test_mps_options
        )
 
        rm -rf qiskit_aer || die
-       epytest -s
+       epytest -n "$(makeopts_jobs)" -s
 }
 
 pkg_postinst() {

Reply via email to