diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-12-12 02:01:24 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-12-12 02:01:24 +0000 |
commit | 39c32f4d5dca9f6293fccb69e9d50baf494c8de4 (patch) | |
tree | ec772fdf23a7279a60e9063b01c2dc909741a197 /dev-python/pyqtgraph | |
parent | 494ca58c9f5243dd4b56557aa8c41bce76e95ec3 (diff) |
gentoo auto-resync : 12:12:2024 - 02:01:23
Diffstat (limited to 'dev-python/pyqtgraph')
-rw-r--r-- | dev-python/pyqtgraph/Manifest | 2 | ||||
-rw-r--r-- | dev-python/pyqtgraph/pyqtgraph-0.13.7-r1.ebuild | 97 | ||||
-rw-r--r-- | dev-python/pyqtgraph/pyqtgraph-0.13.7-r2.ebuild | 181 |
3 files changed, 182 insertions, 98 deletions
diff --git a/dev-python/pyqtgraph/Manifest b/dev-python/pyqtgraph/Manifest index a884274cc5c2..423402b3f2fa 100644 --- a/dev-python/pyqtgraph/Manifest +++ b/dev-python/pyqtgraph/Manifest @@ -1,3 +1,3 @@ DIST pyqtgraph-0.13.7.gh.tar.gz 2364456 BLAKE2B 3ce1a3eb177a2a6328f1b7354bf9d4a87ffedcf4fa75fa407bd2df708b91fe98e2500364220ac7395745c69ac86f4830ea58999d05af49850edc723a6ccad5a1 SHA512 91e06e143fec4b1a6fae5cc7112a1fb6b7e74c7a38605172aacc5639eb220e30c54694e419313c7bb8368ea5c5f45f41d58e4510735e63a7d6ef03cdbb0f05e9 -EBUILD pyqtgraph-0.13.7-r1.ebuild 2438 BLAKE2B b2932138e1a3f146376430363c73d7c42bc0e80f388acbbdb0c50aa419ce22a37e8c25b0c39a264eb45c58e6df575376b2ffcbaa70f25e4d54d524ce6e380a57 SHA512 78e373350654efe6431a7fba2cd72df44c8ab6722d5ed508b979692901b6f4e3c1f8c5ea349552b128e2fdf0f7d65573cbc3efc91b7d6153fc703085b62110e1 +EBUILD pyqtgraph-0.13.7-r2.ebuild 4654 BLAKE2B d00360cedf1b3b77300b64b449a7d4daa215639b057a0cc1629c7a0b5c4b8cd9e53cee215c28512d672b1d5361c037751782b7084e84842849095f8b1843eca3 SHA512 1d017e83ba18cb82a1fe93c65ec839d2ae0798b2c4567c18beb1fe647e667aa80734a22a84b90a93a345a29052e5e3fea85a15a0d96719814a6b985110948416 MISC metadata.xml 774 BLAKE2B b3e5e1017a2814db18f9b22de58f1b52feb0ec106259808e384bc45565f0a192bd73fe9cfb91d5e08aff0400e493ef0a70ae289de5d46185d99c42111bc80274 SHA512 c4eb8ac45b5c9b3450fba9aa7b84d3a48991c2d8e00b20d6f953a1ac6f54a818aa0c9d8c31a0cbf558bf453c02e3a21df7f472a81bb1d6188209c9e26de5526c diff --git a/dev-python/pyqtgraph/pyqtgraph-0.13.7-r1.ebuild b/dev-python/pyqtgraph/pyqtgraph-0.13.7-r1.ebuild deleted file mode 100644 index f8696b1a9cec..000000000000 --- a/dev-python/pyqtgraph/pyqtgraph-0.13.7-r1.ebuild +++ /dev/null @@ -1,97 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..13} ) - -inherit distutils-r1 - -DESCRIPTION="A pure-python graphics and GUI library built on PyQt and numpy" -HOMEPAGE=" - https://www.pyqtgraph.org/ - https://github.com/pyqtgraph/pyqtgraph/ - https://pypi.org/project/pyqtgraph/ -" -SRC_URI=" - https://github.com/pyqtgraph/pyqtgraph/archive/${P}.tar.gz - -> ${P}.gh.tar.gz -" -S=${WORKDIR}/${PN}-${P} - -LICENSE="MIT" -SLOT="0" -KEYWORDS="amd64 ~arm arm64 ~riscv ~x86" -IUSE="opengl svg" -REQUIRED_USE="test? ( opengl svg )" - -RDEPEND=" - >=dev-python/numpy-1.22[${PYTHON_USEDEP}] - dev-python/pyqt6[gui,widgets,opengl=,svg=,${PYTHON_USEDEP}] - dev-python/scipy[${PYTHON_USEDEP}] - opengl? ( dev-python/pyopengl[${PYTHON_USEDEP}] ) -" -BDEPEND=" - test? ( - dev-python/h5py[${PYTHON_USEDEP}] - dev-python/pyqt6[testlib,${PYTHON_USEDEP}] - dev-python/pytest-xvfb[${PYTHON_USEDEP}] - dev-vcs/git - ) -" - -EPYTEST_XDIST=1 -distutils_enable_tests pytest - -python_prepare_all() { - distutils-r1_python_prepare_all - - if ! use opengl; then - rm -r pyqtgraph/opengl || die - fi - - # pyqtgraph will automatically use any QT bindings it finds, - # Since we only want qt6, hardcode this where upstream allows an envvar to pick. - sed -i "s/QT_LIB = os.getenv('PYQTGRAPH_QT_LIB')/QT_LIB = 'PyQt6'/" pyqtgraph/Qt/__init__.py || - die "Failed to set QT_LIB" - - # We only want to run tests for qt6 so don't try other frontends if they're installed. - if use test; then - awk -i inplace ' - /frontends = {/ { - i = 6 # length of frontends - - print "frontends = {" - print " Qt.PYQT6: False," - print "}" - } - i > 0 { - i-- - next - } - { print } - ' pyqtgraph/examples/test_examples.py || die "Failed to patch test frontends" - fi -} - -python_test() { - local EPYTEST_DESELECT=( - # apparently fragile - tests/test_reload.py::test_reload - - # TODO - tests/exporters/test_svg.py::test_plotscene - tests/graphicsItems/test_ROI.py::test_PolyLineROI - - # pyside2 is normally skipped if not installed but these two - # fail if it is installed - # TODO: this could be due to USE flags, revisit when pyside2 - # gains py3.9 - 'pyqtgraph/examples/test_examples.py::testExamples[ DateAxisItem_QtDesigner.py - PySide2 ]' - 'pyqtgraph/examples/test_examples.py::testExamples[ designerExample.py - PySide2 ]' - ) - - local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 - epytest -p xvfb -} diff --git a/dev-python/pyqtgraph/pyqtgraph-0.13.7-r2.ebuild b/dev-python/pyqtgraph/pyqtgraph-0.13.7-r2.ebuild new file mode 100644 index 000000000000..a8489dd42e82 --- /dev/null +++ b/dev-python/pyqtgraph/pyqtgraph-0.13.7-r2.ebuild @@ -0,0 +1,181 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..13} ) + +inherit distutils-r1 + +DESCRIPTION="A pure-python graphics and GUI library built on PyQt and numpy" +HOMEPAGE=" + https://www.pyqtgraph.org/ + https://github.com/pyqtgraph/pyqtgraph/ + https://pypi.org/project/pyqtgraph/ +" +SRC_URI=" + https://github.com/pyqtgraph/pyqtgraph/archive/${P}.tar.gz + -> ${P}.gh.tar.gz +" +S=${WORKDIR}/${PN}-${P} + +LICENSE="MIT" +SLOT="0" +KEYWORDS="amd64 ~arm arm64 ~riscv ~x86" +IUSE="opengl svg qt5 +qt6" +REQUIRED_USE="test? ( opengl svg ) || ( qt5 qt6 )" + +RDEPEND=" + >=dev-python/numpy-1.22[${PYTHON_USEDEP}] + dev-python/scipy[${PYTHON_USEDEP}] + opengl? ( dev-python/pyopengl[${PYTHON_USEDEP}] ) + qt5? ( dev-python/pyqt5[gui,widgets,opengl=,svg=,${PYTHON_USEDEP}] ) + qt6? ( dev-python/pyqt6[gui,widgets,opengl=,svg=,${PYTHON_USEDEP}] ) +" +BDEPEND=" + test? ( + dev-python/h5py[${PYTHON_USEDEP}] + qt5? ( dev-python/pyqt5[testlib,${PYTHON_USEDEP}] ) + qt6? ( dev-python/pyqt6[testlib,${PYTHON_USEDEP}] ) + dev-python/pytest-xvfb[${PYTHON_USEDEP}] + dev-vcs/git + ) +" + +EPYTEST_XDIST=1 +distutils_enable_tests pytest + +python_prepare_all() { + distutils-r1_python_prepare_all + + if ! use opengl; then + rm -r pyqtgraph/opengl || die + fi + + # pyqtgraph will automatically use any QT bindings it finds, + # patch the supported Qt versions to only include the ones we have enabled + # This can be simplified to: + # `sed 's/QT_LIB = os.getenv('PYQTGRAPH_QT_LIB')/'QT_LIB = "PyQt6"/' -i pyqtgraph/Qt/__init__.py` + # when we only need to support pyqt6. + local upstream_supported_qt=( + PySide{,2,6} + PyQt{4,5,6} + ) + local gentoo_qt=() + local is_supported_impl use_qt qt + # pyqtgraph has conditionals that depend on these values; we can't just remove them. + # set deselected or unsupported to None to avoid more patching + for qt in "${upstream_supported_qt[@]}"; do + is_supported_impl=0 + case ${qt} in + PyQt5) is_supported_impl=1; use_qt=${qt:2} ;; + PyQt6) is_supported_impl=1; use_qt=${qt:2} ;; + esac + if [[ "${is_supported_impl}" -eq 0 ]]; then + gentoo_qt+=( "${qt^^} = None" ) + continue + fi + if use ${use_qt,,}; then + gentoo_qt+=( "${qt^^} = '${qt}'" ) + else + gentoo_qt+=( "${qt^^} = None" ) + fi + done + + awk -v qt_string="$(printf "%s\n" "${gentoo_qt[@]}")" -i inplace ' + BEGIN { + i = 0 + split(qt_string, qt_array, "\n") + j = 1 + } + /PYSIDE = '"'"'PySide'"'"'/ { + i = 6 # length of upstream_supported_qt + for (k = 1; k <= length(qt_array); k++) { + print qt_array[k] + j++ + } + } + i > 0 { + i-- + next + } + { print } + ' pyqtgraph/Qt/__init__.py || die "Failed to patch supported Qt versions" + + # We also need to remove them from load order. + local liborder=() + local qt + # The order is important (we want to prefer the newest at runtime) + for qt in qt6 qt5; do + if use ${qt}; then + if [[ "${qt}" == qt* ]]; then + liborder+=( "PY${qt^^}" ) + else + liborder+=( "${qt^^}" ) + fi + fi + done + + awk -v libOrder="$(printf "%s, " "${liborder[@]}")" -i inplace ' + BEGIN { + libOrder = "[" substr(libOrder, 1, length(libOrder) - 2) "]" + } + /libOrder = \[PYQT6, PYSIDE6, PYQT5, PYSIDE2\]/ { + sub(/\[PYQT6, PYSIDE6, PYQT5, PYSIDE2\]/, libOrder) + } + { print } + ' pyqtgraph/Qt/__init__.py || die "Failed to patch qt version order" + + # Finally update the list of supported frontends in test to never try unsupported or deselected + if use test; then + local frontends=() + for qt in qt5 qt6; do + if use ${qt}; then + frontends+=( "Qt.PY${qt^^}: False," ) + fi + done + awk -v frontends="$(printf "%s\n" "${frontends[@]}")" -i inplace ' + BEGIN { + i = 0 + split(frontends, frontend_array, "\n") + j = 1 + } + /frontends = {/ { + i = 6 # length of frontends + + print "frontends = {" + for (k = 1; k <= length(frontend_array); k++) { + print " " frontend_array[k] + } + print "}" + } + i > 0 { + i-- + next + } + { print } + ' pyqtgraph/examples/test_examples.py || die "Failed to patch test frontends" + fi +} + +python_test() { + local EPYTEST_DESELECT=( + # apparently fragile + tests/test_reload.py::test_reload + + # TODO + tests/exporters/test_svg.py::test_plotscene + tests/graphicsItems/test_ROI.py::test_PolyLineROI + + # pyside2 is normally skipped if not installed but these two + # fail if it is installed + # TODO: this could be due to USE flags, revisit when pyside2 + # gains py3.9 + 'pyqtgraph/examples/test_examples.py::testExamples[ DateAxisItem_QtDesigner.py - PySide2 ]' + 'pyqtgraph/examples/test_examples.py::testExamples[ designerExample.py - PySide2 ]' + ) + + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest -p xvfb +} |