diff options
Diffstat (limited to 'dev-python/mpi4py')
-rw-r--r-- | dev-python/mpi4py/Manifest | 2 | ||||
-rw-r--r-- | dev-python/mpi4py/files/mpi4py-3.0.3-py38futures.patch | 131 | ||||
-rw-r--r-- | dev-python/mpi4py/files/mpi4py-3.0.3-py38setup.patch | 25 | ||||
-rw-r--r-- | dev-python/mpi4py/files/mpi4py-3.1.5-test_memory.testReadOnly.patch | 33 | ||||
-rw-r--r-- | dev-python/mpi4py/metadata.xml | 15 | ||||
-rw-r--r-- | dev-python/mpi4py/mpi4py-3.0.3.ebuild | 63 | ||||
-rw-r--r-- | dev-python/mpi4py/mpi4py-3.1.5.ebuild | 70 |
7 files changed, 113 insertions, 226 deletions
diff --git a/dev-python/mpi4py/Manifest b/dev-python/mpi4py/Manifest index f01f20bfa0e3..19f3f4338db2 100644 --- a/dev-python/mpi4py/Manifest +++ b/dev-python/mpi4py/Manifest @@ -1 +1 @@ -DIST mpi4py-3.0.3.tar.gz 1429389 BLAKE2B 1e8c44b857b417237832682d0b3b5c90d1f1046fd8137d2a63972419ff8ec0e1fd2ebba521e2d2d6ba9f773b7c607370b55d8d75c9afeaca172ac06dd838943c SHA512 041768f753c8188b2560fe92711861780f0d77eda3281433520c98bb1e9b4da6a89c364f2d1c4623868ffbbcfde34ef556198b1bef6fc1c4a9c19cd5e71b546c +DIST mpi4py-3.1.5.tar.gz 2469777 BLAKE2B 0638e3def52f731b64e2999f83f2d6ccc94dc2f8b37d964c10e49ca12470d3d3ef77ff2737294d85614b2d59d1eec49880e74f2ba3d73fd090152b63c8cc701e SHA512 04da1d6daf66cc86fa3ec574eea6e01749f895035e3394afbc68d6245394c5b03557ede0bda3642b06d9c6ff2c1e6e878a6c8c30d3fa3491392e2e13b82cdec8 diff --git a/dev-python/mpi4py/files/mpi4py-3.0.3-py38futures.patch b/dev-python/mpi4py/files/mpi4py-3.0.3-py38futures.patch deleted file mode 100644 index 53b3aa36b2fb..000000000000 --- a/dev-python/mpi4py/files/mpi4py-3.0.3-py38futures.patch +++ /dev/null @@ -1,131 +0,0 @@ -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 deleted file mode 100644 index 877486b40604..000000000000 --- a/dev-python/mpi4py/files/mpi4py-3.0.3-py38setup.patch +++ /dev/null @@ -1,25 +0,0 @@ -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/files/mpi4py-3.1.5-test_memory.testReadOnly.patch b/dev-python/mpi4py/files/mpi4py-3.1.5-test_memory.testReadOnly.patch new file mode 100644 index 000000000000..986e565588a0 --- /dev/null +++ b/dev-python/mpi4py/files/mpi4py-3.1.5-test_memory.testReadOnly.patch @@ -0,0 +1,33 @@ +https://github.com/mpi4py/mpi4py/pull/452 +From: Paul Zander <negril.nx+gentoo@gmail.com> + +From 3adbd69b7219525f32636552394935a0a770896d Mon Sep 17 00:00:00 2001 +From: Lisandro Dalcin <dalcinl@gmail.com> +Date: Mon, 15 Jan 2024 10:45:38 +0300 +Subject: [PATCH] fix: Fix implementation of MPI.buffer.toreadonly() + +--- + src/mpi4py/MPI/asbuffer.pxi | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/src/mpi4py/MPI/asbuffer.pxi b/src/mpi4py/MPI/asbuffer.pxi +index 15e06a1..6536c1f 100644 +--- a/src/mpi4py/MPI/asbuffer.pxi ++++ b/src/mpi4py/MPI/asbuffer.pxi +@@ -257,14 +257,12 @@ cdef class memory: + + def toreadonly(self) -> memory: + """Return a readonly version of the memory object""" +- cdef void *buf = self.view.buf +- cdef Py_ssize_t size = self.view.len + cdef object obj = self + if self.view.obj != NULL: + obj = <object>self.view.obj + cdef memory mem = memory.__new__(memory) +- PyBuffer_FillInfo(&mem.view, obj, +- buf, size, 1, PyBUF_SIMPLE) ++ PyMPI_GetBuffer(obj, &mem.view, PyBUF_SIMPLE) ++ mem.view.readonly = 1 + return mem + + def release(self) -> None: diff --git a/dev-python/mpi4py/metadata.xml b/dev-python/mpi4py/metadata.xml index a7842f1c7b32..0dd4ceca2177 100644 --- a/dev-python/mpi4py/metadata.xml +++ b/dev-python/mpi4py/metadata.xml @@ -1,9 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> - <maintainer type="project"> - <email>python@gentoo.org</email> - <name>Python</name> + <maintainer type="person" proxied="yes"> + <email>alex.fan.q@gmail.com</email> + <name>Alex Fan</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> </maintainer> <longdescription lang="en">MPI for Python (mpi4py) provides bindings of the Message Passing Interface (MPI) standard for the Python programming language, @@ -17,8 +21,7 @@ arrays, builtin bytes/string/array objects). </longdescription> <upstream> - <remote-id type="google-code">mpi4py</remote-id> - <remote-id type="bitbucket">mpi4py</remote-id> + <remote-id type="github">mpi4py/mpi4py</remote-id> <remote-id type="pypi">mpi4py</remote-id> </upstream> </pkgmetadata> diff --git a/dev-python/mpi4py/mpi4py-3.0.3.ebuild b/dev-python/mpi4py/mpi4py-3.0.3.ebuild deleted file mode 100644 index 15fba5f284a5..000000000000 --- a/dev-python/mpi4py/mpi4py-3.0.3.ebuild +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{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 -} diff --git a/dev-python/mpi4py/mpi4py-3.1.5.ebuild b/dev-python/mpi4py/mpi4py-3.1.5.ebuild new file mode 100644 index 000000000000..91b39fef9ee1 --- /dev/null +++ b/dev-python/mpi4py/mpi4py-3.1.5.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +inherit distutils-r1 pypi + +DESCRIPTION="Message Passing Interface for Python" +HOMEPAGE="https://github.com/mpi4py/mpi4py https://pypi.org/project/mpi4py/" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="amd64 ~arm ~arm64 ~riscv 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? ( + virtual/mpi[romio] + ) +" + +PATCHES=( + "${FILESDIR}/${PN}-3.1.5-test_memory.testReadOnly.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 +} + +python_test() { + echo "Beginning test phase" + local -x PYTHONPATH="${BUILD_DIR}/install$(python_get_sitedir)" + + # python want's all arguments as separate strings + local mpi_opts=( + "-n" "1" + ) + # spawn is not stable in OpenMPI 4 + # https://github.com/jsquyres/ompi/pull/4#issuecomment-806897758 + # oob_tcp_if_include lo is needed to allow test in systemd-nspawn container + has_version sys-cluster/openmpi && mpi_opts+=( + "--use-hwthread-cpus" + "--mca" "btl" "tcp,self" + "--mca" "oob_tcp_if_include" "lo" + ) + mpiexec \ + "${mpi_opts[@]}" \ + "${PYTHON}" -B -v ./test/runtests.py -v \ + --exclude="test_msgspec" --exclude="test_spawn" || + die "Testsuite failed under ${EPYTHON}" +} + +python_install_all() { + use doc && local HTML_DOCS=( docs/. ) + use examples && local DOCS=( demo ) + distutils-r1_python_install_all +} |