Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: dev-python/numba/
Date: Sun, 07 Aug 2022 09:07:46
Message-Id: 1659861643.c737ad5e6f3b04c9997382826ccdc15dd1380b7b.andrewammerlaan@gentoo
1 commit: c737ad5e6f3b04c9997382826ccdc15dd1380b7b
2 Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
3 AuthorDate: Thu Aug 4 09:12:41 2022 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 7 08:40:43 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=c737ad5e
7
8 dev-python/numba: add 0.56.0
9
10 Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
11 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
12
13 dev-python/numba/numba-0.56.0.ebuild | 85 ++++++++++++++++++++++++++++++++++++
14 1 file changed, 85 insertions(+)
15
16 diff --git a/dev-python/numba/numba-0.56.0.ebuild b/dev-python/numba/numba-0.56.0.ebuild
17 new file mode 100644
18 index 000000000..15eae53a7
19 --- /dev/null
20 +++ b/dev-python/numba/numba-0.56.0.ebuild
21 @@ -0,0 +1,85 @@
22 +# Copyright 1999-2022 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=8
26 +
27 +PYTHON_COMPAT=( python3_{8..10} )
28 +
29 +DISTUTILS_USE_SETUPTOOLS=rdepend
30 +inherit optfeature multiprocessing distutils-r1
31 +
32 +DESCRIPTION="NumPy aware dynamic Python compiler using LLVM"
33 +HOMEPAGE="https://numba.pydata.org/
34 + https://github.com/numba"
35 +SRC_URI="https://github.com/numba/numba/archive/${PV}.tar.gz -> ${P}.tar.gz"
36 +
37 +LICENSE="BSD"
38 +SLOT="0"
39 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
40 +IUSE="openmp threads"
41 +
42 +RDEPEND="
43 + >=dev-python/llvmlite-0.39.0[${PYTHON_USEDEP}]
44 + <=dev-python/llvmlite-0.40.0
45 + >=dev-python/numpy-1.18.0[${PYTHON_USEDEP}]
46 + <dev-python/numpy-1.23[${PYTHON_USEDEP}]
47 + threads? ( >=dev-cpp/tbb-2021.1 )
48 +"
49 +BDEPEND="
50 + dev-python/pip[${PYTHON_USEDEP}]
51 + dev-python/versioneer[${PYTHON_USEDEP}]
52 +"
53 +
54 +DISTUTILS_IN_SOURCE_BUILD=1
55 +distutils_enable_tests unittest
56 +distutils_enable_sphinx docs/source dev-python/numpydoc dev-python/sphinx_rtd_theme
57 +
58 +PATCHES=(
59 + "${FILESDIR}/${PN}-0.52.0-skip_tests.patch"
60 +)
61 +
62 +pkg_setup() {
63 + if ! use openmp; then
64 + export NUMBA_DISABLE_OPENMP=1 || die
65 + else
66 + unset NUMBA_DISABLE_OPENMP || die
67 + fi
68 + if ! use threads; then
69 + export NUMBA_DISABLE_TBB=1 || die
70 + else
71 + unset NUMBA_DISABLE_TBB || die
72 + export TBBROOT="${EPREFIX}/usr" || die
73 + fi
74 +}
75 +
76 +python_prepare_all() {
77 + # This conf.py only works in a git repo
78 + if use doc; then
79 + git init -q || die
80 + git config user.email "larry@g.o" || die
81 + git config user.name "Larry the Cow" || die
82 + git add . || die
83 + git commit -m "init" || die
84 + fi
85 + distutils-r1_python_prepare_all
86 +}
87 +
88 +python_compile() {
89 + # FIXME: parallel python building fails. See Portage bug #614464 and
90 + # gentoo/sci issue #1080.
91 + export MAKEOPTS=-j1 || die
92 + distutils-r1_python_compile
93 +}
94 +
95 +# https://numba.pydata.org/numba-doc/latest/developer/contributing.html?highlight=test#running-tests
96 +python_test() {
97 + distutils_install_for_testing
98 + ${EPYTHON} setup.py build_ext --inplace || die \
99 + "${EPYTHON} failed to build_ext"
100 + ${EPYTHON} runtests.py -m $(makeopts_jobs) || die \
101 + "${EPYTHON} failed unittests"
102 +}
103 +
104 +pkg_postinst() {
105 + optfeature "compile cuda code" dev-util/nvidia-cuda-sdk
106 +}