-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Dev: Spyder Internals
This section aims to give an introduction into Spyder internals.
Note: This is a work in progress!
The following tree represents the current structure of Spyder master repo. The branches here represent only folders, more specifics and explanations will be given below. The most important directories for a developer are probably spyderlib/plugins
and spyderlib/widgets
.
📂 spyder-ide/spyder.git
├── app_example
├── conda.recipe ···················· For creating conda package
├── continuous_integration ··· Scripts for continuous integration
├── doc ····································· Documentation
├── external-py2 ····················· Copies of external libraries
├── external-py3 ····················· Copies of external libraries
├── img_src ····························· Images and other artwork
├── rope_profiling
├── scripts
├── spyder_breakpoints ········ External plugin
├── spyder_io_dcm ················ External plugin
├── spyder_io_hdf5 ················ External plugin
├── spyderlib ··························· Main library
│ ├── app ······························ Entry point for (re)starting
│ ├── config ·························· User configuration
│ ├── defaults ······················ For upgrading from pre-2.3 versions
│ ├── fonts ···························· TODO:
│ ├── images ······················· TODO:
│ ├── locale ························· Translations
│ ├── plugins ······················· Main components of Spyder
│ ├── utils ····························· Utility functions
│ ├── widgets ······················ GUI elements
│ │ ├── externalshell ······· TODO:
│ │ └── sourcecode ········· Code editor widget, Syntax highlighting
│ ├── windows ····················· TODO:
│ └── workers ······················· TODO:
├── spyder_profiler ················· External plugin
└── spyder_pylint ···················· External plugin
TODO:
This folder contains files necessary for building the conda package for installing Spyder. See Conda build recipes for more information.
After every commit, Spyder is built automatically and the tests are run. The required scripts reside in this directory. We use two platforms: AppVeyor (for Windows) and Travis (for Linux).
As the name suggests this is the folder where the documentation of the project resides.
The documentation is written in reStructuredText (.rst) and is parsed using Sphinx.
The documentation is hosted in Python Hosted.
Spyder makes use of external python libraries, such as pyflakes, rope, pep8 and a modified version of the conda_api. When Spyder runs from a Python 2 interpreter, the external-py2
folder is added to the PATH
.
The modules saved here must be compatible with Python 2.
Spyder makes use of external python libraries, such as pyflakes, rope, pep8 and a modified version of the conda_api. When Spyder runs from a Python 3 interpreter, the external-py3
folder is added to the PATH
.
The modules saved here must be compatible with Python 3.
Note: Even if the same module works with both Python 2 and Python 3, it must be copied inside both external-py2
and external-py3
folders.
This folder holds the editable and rendered versions of images and art for the Spyder project.
Included files: Official icons, main logo, and some screenshots.
TODO:
TODO:
These are external plugins which are distributed with Spyder. External plugins are similar to normal plugins but live outside the main spyderlib module. See User plugins and Writing plugins for more information from a user's and developer's perspective, respectively.
This is the actual main module of Spyder.
The name spyderlib
was originally chosen due to the existence of another project named "spyder." However, this folder is soon to be renamed to spyder
.
This contains the entry point for the Spyder application and also the logic for restarting the application.
This folder contains files to do with handling the user configuration. The configuration is divided in sections which correspond to the plugins. In the rest of the code, the object containing the configuration data is called CONF
. Read the note at the bottom of main.py
if you want to change, add or remove a configuration setting.
The files present here are used to cleanly update user configuration options from Spyder versions previous to 2.3.
TODO:
TODO:
The translations of the interface for Spyder are stored in this folder. Currently Spyder has translations available for Spanish (es), French (fr), Brazilian Portuguese (pt_BR) and Russian (ru).
If you would like to have Spyder translated to a new language please drop us a line on the public chat.
The code for Spyder is divided in several parts, called plugins, which reside in this folder. A plugin consists of a widget with some extra code to embed the widget within the Spyder application: entries in the configuration object, shortcut key bindings, toolbar icons, menu items, and collaboration with other plugins using the Qt signal/slot mechanism. The widget may be a standard Qt widget or one of the widgets defined in the widgets folder. The main plugin class inherits from both its main widget and SpyderPluginMixin
. This can be achieved by having the main plugin class inherit from SpyderPluginWidget
, which in turn inherits from QWidget
and SpyderPluginMixin
.
The following plugins are defined in Python files with the same name:
-
Console
(the internal console) -
Editor
(the code editor) -
Explorer
(the file and directory explorer) -
ExternalConsole
(external console; to be refactored with IPythonConsole at time of writing) -
FindInFiles
(the "find in files" tool) -
Help
(the object inspector, for viewing docstrings) -
HistoryLog
(the history log) -
IPythonConsole
(IPython console; to be refactored with ExternalConsole at time of writing) -
OnlineHelp
(uses pydoc to generate online help from docstrings) -
OutlineExplorer
(displays the outline of files) -
ProjectExplorer
(for browsing the current project) -
VariableExplorer
(for browsing and editing variables) -
WorkingDirectory
(the widget in the toolbar which displays the working directory)
This is the location of many common use functions or helpers that make Spyder work and developed in a more consistent way.
These are widgets (Graphical User Interface elements) that are used in Spyder. It should be possible to use these widgets outside Spyder. Ideally, each file when run will display the corresponding widget. Widgets can be embedded in plugins defined in the plugins folder, which are responsible for connecting the widgets together into a coherent application (namely Spyder).
TODO:
TODO:
TODO:
TODO:
Connect with Spyder through our social media channels and stay up to date with current developments!