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

PR: Make plugins.py a package (API) #16102

Merged
merged 2 commits into from
Jul 30, 2021
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
3 changes: 3 additions & 0 deletions .github/scripts/modules_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ for f in spyder/*/*/*.py; do
if [[ $f == spyder/plugins/tours/widgets.py ]]; then
continue
fi
if [[ $f == spyder/api/plugins/*.py ]]; then
continue
fi
python "$f"
if [ $? -ne 0 ]; then
exit 1
Expand Down
3 changes: 1 addition & 2 deletions spyder/api/plugin_registration/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@

# Local imports
from spyder.config.manager import CONF
from spyder.api.plugins_enum import Plugins
from spyder.api.exceptions import SpyderAPIError
from spyder.api.plugins import (
SpyderPluginV2, SpyderDockablePlugin, SpyderPluginWidget,
Plugins, SpyderPluginV2, SpyderDockablePlugin, SpyderPluginWidget,
SpyderPlugin)


Expand Down
26 changes: 26 additions & 0 deletions spyder/api/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)

"""
spyder.api.plugins
==================

Here, 'plugins' are Qt objects that can make changes to Spyder's main window
and call other plugins directly.

There are two types of plugins available:

1. SpyderPluginV2 is a plugin that does not create a new dock/pane on Spyder's
main window. Note: SpyderPluginV2 will be renamed to SpyderPlugin once the
migration to the new API is finished

2. SpyderDockablePlugin is a plugin that does create a new dock/pane on
Spyder's main window.
"""

from .enum import Plugins # noqa
from .old_api import SpyderPlugin, SpyderPluginWidget # noqa
from .new_api import SpyderDockablePlugin, SpyderPluginV2 # noqa
5 changes: 0 additions & 5 deletions spyder/api/plugins_enum.py → spyder/api/plugins/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
"""Enum of Spyder internal plugins."""


##############################################################################
#
# New API: Migrate plugins one by one and test changes on the way.
#
##############################################################################
class Plugins:
"""
Convenience class for accessing Spyder internal plugins.
Expand Down
Loading