spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.33k stars 1.61k forks source link

Support to add programmatic (script) actions to toolbar buttons #259

Open spyder-bot opened 9 years ago

spyder-bot commented 9 years ago

From edt...@gmail.com on 2010-08-01T09:00:50Z

I'd like to add a few simple command line capabilities to Spyder without needing to modify the code. If I had toolbar I could attach python scripts which execute in shells with context aware env variables, I could do a lot of customization with minimal coding.

For example, I'd like to use bazaar to manage a project. I'd like to be able to commit a project file from inside spyder. If I had a hot button that could execute a python script running in a new shell, I could easily add this. If the shell started with environmental variables that described the currently open file, its path, etc, I could write a simple python script to call bazaar with the project I'm working and and commit the current file.

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=259

spyder-bot commented 9 years ago

From ccordoba12 on 2011-04-15T07:57:23Z

Labels: -Type-Defect Type-Enhancement

spyder-bot commented 9 years ago

From ccordoba12 on 2011-10-07T13:38:48Z

Labels: Cat-SpyderGUI

spyder-bot commented 9 years ago

From pierre.raybaut on 2012-03-18T14:06:12Z

Labels: -Type-Enhancement Type-Enh

spyder-bot commented 9 years ago

From ccordoba12 on 2015-01-03T07:41:20Z

Summary: Support to add programmatic (script) actions to toolbar buttons (was: Support for triggering simple command line level actions with information from inside spyder from toolbar buttons)

spyder-bot commented 9 years ago

From contrebasse on 2015-01-06T07:51:20Z

Just a thought, but a plugin can relatively easily add toolbar buttons. But to be efective, we would need 2 things:

spyder-bot commented 9 years ago

From ccordoba12 on 2015-01-06T07:59:53Z

Solving the third-party plugins issue is really high on my todo list for 2.4 :-) I think the easiest way would be to make "spyderplugins" a namespace package.

spyder-bot commented 9 years ago

From contrebasse on 2015-01-07T06:14:40Z

How would a user add his plugin to this namespace package ? It looks like it would need admin rights.

spyder-bot commented 9 years ago

From ccordoba12 on 2015-01-07T07:09:58Z

That's for pip installations to work. For users we would need a special dir in ~/.spyder2 (spyderplugins too?)

My main idea is this:

  1. Create an (approved) index of third party plugins in a json file attached to a repo in github. The info for each plugin would be: Name, author, version, description and url of a zip file with its contents.
  2. Make Spyder read that file at startup (of course, it'd need to be online for that).
  3. With that info we'd build a Qt dialog that would let users to select and install their plugins of choice.

How's that sound?

spyder-bot commented 9 years ago

From contrebasse on 2015-01-08T04:53:57Z

Didn't know about namespace packages, this looks great ! I'm fine with your 3 steps, but it should be possible to install from a local package (by selecting a zip file) or from an untrusted source (by entering an url).

I think a plugin in the user directory should overwrite any plugin in the global directory with the same name, so maybe having a different name like ~/.spyder2/userplugins would be better for managing such conflicts.

spyder-bot commented 9 years ago

From ccordoba12 on 2015-01-08T09:07:55Z

Agreed with your points too: letting users select their installation location and using "userplugins" as a dir in ~/.spyder2

spyder-bot commented 9 years ago

From goanp...@gmail.com on 2015-01-12T10:18:00Z

I am very interested in this development, specially now that CondaPackages has been merged :p.

Why don't we use the PyPi infrastructure that already exists? We can have the packages installed via pip, and decide on a convention for the package names... (like django...) like 'splugin-conda' (splugin_conda).

When I start working on the Projects manager, there should be something like create a Spyder Plugin, and a basic skeleton for the current version of spyder should be built, including all necessary information so that uploading to pip is easy! then with Binstar we can have a channel that is Spyder-plugins, that we should ship by default.

spyder-bot commented 9 years ago

From goanp...@gmail.com on 2015-01-12T10:18:00Z

I am very interested in this development, specially now that CondaPackages has been merged :p.

Why don't we use the PyPi infrastructure that already exists? We can have the packages installed via pip, and decide on a convention for the package names... (like django...) like 'splugin-conda' (splugin_conda).

When I start working on the Projects manager, there should be something like create a Spyder Plugin, and a basic skeleton for the current version of spyder should be built, including all necessary information so that uploading to pip is easy! then with Binstar we can have a channel that is Spyder-plugins, that we should ship by default.

spyder-bot commented 9 years ago

From ccordoba12 on 2015-01-12T10:36:24Z

Both ways should be possible, i.e. using pip/conda or Spyder. There are two reasons for that:

  1. I think the main idea is not force scientists (our main target) to go through the pains of the Python packaging system (i.e. create a setup.py, decide between distutils or setuptools, etc, etc). Even creating a conda recipe and package is not trivial :-) Instead they can just create a zip file with p_foo.py and widgets/foogui.py and that's it!
  2. To let users install in their home directory, in case they don't use conda :-)
goanpeca commented 9 years ago

Have been thinking about this lately, now with the works on projects I think we could really minimize the friction of the packaging system by including a Spyder pulgin template that already handled the creation of a setup.py and needed stuff.

Nodd commented 8 years ago

There is something in https://github.com/spyder-ide/spyder.example but I don't know how up-to-date it is. Also there should be one example for a widget plugin (like pylint), one for a menu plugin (like autopep8), and one for a toolbarplugin (which could be merged with the previous one because they are very similar).

goanpeca commented 8 years ago

We need to have a more standard way of adding things to the menus. We should add groups to menus so that users can add a menu to a group and keep things more organized, otherwise multiple plugins will start polluting menus

ccordoba12 commented 8 years ago

Agreed!

alexmahrou commented 3 years ago

I specifically am trying to find a way to add a remote spyder kernel in a prebuilt environment to launch just like the standard kernel. Or as a button. Not sure how possible that might be.

ccordoba12 commented 3 years ago

Hey @alexmahrou, we'll work on that for Spyder 5. Here you can find our current discussion about it.