diff --git a/.github/scripts/install.sh b/.github/scripts/install.sh index a78c72930fd..a1c73bb79f8 100755 --- a/.github/scripts/install.sh +++ b/.github/scripts/install.sh @@ -34,13 +34,9 @@ if [ "$USE_CONDA" = "true" ]; then fi done - # Install jupyter_client 7.2.0 to prevent ZMQ Socket operation on non-socket - # Remove this when the issue is fixed upstream most probaly with jupyter_client=7.2.3 - # See https://github.com/spyder-ide/spyder/issues/17615 - mamba install jupyter_client=7.2.0 -c conda-forge -q -y else # Update pip and setuptools - pip install -U pip setuptools + python -m pip install -U pip setuptools # Install Spyder and its dependencies from our setup.py pip install -e .[test] @@ -61,11 +57,6 @@ else pip uninstall $dep -q -y done - # Install jupyter_client 7.2.0 to prevent ZMQ Socket operation on non-socket - # Remove this when the issue is fixed upstream most probaly with jupyter_client=7.2.3 - # See https://github.com/spyder-ide/spyder/issues/17615 - pip install -q jupyter_client==7.2.0 - # Remove Spyder to properly install it below pip uninstall spyder -q -y fi diff --git a/.github/workflows/test-files.yml b/.github/workflows/test-files.yml index 585c5c784dc..882c48ecbb1 100644 --- a/.github/workflows/test-files.yml +++ b/.github/workflows/test-files.yml @@ -68,7 +68,7 @@ jobs: shell: bash run: | sudo apt-get update --fix-missing - sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev libegl1-mesa libxkbcommon-x11-0 xterm --fix-missing + sudo apt-get install -qq pyqt5-dev-tools libxcb-xinerama0 xterm --fix-missing - name: Cache conda uses: actions/cache@v2 env: diff --git a/binder/environment.yml b/binder/environment.yml index b0f03ea87a6..7cdc7d22f51 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -29,6 +29,7 @@ dependencies: - pylint >=2.5.0 - pyls-spyder >=0.4.0 - pyqt <5.16 +- pyqtwebengine <5.16 - python-lsp-black >=1.2.0 - python-lsp-server >=1.4.1,<1.5.0 - pyxdg >=0.26 diff --git a/requirements/conda.txt b/requirements/conda.txt index ebe2f09cb13..990723da9e2 100644 --- a/requirements/conda.txt +++ b/requirements/conda.txt @@ -25,6 +25,7 @@ pygments >=2.0 pylint >=2.5.0 pyls-spyder >=0.4.0 pyqt <5.16 +pyqtwebengine <5.16 python-lsp-black >=1.2.0 python-lsp-server >=1.4.1,<1.5.0 pyxdg >=0.26 diff --git a/spyder/plugins/variableexplorer/widgets/dataframeeditor.py b/spyder/plugins/variableexplorer/widgets/dataframeeditor.py index 188f16fd127..2494c7bed26 100644 --- a/spyder/plugins/variableexplorer/widgets/dataframeeditor.py +++ b/spyder/plugins/variableexplorer/widgets/dataframeeditor.py @@ -1368,7 +1368,6 @@ def resize_to_contents(self): #============================================================================== def test_edit(data, title="", parent=None): """Test subroutine""" - app = qapplication() # analysis:ignore dlg = DataFrameEditor(parent=parent) if dlg.setup_and_check(data, title=title): @@ -1384,6 +1383,8 @@ def test(): from numpy import nan from pandas.util.testing import assert_frame_equal, assert_series_equal + app = qapplication() # analysis:ignore + df1 = pd.DataFrame( [ [True, "bool"], diff --git a/spyder/plugins/variableexplorer/widgets/objecteditor.py b/spyder/plugins/variableexplorer/widgets/objecteditor.py index 9f1d69afd7f..cc2747c8d1c 100644 --- a/spyder/plugins/variableexplorer/widgets/objecteditor.py +++ b/spyder/plugins/variableexplorer/widgets/objecteditor.py @@ -98,7 +98,7 @@ def end_func(dialog): return dialog, end_func -def oedit(obj, modal=True, namespace=None): +def oedit(obj, modal=True, namespace=None, app=None): """Edit the object 'obj' in a GUI-based editor and return the edited copy (if Cancel is pressed, return None) @@ -110,10 +110,6 @@ def oedit(obj, modal=True, namespace=None): (instantiate a new QApplication if necessary, so it can be called directly from the interpreter) """ - # Local import - from spyder.utils.qthelpers import qapplication - app = qapplication() - if modal: obj_name = '' else: @@ -137,7 +133,7 @@ def oedit(obj, modal=True, namespace=None): else: keeper.create_dialog(dialog, obj_name, end_func) import os - if os.name == 'nt': + if os.name == 'nt' and app: app.exec_() @@ -146,6 +142,10 @@ def oedit(obj, modal=True, namespace=None): #============================================================================== def test(): """Run object editor test""" + # Local import + from spyder.utils.qthelpers import qapplication + app = qapplication() # analysis:ignore + data = np.random.randint(1, 256, size=(100, 100)).astype('uint8') image = PIL.Image.fromarray(data) example = {'str': 'kjkj kj k j j kj k jkj', @@ -164,10 +164,10 @@ def __init__(self): self.text = "toto" foobar = Foobar() - print(oedit(foobar)) # spyder: test-skip - print(oedit(example)) # spyder: test-skip - print(oedit(np.random.rand(10, 10))) # spyder: test-skip - print(oedit(oedit.__doc__)) # spyder: test-skip + print(oedit(foobar, app=app)) # spyder: test-skip + print(oedit(example, app=app)) # spyder: test-skip + print(oedit(np.random.rand(10, 10), app=app)) # spyder: test-skip + print(oedit(oedit.__doc__, app=app)) # spyder: test-skip print(example) # spyder: test-skip diff --git a/spyder/tests/test_dependencies_in_sync.py b/spyder/tests/test_dependencies_in_sync.py index 14d382f7991..ff57ff2309c 100644 --- a/spyder/tests/test_dependencies_in_sync.py +++ b/spyder/tests/test_dependencies_in_sync.py @@ -220,6 +220,8 @@ def test_dependencies_for_spyder_dialog_in_sync(): if 'pyqt' in spyder_reqs: spyder_reqs.pop('pyqt') + if 'pyqtwebengine' in spyder_reqs: + spyder_reqs.pop('pyqtwebengine') assert spyder_deps == spyder_reqs @@ -231,9 +233,6 @@ def test_dependencies_for_spyder_setup_install_requires_in_sync(): spyder_setup = parse_setup_install_requires(SETUP_FPATH) spyder_reqs = parse_requirements(REQ_FPATH) - if 'pyqtwebengine' in spyder_setup: - spyder_setup.pop('pyqtwebengine') - assert spyder_setup == spyder_reqs diff --git a/spyder/widgets/collectionseditor.py b/spyder/widgets/collectionseditor.py index cf1bc54c34a..0e0e92a58a9 100644 --- a/spyder/widgets/collectionseditor.py +++ b/spyder/widgets/collectionseditor.py @@ -1785,20 +1785,13 @@ def __init__(self): def editor_test(): """Test Collections editor.""" - from spyder.utils.qthelpers import qapplication - - app = qapplication() #analysis:ignore dialog = CollectionsEditor() dialog.setup(get_test_data()) dialog.show() - app.exec_() def remote_editor_test(): """Test remote collections editor.""" - from spyder.utils.qthelpers import qapplication - app = qapplication() - from spyder.config.manager import CONF from spyder_kernels.utils.nsview import (make_remote_view, REMOTE_SETTINGS) @@ -1811,9 +1804,12 @@ def remote_editor_test(): dialog = CollectionsEditor() dialog.setup(remote, remote=True) dialog.show() - app.exec_() if __name__ == "__main__": + from spyder.utils.qthelpers import qapplication + + app = qapplication() # analysis:ignore editor_test() remote_editor_test() + app.exec_()