public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/sci:master commit in: dev-python/numba/files/, dev-python/numba/
@ 2020-09-23 20:12 Aisha Tammy
  0 siblings, 0 replies; 2+ messages in thread
From: Aisha Tammy @ 2020-09-23 20:12 UTC (permalink / raw
  To: gentoo-commits

commit:     c8190400a2b0a70c5a35ebe90527ffb24667647a
Author:     Aisha Tammy <gentoo <AT> aisha <DOT> cc>
AuthorDate: Wed Sep 23 18:03:25 2020 +0000
Commit:     Aisha Tammy <gentoo <AT> aisha <DOT> cc>
CommitDate: Wed Sep 23 20:12:23 2020 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=c8190400

dev-python/numba: JIT python compiler

very useful, along with llvmlite, for HPC

Package-Manager: Portage-3.0.7, Repoman-3.0.1
Signed-off-by: Aisha Tammy <gentoo <AT> aisha.cc>

 .../numba/files/numba-0.51.2-skip_tests.patch      | 46 ++++++++++++++
 dev-python/numba/metadata.xml                      | 12 ++++
 dev-python/numba/numba-0.51.2.ebuild               | 71 ++++++++++++++++++++++
 3 files changed, 129 insertions(+)

diff --git a/dev-python/numba/files/numba-0.51.2-skip_tests.patch b/dev-python/numba/files/numba-0.51.2-skip_tests.patch
new file mode 100644
index 000000000..327271a04
--- /dev/null
+++ b/dev-python/numba/files/numba-0.51.2-skip_tests.patch
@@ -0,0 +1,46 @@
+diff --git a/numba/tests/test_jitclasses.py b/numba/tests/test_jitclasses.py
+index 87f1165..c1c5f35 100644
+--- a/numba/tests/test_jitclasses.py
++++ b/numba/tests/test_jitclasses.py
+@@ -909,6 +909,7 @@ class TestJitClass(TestCase, MemoryLeakMixin):
+         self.assertEqual(t[2:2:1], 2)
+         self.assertEqual(t[6:6:1], 3)
+ 
++    @unittest.skip("Gentoo has not reverted the LLVM 'truncate longlabel' patch")
+     def test_jitclass_longlabel_not_truncated(self):
+         # See issue #3872, llvm 7 introduced a max label length of 1024 chars
+         # Numba ships patched llvm 7.1 (ppc64le) and patched llvm 8 to undo this
+diff --git a/numba/tests/test_np_functions.py b/numba/tests/test_np_functions.py
+index 01c15fd..3d9e228 100644
+--- a/numba/tests/test_np_functions.py
++++ b/numba/tests/test_np_functions.py
+@@ -2028,6 +2028,7 @@ class TestNPFunctions(MemoryLeakMixin, TestCase):
+                     params = {'ary': ary, 'to_begin': a, 'to_end': b}
+                     _check(params)
+ 
++    @unittest.skip("unhandled type error")
+     def test_ediff1d_edge_cases(self):
+         # NOTE: NumPy 1.16 has a variety of behaviours for type conversion, see
+         # https://github.com/numpy/numpy/issues/13103, as this is not resolved
+diff --git a/numba/tests/test_record_dtype.py b/numba/tests/test_record_dtype.py
+index 6d479c4..2357206 100644
+--- a/numba/tests/test_record_dtype.py
++++ b/numba/tests/test_record_dtype.py
+@@ -796,7 +796,7 @@ class TestRecordDtype(unittest.TestCase):
+         # len(transformed) is generally 10, but could be longer if a large
+         # number of typecodes are in use. Checking <20 should provide enough
+         # tolerance.
+-        self.assertLess(len(transformed), 20)
++        self.assertLessEqual(len(transformed), 20)
+ 
+         struct_arr = types.Array(rec, 1, 'C')
+         transformed = mangle_type(struct_arr)
+@@ -804,7 +804,7 @@ class TestRecordDtype(unittest.TestCase):
+         self.assertNotIn('first', transformed)
+         self.assertNotIn('second', transformed)
+         # Length is usually 50 - 5 chars tolerance as above.
+-        self.assertLess(len(transformed), 50)
++        self.assertLessEqual(len(transformed), 50)
+ 
+     def test_record_two_arrays(self):
+         """

diff --git a/dev-python/numba/metadata.xml b/dev-python/numba/metadata.xml
new file mode 100644
index 000000000..e97c4322a
--- /dev/null
+++ b/dev-python/numba/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>gentoo@aisha.cc</email>
+		<name>Aisha Tammy</name>
+	</maintainer>
+	<maintainer type="project">
+		<email>sci@gentoo.org</email>
+		<name>Gentoo Science Project</name>
+	</maintainer>
+</pkgmetadata>

diff --git a/dev-python/numba/numba-0.51.2.ebuild b/dev-python/numba/numba-0.51.2.ebuild
new file mode 100644
index 000000000..597d6ac54
--- /dev/null
+++ b/dev-python/numba/numba-0.51.2.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} )
+
+DISTUTILS_USE_SETUPTOOLS=rdepend
+inherit eutils multiprocessing distutils-r1
+
+DESCRIPTION="NumPy aware dynamic Python compiler using LLVM"
+HOMEPAGE="https://numba.pydata.org/
+	https://github.com/numba"
+SRC_URI="https://github.com/numba/numba/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="openmp threads"
+
+DEPEND="
+	>=dev-python/llvmlite-0.34.0[${PYTHON_USEDEP}]
+	<dev-python/llvmlite-0.35.0
+	dev-python/numpy[${PYTHON_USEDEP}]
+	dev-python/pip[${PYTHON_USEDEP}]
+	dev-python/scipy[${PYTHON_USEDEP}]
+	threads? ( dev-cpp/tbb )
+"
+RDEPEND="${DEPEND}
+	${PYTHON_DEPS}
+"
+
+DISTUTILS_IN_SOURCE_BUILD=1
+distutils_enable_tests unittest
+
+# doc system is another huge mess, skip it
+PATCHES=(
+	"${FILESDIR}/${P}-skip_tests.patch"
+)
+
+pkg_setup() {
+	if ! usex openmp; then
+		export NUMBA_DISABLE_OPENMP=1
+	else
+		unset NUMBA_DISABLE_OPENMP
+	fi
+	if ! usex threads; then
+		export NUMBA_DISABLE_TBB=1
+	else
+		unset NUMBA_DISABLE_TBB
+		export TBBROOT="${EPREFIX}/usr"
+	fi
+}
+
+# https://numba.pydata.org/numba-doc/latest/developer/contributing.html?highlight=test#running-tests
+python_test() {
+	distutils_install_for_testing
+	${EPYTHON} setup.py build_ext --inplace || die \
+		"${EPYTHON} failed to build_ext"
+	${EPYTHON} runtests.py -m $(makeopts_jobs) || die \
+		"${EPYTHON} failed unittests"
+}
+
+# https://numba.pydata.org/numba-doc/latest/user/installing.html
+python_install_all() {
+	distutils-r1_python_install_all
+}
+
+pkg_postinst() {
+	optfeature "compile cuda code" dev-util/nvidia-cuda-sdk
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/sci:master commit in: dev-python/numba/files/, dev-python/numba/
@ 2022-12-12 15:16 Andrew Ammerlaan
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Ammerlaan @ 2022-12-12 15:16 UTC (permalink / raw
  To: gentoo-commits

commit:     098795ca6cf10eaa90d174f77439b77076db14ff
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 12 12:10:58 2022 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Mon Dec 12 12:10:58 2022 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=098795ca

dev-python/numba: add 0.56.4

Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 .../numba/files/numba-0.56.4-allow-py3.11.patch    | 13 ++++
 dev-python/numba/metadata.xml                      |  1 +
 dev-python/numba/numba-0.56.4.ebuild               | 85 ++++++++++++++++++++++
 3 files changed, 99 insertions(+)

diff --git a/dev-python/numba/files/numba-0.56.4-allow-py3.11.patch b/dev-python/numba/files/numba-0.56.4-allow-py3.11.patch
new file mode 100644
index 000000000..07c1b5d88
--- /dev/null
+++ b/dev-python/numba/files/numba-0.56.4-allow-py3.11.patch
@@ -0,0 +1,13 @@
+diff --git a/setup.py b/setup.py
+index 68feca4..1d254ec 100644
+--- a/setup.py
++++ b/setup.py
+@@ -20,7 +20,7 @@ except ImportError:
+ 
+ 
+ min_python_version = "3.7"
+-max_python_version = "3.11"  # exclusive
++max_python_version = "3.12"  # exclusive
+ min_numpy_build_version = "1.11"
+ min_numpy_run_version = "1.18"
+ max_numpy_run_version = "1.24"

diff --git a/dev-python/numba/metadata.xml b/dev-python/numba/metadata.xml
index 43b02aeec..63bc398e0 100644
--- a/dev-python/numba/metadata.xml
+++ b/dev-python/numba/metadata.xml
@@ -11,5 +11,6 @@
 	</maintainer>
 	<upstream>
 		<remote-id type="github">numba/numba</remote-id>
+		<remote-id type="pypi">numba</remote-id>
 	</upstream>
 </pkgmetadata>

diff --git a/dev-python/numba/numba-0.56.4.ebuild b/dev-python/numba/numba-0.56.4.ebuild
new file mode 100644
index 000000000..53b99b45f
--- /dev/null
+++ b/dev-python/numba/numba-0.56.4.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# py3.11 fails to compile:
+# error: ‘CFrame’ does not name a type; did you mean ‘_frame’?
+PYTHON_COMPAT=( python3_{8..10} )
+DISTUTILS_USE_PEP517=setuptools
+inherit optfeature multiprocessing distutils-r1
+
+DESCRIPTION="NumPy aware dynamic Python compiler using LLVM"
+HOMEPAGE="https://numba.pydata.org/
+	https://github.com/numba"
+SRC_URI="https://github.com/numba/numba/archive/${PV}.tar.gz -> ${P}.gh.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="openmp threads"
+
+RDEPEND="
+	>=dev-python/llvmlite-0.39.0[${PYTHON_USEDEP}]
+	<=dev-python/llvmlite-0.40.0
+	>=dev-python/numpy-1.18.0[${PYTHON_USEDEP}]
+	<dev-python/numpy-1.24[${PYTHON_USEDEP}]
+	threads? ( >=dev-cpp/tbb-2021.1 <dev-cpp/tbb-2021.6 )
+"
+BDEPEND="
+	dev-python/pip[${PYTHON_USEDEP}]
+	dev-python/versioneer[${PYTHON_USEDEP}]
+"
+
+distutils_enable_tests unittest
+distutils_enable_sphinx docs/source dev-python/numpydoc dev-python/sphinx_rtd_theme
+
+PATCHES=(
+	"${FILESDIR}/${PN}-0.52.0-skip_tests.patch"
+	"${FILESDIR}/${PN}-0.56.4-allow-py3.11.patch"
+)
+
+pkg_setup() {
+	if ! use openmp; then
+		export NUMBA_DISABLE_OPENMP=1 || die
+	else
+		unset NUMBA_DISABLE_OPENMP || die
+	fi
+	if ! use threads; then
+		export NUMBA_DISABLE_TBB=1 || die
+	else
+		unset NUMBA_DISABLE_TBB || die
+		export TBBROOT="${EPREFIX}/usr" || die
+	fi
+}
+
+python_prepare_all() {
+	# This conf.py only works in a git repo
+	if use doc; then
+		git init -q || die
+		git config user.email "larry@gentoo.org" || die
+		git config user.name "Larry the Cow" || die
+		git add . || die
+		git commit -m "init" || die
+	fi
+	distutils-r1_python_prepare_all
+}
+
+python_compile() {
+	# FIXME: parallel python building fails. See Portage bug #614464 and
+	# gentoo/sci issue #1080.
+	export MAKEOPTS=-j1 || die
+	distutils-r1_python_compile
+}
+
+# https://numba.pydata.org/numba-doc/latest/developer/contributing.html?highlight=test#running-tests
+python_test() {
+	${EPYTHON} setup.py build_ext --inplace || die \
+		"${EPYTHON} failed to build_ext"
+	${EPYTHON} runtests.py -m $(makeopts_jobs) || die \
+		"${EPYTHON} failed unittests"
+}
+
+pkg_postinst() {
+	optfeature "compile cuda code" dev-util/nvidia-cuda-sdk
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-12 15:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-23 20:12 [gentoo-commits] proj/sci:master commit in: dev-python/numba/files/, dev-python/numba/ Aisha Tammy
  -- strict thread matches above, loose matches on Subject: below --
2022-12-12 15:16 Andrew Ammerlaan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox