Make sure you have cookiecutter installed on your working environment.
pip install cookiecutter
conda install cookiecutter
Running the cookiecutter.
cookiecutter https://github.com/spyder-ide/spyder5-plugin-cookiecutter
You can use the default values for quick testing
(generating a SpyderDockablePlugin
), press enter until finished.
You should see something like:
full_name [Spyder Bot]:
email [spyder.python@gmail.com]:
github_username [spyder-bot]:
github_org [spyder-ide]:
project_name [Spyder Boilerplate]:
project_short_description [Boilerplate needed to create a Spyder Plugin.]:
project_pypi_name [spyder-boilerplate]:
project_package_name [spyder_boilerplate]:
pypi_username [spyder-bot]:
Select plugin_type:
1 - Spyder Dockable Plugin
2 - Spyder Plugin
Choose from 1, 2 [1]:
Select open_source_license:
1 - MIT license
2 - BSD license
3 - ISC license
4 - Apache Software License 2.0
5 - GNU General Public License v3
6 - Not open source
Choose from 1, 2, 3, 4, 5, 6 [1]:
After the cookiecutter has been created, install it for local development.
For example, if you used the default configuration the
spyder-boilerplate
directory will be created and then you can do:
cd spyder-boilerplate
pip install -e .
Now if you run Spyder, either from a Spyder installed version in the same
plugin environment or from development version (running python boostrap.py
under the 5.x
branch of your local Spyder cloned repository), you should see:
For plugin_type
= SpyderDockablePlugin
:
- A new Dockable Plugin appear in the
View > Panes
menu. - Clicking the action in the menu for the plugin should make the pane for your plugin visible.
- Clicking the example action from your plugin (either from the plugin options menu or the button with the Spyder logo) will print in the Spyder internal console the message
Example action triggered!
.
For plugin_type
= SpyderPluginV2
:
- A message in the console/terminal from where you launched Spyder saying
<Your plugin name> registered!