How to setup IDE and workflow to develop an Indigo Plugin

Posted on
Mon Jun 20, 2022 2:04 am
indy offline
Posts: 18
Joined: Nov 15, 2014
Location: Auckland, New Zealand

How to setup IDE and workflow to develop an Indigo Plugin

I've been using Indigo (and various plugins) for a while, but I've never attempted to write a plugin.

I have an Indigo server running on a Mac Mini on my home network. There is no screen attached to the server. However, I can connect to the server in multiple ways including using the Indigo client running on my laptop, as well as over SSH (terminal), SMB (Finder) and VNC (Screen Sharing).

I would like to use VIsual Studio Code or PyCharm to work on my plugin.

I have looked at the various resources around plugin developemnt and have searched the forums hoping to find something that can help me get started with setting up my laptop so that I can develop the plugin locally while connecting to the Indigo Server running on my Mac Mini server.

I have also read through wiki pages on plugin development, Indigo Object Model, scripting and IndigoSDK. I have cloned the IndigoSDK git repo on my laptop as well.

I am unable to get my head around how to set up Visual Studio Code or PyCharm on my laptop so that they can connect up to the remote Indigo server and allow me make changes and test the plugin. I'm hoping there is a way to get autocompletion etc. going as well. I have enough knowledge of both Visual Studio Code and PyCharm that I can be considered dangerous :)

Is there a guide around how to get development tools working and workflows around plugin development?

Would really appreciate any help around this. Given that so many people in the Indigo community are creating plugins actively, I'm sure I'm missing something basic.

Thanks.

Posted on
Mon Jun 20, 2022 11:25 am
jay (support) offline
Site Admin
User avatar
Posts: 17487
Joined: Mar 19, 2008
Location: Austin, Texas

Re: How to setup IDE and workflow to develop an Indigo Plugi

This forum post (which, granted, is kinda buried) explains how to set up PyCharm (Pro version required since it relies on the remote debugging functionality). PyCharm runs the debug server so an Indigo plugin can easily attach to that debug process and successfully debug from PyCharm.

Unfortunately, VS Code's debugging implementation requires that the target process run the debug server, which is not possible in an Indigo Plugin.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Jun 21, 2022 2:16 am
indy offline
Posts: 18
Joined: Nov 15, 2014
Location: Auckland, New Zealand

Re: How to setup IDE and workflow to develop an Indigo Plugi

Thanks Jay. That's quite informative.

But is there some more basic documentation which goes through how to set up all the libraries etc.

For example, when I open the code for a plugin in PyCharm, the 'import indigo' statement does not work as the library is not imported. I have attached a screenshot of that.I tried pip install indigo but that throws errors (the errors are attached as a text file)

I was hoping that someone can guide me in setting up the project or point to some documentation around that.

Thanks
Attachments
pip_error_for_indigo.txt
(10.87 KiB) Downloaded 1 time
2022-06-21_20-10-53.png
2022-06-21_20-10-53.png (254.19 KiB) Viewed 201 times

Posted on
Tue Jun 21, 2022 2:34 am
FlyingDiver offline
User avatar
Posts: 6045
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: How to setup IDE and workflow to develop an Indigo Plugi

You can't pip install Indigo. it's not a pypi package.

You can either:
Code: Select all
import indigo  # noqa

or
Code: Select all
try:
    import indigo
except ImportError:
    pass

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Jun 21, 2022 2:35 am
FlyingDiver offline
User avatar
Posts: 6045
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: How to setup IDE and workflow to develop an Indigo Plugi

For the other error, the queue package change in Python3. It's now just
Code: Select all
import queue

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Jun 21, 2022 3:20 pm
indy offline
Posts: 18
Joined: Nov 15, 2014
Location: Auckland, New Zealand

Re: How to setup IDE and workflow to develop an Indigo Plugi

Thanks @FlyingDiver, that seems to have removed the errors.

One aspect I'm still not clear about it is how do you develop the plugin locally, test it, and then move it across to the server where it is actually running/enabled. Would appreciate your thoughts and guidance.

I notice that you are a veteran plugin developer. What does your workflow look it?

Posted on
Tue Jun 21, 2022 3:23 pm
FlyingDiver offline
User avatar
Posts: 6045
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: How to setup IDE and workflow to develop an Indigo Plugi

I run Indigo on my desktop iMac, and test most plugins from there. If I need the server Mac, I copy the modified plugin to that machine and restart the plugin remotely using the Indigo client.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Jun 21, 2022 3:43 pm
indy offline
Posts: 18
Joined: Nov 15, 2014
Location: Auckland, New Zealand

Re: How to setup IDE and workflow to develop an Indigo Plugi

Ah. I see. So mostly you develop the plugins on the same machine as where it eventually runs.

So is how your workflow looks like...
- develop on the same machine where you will eventually run the plugin
- you make the changes to the plugin code
- reload the plugin (either via commandline or UI)
- view the error log
- correct any errors
- and so on?

In my case, I will almost never be on the same server as were I will be working on the plugin.

Running a server locally (for development) and for live seems to require two licenses -- one for local machine and one for live. Can Jay/Matt confirm that this is indeed the case?
Last edited by indy on Tue Jun 21, 2022 4:51 pm, edited 1 time in total.

Posted on
Tue Jun 21, 2022 4:04 pm
jay (support) offline
Site Admin
User avatar
Posts: 17487
Joined: Mar 19, 2008
Location: Austin, Texas

Re: How to setup IDE and workflow to develop an Indigo Plugi

Licenses are tied to a specific Mac so running servers on two Macs require two licenses.

One of our developers is working on a wiki article that will address a lot of what you're asking about, so we'll post on this thread when that article is ready for public consumption.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Jun 21, 2022 4:50 pm
indy offline
Posts: 18
Joined: Nov 15, 2014
Location: Auckland, New Zealand

Re: How to setup IDE and workflow to develop an Indigo Plugi

Thanks for the clarification on licensing Jay.

Look forward to the article... would be really helpful.

Posted on
Thu Jun 23, 2022 1:32 am
MarcoGT offline
Posts: 917
Joined: Sep 11, 2014
Location: Germany

Re: How to setup IDE and workflow to develop an Indigo Plugi

Does it mean that for the debugger I have to get the professional edition which is not free, right?

Posted on
Thu Jun 23, 2022 4:29 am
DaveL17 offline
User avatar
Posts: 6202
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: How to setup IDE and workflow to develop an Indigo Plugi

For remote debugging with PyCharm, that's correct. Jetbrains offers an individual (non-commercial) license that's very reasonable and offers additional discounts for the second year and beyond.

There are at least two other command line debugging options -- "pdb" and "PuDB" -- which are both free I believe. I haven't used either of them personally.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Jun 23, 2022 6:55 am
neilk offline
Posts: 546
Joined: Jul 13, 2015
Location: Reading, UK

Re: How to setup IDE and workflow to develop an Indigo Plugi

That is correct - but the free version works well without it (I have never really got around to setting the debugger up despite buying the license)

Posted on
Thu Jun 23, 2022 12:51 pm
indy offline
Posts: 18
Joined: Nov 15, 2014
Location: Auckland, New Zealand

Re: How to setup IDE and workflow to develop an Indigo Plugi

Yes, that set up looks quite gnarly.

Till I get my head around how to set up the environment correctly, I'm going to hold off trying to set up debugging. Seems like an advanced topic.

Hope the wiki article on how to set up a development environment for Indigo is posted soon!

Posted on
Thu Jun 23, 2022 1:05 pm
jay (support) offline
Site Admin
User avatar
Posts: 17487
Joined: Mar 19, 2008
Location: Austin, Texas

Re: How to setup IDE and workflow to develop an Indigo Plugi

It's really not gnarly if you're doing development and testing on the same Mac. There are a few steps, yes, but once it's set up it just works. And works amazingly well.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 11 guests