summaryrefslogtreecommitdiff
path: root/dev-python/mpi4py
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-06-13 10:39:22 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-06-13 10:39:22 +0100
commit9452a6e87b6c2c70513bc47a2470bf9f1168920e (patch)
tree8ac67e26b45f34d71c5aab3621813b100a0d5f00 /dev-python/mpi4py
parentf516638b7fe9592837389826a6152a7e1b251c54 (diff)
gentoo resync : 13.06.2020
Diffstat (limited to 'dev-python/mpi4py')
-rw-r--r--dev-python/mpi4py/Manifest4
-rw-r--r--dev-python/mpi4py/files/mpi4py-3.0.3-py38futures.patch131
-rw-r--r--dev-python/mpi4py/files/mpi4py-3.0.3-py38setup.patch25
-rw-r--r--dev-python/mpi4py/mpi4py-3.0.3.ebuild63
4 files changed, 223 insertions, 0 deletions
diff --git a/dev-python/mpi4py/Manifest b/dev-python/mpi4py/Manifest
index 2d9bf1248a14..fec9d11dd689 100644
--- a/dev-python/mpi4py/Manifest
+++ b/dev-python/mpi4py/Manifest
@@ -1,3 +1,7 @@
+AUX mpi4py-3.0.3-py38futures.patch 4779 BLAKE2B 0e034da4e2237f15f1f6c559f520dc7ffad5ccb344b0b87f444461132919f26b42b861fd86ed4b785b2de176b726c6ac14d5f69aeb4cdac0b6e182cceacb265b SHA512 1193779d8fc0a26845d9435a55b6fea808785f6d2299c3b0fe6ba16c7c8b846d35041ebabe7f51f67aacbd3d1e4a1d334a36ac2b457941b2467cc0ca8a4b30f3
+AUX mpi4py-3.0.3-py38setup.patch 783 BLAKE2B f92a508e2f8c0749135b79c92656662729434b12c4b1d90587bafc02870c934d2aea135b963660835818c0596d0c0635e02af78e2a2b855259d96d252bf1b19d SHA512 0b35ff4d6ebdb7fe0bb117114d68f9823094429bfdab37d8c8ae404d1357bedbe0c75e46ac4ffbbfdc5197adb24f934ecedbce8eb2b00757c00421e1dad912d9
DIST mpi4py-3.0.2.tar.gz 1429331 BLAKE2B 9e35749a82698ec656553583f01ebd8edbfb3b649c7693a9ff63f9f6abfa3fd41a54cbe4e3a1de55cbaf4dc626602706c776c505d0f5c0d82ebe88f2b4ceeddb SHA512 0a18332fd45e8e80b8dab0761fbaa30444a0d55776af7a2333be17ade827e92d04ac5bb8619ce26937142f344f75de0e5ef6dcb7502f33389716aa9482ddf5ab
+DIST mpi4py-3.0.3.tar.gz 1429389 BLAKE2B 1e8c44b857b417237832682d0b3b5c90d1f1046fd8137d2a63972419ff8ec0e1fd2ebba521e2d2d6ba9f773b7c607370b55d8d75c9afeaca172ac06dd838943c SHA512 041768f753c8188b2560fe92711861780f0d77eda3281433520c98bb1e9b4da6a89c364f2d1c4623868ffbbcfde34ef556198b1bef6fc1c4a9c19cd5e71b546c
EBUILD mpi4py-3.0.2.ebuild 1137 BLAKE2B f1f4357752c4db2b6e0dc6ff36e1d440c2e39c32f7f34c3dad8a2f156fba35f13b9765123ee23ddb9bcd3647e3488cd85f537421dde8ac69fae22c0f4449b67c SHA512 111a3074e7eaaf69c84a92f2a657ae17ceb2c6814a102a0b62615c9b44f16ea9b249f8a6fcecb8d19a2d50918b750f6e2bceea875f655684544e0eec242808b6
+EBUILD mpi4py-3.0.3.ebuild 1439 BLAKE2B 321ab070f8fe4b2b060071863cf3eb87c9ab0f780e1b8f92890ec2fa3fcad96e18045f33402e356db3de4c18ec7e57bb5db26b996898995275923452e2b4d1d2 SHA512 168c8f310c9ac68157d9b581293ecfc6647cf6ccb9fbd741da511945826b0436174cf25912679cd1a9350a3434de9771fd65ccec5b47ab7911dc8d1f0f2073d1
MISC metadata.xml 1118 BLAKE2B 0bc626a2106e628d7eb639e6ce90c4badb63ec2ea66b0322e7b83418791b7edc4bd443294fba3d31133812416eb4428b5dc47d074da3aeebf6867e8a0998d046 SHA512 7afb6d05007036bf5562d6d262165d8c2576bb49a86f9230f939d6a2ef929affa8461fa6421ffd8d97203a4425b397a8dd8556190364f29622e53a67674978c7
diff --git a/dev-python/mpi4py/files/mpi4py-3.0.3-py38futures.patch b/dev-python/mpi4py/files/mpi4py-3.0.3-py38futures.patch
new file mode 100644
index 000000000000..53b3aa36b2fb
--- /dev/null
+++ b/dev-python/mpi4py/files/mpi4py-3.0.3-py38futures.patch
@@ -0,0 +1,131 @@
+From 62a7b879051f2029fe46618f8bf9a019bdb96845 Mon Sep 17 00:00:00 2001
+From: Lisandro Dalcin <dalcinl@gmail.com>
+Date: Fri, 25 Oct 2019 12:22:41 +0300
+Subject: [PATCH] mpi4py.futures: Fixes to support Python 3.8
+
+---
+ demo/futures/test_futures.py | 7 +++++--
+ src/mpi4py/futures/__init__.py | 10 ++++++++++
+ src/mpi4py/futures/_base.py | 25 +++++++++++++++++++++++--
+ 3 files changed, 38 insertions(+), 4 deletions(-)
+
+diff --git a/demo/futures/test_futures.py b/demo/futures/test_futures.py
+index 925544d..7e03003 100644
+--- a/demo/futures/test_futures.py
++++ b/demo/futures/test_futures.py
+@@ -1157,7 +1157,9 @@ class ThenTest(unittest.TestCase):
+ def transform(a):
+ try:
+ f = chain.pop(0)
+- f.set_result(transform(a))
++ r = transform(a)
++ f.__init__()
++ f.set_result(r)
+ return f
+ except IndexError:
+ return 42
+@@ -1176,7 +1178,8 @@ class ThenTest(unittest.TestCase):
+ self.assert_(new_f.exception())
+ with self.assertRaises(RuntimeError) as catcher:
+ new_f.result()
+- assert 'Circular future chain detected' in catcher.exception.args[0]
++ self.assert_('Circular future chain detected'
++ in catcher.exception.args[0])
+
+
+ SKIP_POOL_TEST = False
+diff --git a/src/mpi4py/futures/__init__.py b/src/mpi4py/futures/__init__.py
+index d8c00bc..0518d7a 100644
+--- a/src/mpi4py/futures/__init__.py
++++ b/src/mpi4py/futures/__init__.py
+@@ -15,6 +15,14 @@ try:
+ wait,
+ as_completed,
+ )
++ try: # Python 3.7
++ from concurrent.futures import BrokenExecutor
++ except ImportError: # pragma: no cover
++ BrokenExecutor = RuntimeError
++ try: # Python 3.8
++ from concurrent.futures import InvalidStateError
++ except ImportError: # pragma: no cover
++ InvalidStateError = CancelledError.__base__
+ except ImportError: # pragma: no cover
+ from ._base import (
+ FIRST_COMPLETED,
+@@ -22,6 +30,8 @@ except ImportError: # pragma: no cover
+ ALL_COMPLETED,
+ CancelledError,
+ TimeoutError,
++ InvalidStateError,
++ BrokenExecutor,
+ Future,
+ Executor,
+ wait,
+diff --git a/src/mpi4py/futures/_base.py b/src/mpi4py/futures/_base.py
+index cfbd2c0..3eaa512 100644
+--- a/src/mpi4py/futures/_base.py
++++ b/src/mpi4py/futures/_base.py
+@@ -1,4 +1,4 @@
+-# Backport of concurrent.futures._base from Python 3.7
++# Backport of concurrent.futures._base from Python 3.8
+ # pylint: skip-file
+
+ # Copyright 2009 Brian Quinlan. All Rights Reserved.
+@@ -61,6 +61,10 @@ class TimeoutError(Error):
+ """The operation exceeded the given deadline."""
+ pass
+
++class InvalidStateError(Error):
++ """The operation is not allowed in this state."""
++ pass
++
+ class _Waiter(object):
+ """Provides the event that wait() and as_completed() block on."""
+ def __init__(self):
+@@ -414,7 +418,14 @@ class Future(object):
+ if self._state not in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]:
+ self._done_callbacks.append(fn)
+ return
+- fn(self)
++ try:
++ fn(self)
++ except Exception:
++ LOGGER.exception('exception calling callback for %r', self)
++ except BaseException:
++ raise
++ except: # old-style exception objects
++ LOGGER.exception('exception calling callback for %r', self)
+
+ def result(self, timeout=None):
+ """Return the result of the call that the future represents.
+@@ -527,6 +538,8 @@ class Future(object):
+ Should only be used by Executor implementations and unit tests.
+ """
+ with self._condition:
++ if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}:
++ raise InvalidStateError('{}: {!r}'.format(self._state, self))
+ self._result = result
+ self._state = FINISHED
+ for waiter in self._waiters:
+@@ -540,6 +553,8 @@ class Future(object):
+ Should only be used by Executor implementations and unit tests.
+ """
+ with self._condition:
++ if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}:
++ raise InvalidStateError('{}: {!r}'.format(self._state, self))
+ self._exception = exception
+ self._state = FINISHED
+ for waiter in self._waiters:
+@@ -625,3 +640,9 @@ class Executor(object):
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ self.shutdown(wait=True)
+ return False
++
++
++class BrokenExecutor(RuntimeError):
++ """
++ Raised when a executor has become non-functional after a severe failure.
++ """
+--
+2.10.5
diff --git a/dev-python/mpi4py/files/mpi4py-3.0.3-py38setup.patch b/dev-python/mpi4py/files/mpi4py-3.0.3-py38setup.patch
new file mode 100644
index 000000000000..877486b40604
--- /dev/null
+++ b/dev-python/mpi4py/files/mpi4py-3.0.3-py38setup.patch
@@ -0,0 +1,25 @@
+From 36e77661b7a879f0ec1eb165c3b5cd0259eb8496 Mon Sep 17 00:00:00 2001
+From: Lisandro Dalcin <dalcinl@gmail.com>
+Date: Sat, 28 Sep 2019 18:10:52 +0300
+Subject: [PATCH] setup: Minor fix for Python 3.8
+
+---
+ setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 235b115..9c03c49 100644
+--- a/setup.py
++++ b/setup.py
+@@ -336,7 +336,7 @@ def configure_pyexe(exe, config_cmd):
+ libraries = []
+ library_dirs = []
+ link_args = []
+- if not sysconfig.get_config_var('Py_ENABLE_SHARED'):
++ if pyver >= (3, 8) or not cfg_vars.get('Py_ENABLE_SHARED'):
+ py_version = sysconfig.get_python_version()
+ py_abiflags = getattr(sys, 'abiflags', '')
+ libraries = ['python' + py_version + py_abiflags]
+--
+2.10.5
+
diff --git a/dev-python/mpi4py/mpi4py-3.0.3.ebuild b/dev-python/mpi4py/mpi4py-3.0.3.ebuild
new file mode 100644
index 000000000000..123da6c26869
--- /dev/null
+++ b/dev-python/mpi4py/mpi4py-3.0.3.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7,8,9} )
+inherit distutils-r1
+
+DESCRIPTION="Message Passing Interface for Python"
+HOMEPAGE="https://bitbucket.org/mpi4py/ https://pypi.org/project/mpi4py/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples test"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ dev-python/cython[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ virtual/mpi
+"
+DEPEND="${RDEPEND}
+ test? (
+ dev-python/nose[${PYTHON_USEDEP}]
+ virtual/mpi[romio]
+ )
+"
+
+DISTUTILS_IN_SOURCE_BUILD=1
+
+PATCHES=(
+ "${FILESDIR}/${P}-py38setup.patch"
+ "${FILESDIR}/${P}-py38futures.patch"
+)
+
+python_prepare_all() {
+ # not needed on install
+ rm -vr docs/source || die
+ rm test/test_pickle.py || die # disabled by Gentoo-bug #659348
+ distutils-r1_python_prepare_all
+}
+
+src_compile() {
+ export FAKEROOTKEY=1
+ distutils-r1_src_compile
+}
+
+python_test() {
+ echo "Beginning test phase"
+ pushd "${BUILD_DIR}"/../ &> /dev/null || die
+ mpiexec --use-hwthread-cpus --mca btl tcp,self -n 1 "${PYTHON}" -B ./test/runtests.py -v --exclude="test_msgspec" ||
+ die "Testsuite failed under ${EPYTHON}"
+ popd &> /dev/null || die
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/. )
+ use examples && local DOCS=( demo )
+ distutils-r1_python_install_all
+}