Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated Qt-related code (and glue.qglue) #2477

Merged
merged 3 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ This repository contains the **glue-core** package which includes much of the co
functionality of glue that is used for the different front-ends, including the Qt-based
application and the Jupyter-based application. Other key repositories include:

* `glue-qt <https://github.com/astrofrog/glue-qt/>`_: the original Qt/desktop application for glue
* `glue-jupyter <https://github.com/astrofrog/glue-jupyter/>`_: a Jupyter front-end for glue
* `glue-qt <https://github.com/glue-viz/glue-qt/>`_: the original Qt/desktop application for glue
* `glue-jupyter <https://github.com/glue-viz/glue-jupyter/>`_: a Jupyter front-end for glue

In addition to these, there are a number of plugin packages available. For a full list of repositories,
see https://github.com/glue-viz/.
Expand Down
11 changes: 1 addition & 10 deletions glue/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Set up configuration variables

__all__ = ['custom_viewer', 'qglue', 'test']
__all__ = ['custom_viewer', 'test']

import os

import sys
import warnings

import importlib.metadata

Expand All @@ -15,19 +14,11 @@
sys.meta_path.append(MatplotlibBackendSetter())

from glue.viewers.custom.helper import custom_viewer
from glue.utils.error import GlueDeprecationWarning

# Load user's configuration file
from .config import load_configuration
env = load_configuration()


def qglue(*args, **kwargs):
warnings.warn('glue.qglue is deprecated, import qglue from the glue_qt module instead', GlueDeprecationWarning)
from glue_qt import qglue
return qglue(*args, **kwargs)


from .main import load_plugins # noqa


Expand Down
2 changes: 1 addition & 1 deletion glue/_mpl_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class MatplotlibBackendSetter(object):
"""
Import hook to make sure the proper Qt backend is set when importing
Import hook to make sure the proper backend is set when importing
Matplotlib.
"""

Expand Down
4 changes: 0 additions & 4 deletions glue/app/qt/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/app/qt/actions.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/app/qt/application.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/app/qt/edit_subset_mode_toolbar.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/app/qt/feedback.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/app/qt/keyboard_shortcuts.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/app/qt/layer_tree_widget.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/app/qt/mdi_area.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/app/qt/metadata.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/app/qt/plugin_manager.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/app/qt/preferences.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/app/qt/save_data.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/app/qt/splash_screen.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/app/qt/terminal.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/app/qt/versions.py

This file was deleted.

74 changes: 0 additions & 74 deletions glue/conftest.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
import os
import sys
import warnings

import pytest

try:
from qtpy import PYSIDE2
except Exception:
PYSIDE2 = False

from glue.config import CFG_DIR as CFG_DIR_ORIG

try:
import objgraph
except ImportError:
OBJGRAPH_INSTALLED = False
else:
OBJGRAPH_INSTALLED = True


STDERR_ORIGINAL = sys.stderr

ON_APPVEYOR = os.environ.get('APPVEYOR', 'False') == 'True'
Expand Down Expand Up @@ -73,61 +57,3 @@ def pytest_unconfigure(config):
# Reset configuration directory to original one
from glue import config
config.CFG_DIR = CFG_DIR_ORIG

# Remove reference to QApplication to prevent segmentation fault on PySide
try:
from glue.utils.qt import app
app.qapp = None
except Exception: # for when we run the tests without the qt directories
# Note that we catch any exception, not just ImportError, because
# QtPy can raise a PythonQtError.
pass

if OBJGRAPH_INSTALLED and not ON_APPVEYOR:

# Make sure there are no lingering references to GlueApplication
obj = objgraph.by_type('GlueApplication')
if len(obj) > 0:
objgraph.show_backrefs(objgraph.by_type('GlueApplication'))
warnings.warn('There are {0} remaining references to GlueApplication'.format(len(obj)))

# Uncomment when checking for memory leaks
# objgraph.show_most_common_types(limit=100)


# With PySide2, tests can fail in a non-deterministic way on a teardown error
# or with the following error:
#
# AttributeError: 'PySide2.QtGui.QStandardItem' object has no attribute '...'
#
# Until this can be properly debugged and fixed, we xfail any test that fails
# with one of these exceptions.

if PYSIDE2:
QTSTANDARD_EXC = "QtGui.QStandardItem' object has no attribute "
QTSTANDARD_ATTRS = ["'connect'", "'item'", "'triggered'"]

@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_setup():
try:
outcome = yield
return outcome.get_result()
except AttributeError:
exc = str(outcome.excinfo[1])
for attr in QTSTANDARD_ATTRS:
if QTSTANDARD_EXC + attr in exc:
pytest.xfail(f'Known issue {exc}')

@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_call():
try:
outcome = yield
return outcome.get_result()
# excinfo seems only to be preserved through a single hook
except (AttributeError, ValueError):
exc = str(outcome.excinfo[1])
if "No net viewers should be created in tests" in exc:
pytest.xfail(f'Known issue {exc}')
for attr in QTSTANDARD_ATTRS:
if QTSTANDARD_EXC + attr in exc:
pytest.xfail(f'Known issue {exc}')
4 changes: 0 additions & 4 deletions glue/core/data_exporters/qt/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/core/data_exporters/qt/dialog.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/core/qt/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/core/qt/data_collection_model.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/core/qt/dialogs.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/core/qt/fitters.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/core/qt/layer_artist_model.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/core/qt/message_widget.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/core/qt/mime.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/core/qt/simpleforms.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/core/qt/style_dialog.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/autolinker/qt/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/autolinker/qt/autolinker.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/common/qt/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/common/qt/component_tree_widget.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/component_arithmetic/qt/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/component_arithmetic/qt/component_arithmetic.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/component_arithmetic/qt/equation_editor.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/component_manager/qt/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/component_manager/qt/component_manager.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/data_wizard/qt/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/data_wizard/qt/data_wizard_dialog.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/link_editor/qt/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/link_editor/qt/data_graph.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/link_editor/qt/link_editor.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/subset_facet/qt/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/dialogs/subset_facet/qt/subset_facet.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/icons/qt/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/icons/qt/helpers.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/io/qt/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/io/qt/directory_importer/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/io/qt/directory_importer/directory_importer.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/io/qt/subset_mask.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/plugins/dendro_viewer/qt/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/plugins/dendro_viewer/qt/data_viewer.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/plugins/dendro_viewer/qt/layer_style_editor.py

This file was deleted.

4 changes: 0 additions & 4 deletions glue/plugins/dendro_viewer/qt/options_widget.py

This file was deleted.

Loading
Loading