From a33c20e42a8650be7d9b2b6e3767460224c14a59 Mon Sep 17 00:00:00 2001 From: bill-auger Date: Feb 19 2023 07:15:56 +0000 Subject: [spyder]: WIP - de-webengine a blacklist repalcement --- diff --git a/libre-testing/spyder/PKGBUILD b/libre-testing/spyder/PKGBUILD new file mode 100644 index 0000000..c48694a --- /dev/null +++ b/libre-testing/spyder/PKGBUILD @@ -0,0 +1,180 @@ +# Maintainer (arch): Muflone http://www.muflone.com/contacts/english/ +# Maintainer (arch): Bruno Pagani +# Contributor: Francois Boulogne +# Contributor: TDY +# Maintainer: Parabola Hackers + + +# parabola changes and rationale +# - removed 'python-pyqt5-webengine' dependency + + +pkgname=spyder +pkgver=5.4.1 +pkgrel=1 +pkgrel+=.parabola1 +pkgdesc="The Scientific Python Development Environment" +arch=(any) +url="https://www.spyder-ide.org/" +license=(MIT) +makedepends=(python-sphinx python-setuptools-scm python-wheel) +depends=( + python-atomicwrites + python-chardet + python-cloudpickle + python-cookiecutter + python-diff-match-patch + python-intervaltree + ipython + python-jedi + python-jellyfish + python-jsonschema + python-keyring + jupyter-nbconvert + python-numpydoc + python-parso + python-pexpect + python-pickleshare + python-psutil + python-pygments + python-pylint + python-pylint-venv + python-pyqt5 + python-pyqt5-webengine + python-lsp-server + python-lsp-black + python-pyls-spyder + python-pyxdg + python-pyzmq + python-qdarkstyle + python-qstylizer + python-qtawesome + python-qtconsole + python-qtpy + python-rtree + python-setuptools + python-sphinx + python-spyder-kernels + python-textdistance + python-three-merge + python-watchdog + autopep8 + flake8 + python-pycodestyle + python-pydocstyle + python-pyflakes + python-rope + yapf + python-whatthepatch +) +depends=( ${depends[*]/python-pyqt5-webengine/} ) +# Starting from autopep8, required optdeps of python-language-server +optdepends=( + 'cython: run Cython files in the IPython Console' + 'python-matplotlib: 2D/3D plotting in the IPython Console' + 'python-numpy: support for N-dimensional arrays in the Variable Explorer' + 'python-pandas: support for DataFrames and Series in the Variable Explorer' + 'python-scipy: support for Matlab workspace in the Variable Explorer' + 'python-sympy: symbolic mathematics in the IPython Console' +) +checkdepends=( + python-pytest + python-pytest-qt + python-pytest-mock + python-pytest-cov + python-pytest-order + python-pytest-lazy-fixture + python-pytest-timeout + python-flaky + python-pandas + python-scipy + python-sympy + python-pillow + python-matplotlib + cython + git + tk + xorg-server-xvfb +) +source=(https://github.com/spyder-ide/${pkgname}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz) +source+=(no-webengine.patch) +sha512sums=('f8dc629552957d4ddcbe849388a6b5b53acd17248ea247fd3c27e0a6b93c411102b12f427f9f41824709bceda8687f09efa0310ae4ce798ae9ebc389bbb8253c') +sha512sums+=('acdb96f70df8362159d4997e01eff945bb902fe0391c45dcdbe1425ef1ace4c03405b01a317051a4d9acb0d942c946f958edcf720cd326743bd39ccd526fb69b') + +prepare() { + cd ${pkgname}-${pkgver} + # Allow our python libraries versions + sed 's|IPYTHON_REQVER = ">=7.31.1;<9.0.0"|IPYTHON_REQVER = ">=7.31.1"|' -i spyder/dependencies.py + sed "s|JEDI_REQVER = '>=0.17.2;<0.19.0'|JEDI_REQVER = '>=0.17.2'|" -i spyder/dependencies.py + sed "s|PARSO_REQVER = '>=0.7.0;<0.9.0'|PARSO_REQVER = '>=0.7.0'|" -i spyder/dependencies.py + sed "s|PYLSP_REQVER = '>=1.7.0;<1.8.0'|PYLSP_REQVER = '>=1.7.0'|" -i spyder/dependencies.py + sed "s|QDARKSTYLE_REQVER = '>=3.0.2;<3.1.0'|QDARKSTYLE_REQVER = '>=3.0.2'|" -i spyder/dependencies.py + sed "s|QTCONSOLE_REQVER = '>=5.4.0;<5.5.0'|QTCONSOLE_REQVER = '>=5.4.0'|" -i spyder/dependencies.py + sed "s|ipython>=7.31.1,<9.0.0|ipython>=7.31.1|" -i setup.py + sed "s|jedi>=0.17.2,<0.19.0|jedi>=0.17.2|" -i setup.py + sed "s|parso>=0.7.0,<0.9.0|parso>=0.7.0|" -i setup.py + sed "s|python-lsp-server\[all\]>=1.7.0,<1.8.0|python-lsp-server\[all\]>=1.7.0|" -i setup.py + sed "s|qdarkstyle>=3.0.2,<3.1.0|qdarkstyle>=3.0.2|" -i setup.py + sed "s|qtconsole>=5.4.0,<5.5.0|qtconsole>=5.4.0|" -i setup.py + # Required change for ipython + sed "s|extra_extension|extra_extensions|" -i spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py + + ## parabola changes ## + + # delete CI litter + rm -rf .github/ + + # remove 'python-pyqt5-webengine' dependency + patch -Np1 < "${srcdir}"/no-webengine.patch + rm -v spyder/plugins/help/plugin.py + rm -v spyder/plugins/help/tests/test_plugin.py +} + +build() { + cd ${pkgname}-${pkgver} + python setup.py build +} + +check() { + cd ${pkgname}-${pkgver} + # Required per above patching + sed "s|ipython >=7.31.1,<9.0.0|ipython >=7.31.1|" -i binder/environment.yml + sed "s|jedi >=0.17.2,<0.19.0|jedi >=0.17.2|" -i binder/environment.yml + sed "s|parso >=0.7.0,<0.9.0|parso >=0.7.0|" -i binder/environment.yml + sed "s|python-lsp-server >=1.7.0,<1.8.0|python-lsp-server >=1.7.0|" -i binder/environment.yml + sed "s|qdarkstyle >=3.0.2,<3.1.0|qdarkstyle >=3.0.2|" -i binder/environment.yml + sed "s|qtconsole >=5.4.0,<5.5.0|qtconsole >=5.4.0|" -i binder/environment.yml + sed "s|ipython >=7.31.1,<9.0.0|ipython >=7.31.1|" -i requirements/main.yml + sed "s|jedi >=0.17.2,<0.19.0|jedi >=0.17.2|" -i requirements/main.yml + sed "s|parso >=0.7.0,<0.9.0|parso >=0.7.0|" -i requirements/main.yml + sed "s|python-lsp-server >=1.7.0,<1.8.0|python-lsp-server >=1.7.0|" -i requirements/main.yml + sed "s|qdarkstyle >=3.0.2,<3.1.0|qdarkstyle >=3.0.2|" -i requirements/main.yml + sed "s|qtconsole >=5.4.0,<5.5.0|qtconsole >=5.4.0|" -i requirements/main.yml + local disabled_tests='' + # Not working in headless env + disabled_tests+='not test_config_dialog' + disabled_tests+=' and not test_tab_copies_find_to_replace' + disabled_tests+=' and not test_toggle_off_show_all_files' + disabled_tests+=' and not test_select_all_shortcut' + disabled_tests+=' and not test_delete_line_shortcut' + disabled_tests+=' and not test_go_to_line_shortcut' + disabled_tests+=' and not test_transform_to_lowercase_shortcut' + disabled_tests+=' and not test_transform_to_uppercase_shortcut' + disabled_tests+=' and not test_ctrl_c_dbg' + disabled_tests+=' and not test_connection_dialog_remembers_input_with_ssh_passphrase' + disabled_tests+=' and not test_connection_dialog_remembers_input_with_password' + disabled_tests+=' and not test_store_user_credentials' + # Currently some tests failures in completion plugins, but no time to investigate + xvfb-run --auto-servernum python runtests.py --color=yes -k "${disabled_tests}" || echo "Tests failed" +} + +package() { + cd ${pkgname}-${pkgver} + python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build + # Install license file + install -Dm644 LICENSE.txt -t ${pkgdir}/usr/share/licenses/${pkgname}/ + # Install icon file + install -Dm644 spyder/images/spyder.svg -t "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/ + # Remove useless spyder_win_post_install script + rm -f "${pkgdir}"/usr/bin/spyder_win_post_install.py +} diff --git a/libre-testing/spyder/no-webengine.patch b/libre-testing/spyder/no-webengine.patch new file mode 100644 index 0000000..2247df3 --- /dev/null +++ b/libre-testing/spyder/no-webengine.patch @@ -0,0 +1,169 @@ +diff --git a/requirements/main.yml b/requirements/main.yml +index 6d0487a..2bf2355 100644 +--- a/requirements/main.yml ++++ b/requirements/main.yml +@@ -27,7 +27,6 @@ dependencies: + - pylint-venv >=2.1.1 + - pyls-spyder >=0.4.0 + - pyqt <5.16 +- - pyqtwebengine <5.16 + - python-lsp-black >=1.2.0 + - python-lsp-server >=1.7.0,<1.8.0 + - pyzmq >=22.1.0 +diff --git a/runtests.py b/runtests.py +index 8e94c09..38a5165 100644 +--- a/runtests.py ++++ b/runtests.py +@@ -20,7 +20,6 @@ os.environ['SPYDER_PYTEST'] = 'True' + # NOTE: This needs to be imported before any QApplication. + # Don't remove it or change it to a different location! + # pylint: disable=wrong-import-position +-from qtpy import QtWebEngineWidgets # noqa + import pytest + + +diff --git a/setup.py b/setup.py +index b064721..25e1391 100644 +--- a/setup.py ++++ b/setup.py +@@ -228,7 +228,7 @@ install_requires = [ + 'python-lsp-black>=1.2.0', + 'pyls-spyder>=0.4.0', + 'pyqt5<5.16', +- 'pyqtwebengine<5.16', ++ + 'python-lsp-server[all]>=1.7.0', + 'pyxdg>=0.26;platform_system=="Linux"', + 'pyzmq>=22.1.0', +diff --git a/spyder/app/cli_options.py b/spyder/app/cli_options.py +index 3ae36f0..325d99e 100644 +--- a/spyder/app/cli_options.py ++++ b/spyder/app/cli_options.py +@@ -139,7 +139,7 @@ def get_options(argv=None): + '--no-web-widgets', + dest="no_web_widgets", + action='store_true', +- default=False, ++ default=True, + help="Disable the usage of web widgets in Spyder (e.g. the Help and " + "Online help panes)." + ) +diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py +index 0e0ab3e..cb8fb5c 100644 +--- a/spyder/app/mainwindow.py ++++ b/spyder/app/mainwindow.py +@@ -52,9 +52,6 @@ from qtpy.QtWidgets import (QApplication, QMainWindow, QMenu, QMessageBox, + # Avoid a "Cannot mix incompatible Qt library" error on Windows platforms + from qtpy import QtSvg # analysis:ignore + +-# Avoid a bug in Qt: https://bugreports.qt.io/browse/QTBUG-46720 +-from qtpy import QtWebEngineWidgets # analysis:ignore +- + from qtawesome.iconic_font import FontError + + #============================================================================== +diff --git a/spyder/app/tests/conftest.py b/spyder/app/tests/conftest.py +index eed1a5f..f8e5848 100755 +--- a/spyder/app/tests/conftest.py ++++ b/spyder/app/tests/conftest.py +@@ -18,7 +18,6 @@ from qtpy.QtCore import Qt + from qtpy.QtTest import QTest + from qtpy.QtWidgets import QApplication, QFileDialog, QLineEdit, QTabBar + # This is required to run our tests in VSCode or Spyder-unittest +-from qtpy import QtWebEngineWidgets # noqa + import psutil + import pytest + +diff --git a/spyder/app/tests/test_mainwindow.py b/spyder/app/tests/test_mainwindow.py +index 94c5577..75790e9 100644 +--- a/spyder/app/tests/test_mainwindow.py ++++ b/spyder/app/tests/test_mainwindow.py +@@ -38,7 +38,7 @@ from qtpy import PYQT_VERSION, PYQT5 + from qtpy.QtCore import Qt, QTimer + from qtpy.QtGui import QImage, QTextCursor + from qtpy.QtWidgets import QAction, QApplication, QInputDialog, QWidget +-from qtpy.QtWebEngineWidgets import WEBENGINE ++WEBENGINE = False + + # Local imports + from spyder import __trouble_url__ +diff --git a/spyder/plugins/help/tests/test_plugin.py b/spyder/plugins/help/tests/test_plugin.py +index dfdc35b..6f30a84 100644 +--- a/spyder/plugins/help/tests/test_plugin.py ++++ b/spyder/plugins/help/tests/test_plugin.py +@@ -16,7 +16,7 @@ from unittest.mock import Mock, MagicMock + # Third party imports + from qtpy import PYQT_VERSION + from qtpy.QtWidgets import QMainWindow +-from qtpy.QtWebEngineWidgets import WEBENGINE ++WEBENGINE = False + import pytest + from flaky import flaky + +diff --git a/spyder/plugins/help/widgets.py b/spyder/plugins/help/widgets.py +index d5f5151..3400794 100644 +--- a/spyder/plugins/help/widgets.py ++++ b/spyder/plugins/help/widgets.py +@@ -17,7 +17,7 @@ import sys + from qtpy import PYQT5 + from qtpy.QtCore import Qt, QUrl, Signal, Slot, QPoint + from qtpy.QtGui import QColor +-from qtpy.QtWebEngineWidgets import WEBENGINE, QWebEnginePage ++ + from qtpy.QtWidgets import (QActionGroup, QComboBox, QLabel, QLineEdit, + QMessageBox, QSizePolicy, QStackedLayout, + QVBoxLayout, QWidget) +diff --git a/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py b/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py +index 73e50a4..8e304c5 100644 +--- a/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py ++++ b/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py +@@ -34,7 +34,7 @@ from pygments.token import Name + import pytest + from qtpy import PYQT5 + from qtpy.QtCore import Qt +-from qtpy.QtWebEngineWidgets import WEBENGINE ++WEBENGINE = False + from qtpy.QtWidgets import QMessageBox, QMainWindow + from spyder_kernels import __version__ as spyder_kernels_version + import sympy +diff --git a/spyder/plugins/ipythonconsole/widgets/main_widget.py b/spyder/plugins/ipythonconsole/widgets/main_widget.py +index a12c77a..2130017 100644 +--- a/spyder/plugins/ipythonconsole/widgets/main_widget.py ++++ b/spyder/plugins/ipythonconsole/widgets/main_widget.py +@@ -23,7 +23,7 @@ import qstylizer.style + from qtconsole.client import QtKernelClient + from qtpy.QtCore import Signal, Slot + from qtpy.QtGui import QColor +-from qtpy.QtWebEngineWidgets import WEBENGINE ++WEBENGINE = False + from qtpy.QtWidgets import ( + QApplication, QHBoxLayout, QLabel, QMessageBox, QVBoxLayout, QWidget) + from traitlets.config.loader import Config, load_pyconfig_files +diff --git a/spyder/plugins/onlinehelp/widgets.py b/spyder/plugins/onlinehelp/widgets.py +index d97a9bb..e2896ad 100644 +--- a/spyder/plugins/onlinehelp/widgets.py ++++ b/spyder/plugins/onlinehelp/widgets.py +@@ -16,7 +16,7 @@ import sys + # Third party imports + from qtpy.QtCore import Qt, QThread, QUrl, Signal, Slot + from qtpy.QtGui import QCursor +-from qtpy.QtWebEngineWidgets import WEBENGINE ++WEBENGINE = False + from qtpy.QtWidgets import QApplication, QLabel, QVBoxLayout + + # Local imports +diff --git a/spyder/widgets/browser.py b/spyder/widgets/browser.py +index fd85fcc..33b5d83 100644 +--- a/spyder/widgets/browser.py ++++ b/spyder/widgets/browser.py +@@ -16,8 +16,8 @@ import qstylizer.style + from qtpy import PYQT5 + from qtpy.QtCore import QEvent, Qt, QUrl, Signal, Slot + from qtpy.QtGui import QFontInfo +-from qtpy.QtWebEngineWidgets import (WEBENGINE, QWebEnginePage, +- QWebEngineSettings, QWebEngineView) ++ ++ + from qtpy.QtWidgets import QFrame, QHBoxLayout, QLabel, QProgressBar, QWidget + + # Local imports