Skip to content

Commit

Permalink
Merge pull request #22377 from ccordoba12/dont-expose-old-api
Browse files Browse the repository at this point in the history
PR: Don't expose `SpyderPlugin` and `SpyderPluginWidget` as part of the public API
  • Loading branch information
ccordoba12 authored Aug 23, 2024
2 parents 1d641f5 + b79c552 commit 6cb9e98
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
4 changes: 3 additions & 1 deletion changelogs/Spyder-6.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@
* Add a new button to the Variable Explorer to indicate when variables are being
filtered.

### New API features
### New API and plugin features

* `SpyderPluginV2.get_description` must be a static method now and
`SpyderPluginV2.get_icon` a class or static method. This is necessary to
display the list of available plugins in Preferences in a more user-friendly
way (see PR spyder-ide/spyder#21101).
* `SpyderPlugin` and `SpyderPluginWidget` are no longer exposed in the public
API. They will be removed in Spyder 6.1.
* Generalize the Run plugin to support generic inputs and executors. This allows
plugins to declare what kind of inputs (i.e. file, cell or selection) they
can execute and how they will display the result.
Expand Down
2 changes: 1 addition & 1 deletion spyder/api/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
updated.
"""

VERSION_INFO = (0, 10, 0)
VERSION_INFO = (1, 0, 0)
__version__ = '.'.join(map(str, VERSION_INFO))
5 changes: 2 additions & 3 deletions spyder/api/plugin_registration/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
from spyder.api.config.mixins import SpyderConfigurationAccessor
from spyder.api.plugin_registration._confpage import PluginsConfigPage
from spyder.api.exceptions import SpyderAPIError
from spyder.api.plugins import (
Plugins, SpyderPluginV2, SpyderDockablePlugin, SpyderPluginWidget,
SpyderPlugin)
from spyder.api.plugins import Plugins, SpyderDockablePlugin, SpyderPluginV2
from spyder.api.plugins._old_api import SpyderPlugin, SpyderPluginWidget
from spyder.utils.icon_manager import ima


Expand Down
3 changes: 1 addition & 2 deletions spyder/api/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
==================
Here, 'plugins' are Qt objects that can make changes to Spyder's main window
and call other plugins directly.
and call/connect to other plugins directly.
There are two types of plugins available:
Expand All @@ -22,5 +22,4 @@
"""

from .enum import Plugins, DockablePlugins # noqa
from .old_api import SpyderPlugin, SpyderPluginWidget # noqa
from .new_api import SpyderDockablePlugin, SpyderPluginV2 # noqa
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"""
Old API for plugins.
These plugins were supported until Spyder 4, but they will be deprecated in
the future. Please don't rely on them for new plugins and use instead the
classes present in new_api.py
These plugins were supported until Spyder 5, but that's no longer the case.
Please don't rely on them for new plugins and use instead the classes present
in new_api.py
"""

# Third-party imports
Expand Down
2 changes: 1 addition & 1 deletion spyder/api/plugins/new_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

# Package imports
from .enum import Plugins
from .old_api import SpyderPluginWidget
from ._old_api import SpyderPluginWidget


# Logging
Expand Down
5 changes: 2 additions & 3 deletions spyder/app/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@

# Spyder API Imports
from spyder.api.exceptions import SpyderAPIError
from spyder.api.plugins import (
Plugins, SpyderPlugin, SpyderPluginV2, SpyderDockablePlugin,
SpyderPluginWidget)
from spyder.api.plugins import Plugins, SpyderDockablePlugin, SpyderPluginV2
from spyder.api.plugins._old_api import SpyderPlugin, SpyderPluginWidget

#==============================================================================
# Windows only local imports
Expand Down
3 changes: 2 additions & 1 deletion spyder/plugins/preferences/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
from qtpy.QtWidgets import QMessageBox

# Local imports
from spyder.api.plugins import Plugins, SpyderPluginV2, SpyderPlugin
from spyder.api.plugins import Plugins, SpyderPluginV2
from spyder.api.plugins._old_api import SpyderPlugin
from spyder.api.plugin_registration.decorators import (
on_plugin_available, on_plugin_teardown)
from spyder.api.plugin_registration.registry import PreferencesAdapter
Expand Down

0 comments on commit 6cb9e98

Please sign in to comment.