Tool to generate stubs for the Spotfire dlls These stubs are intended to be used by the autocomplete engine of editors like Atom, Sublime, and Visual Studio Code.
The Spotfire editor for IronPython is primitive and doesn't include all the features expected of a modern IDE. While this tool doesn't attempt to solve the entire problem (e.g. debugging), it does help make the act of writing the Python code simpler. The stubs generated by this tool can be used alongside lightweight IDEs such as Atom, Sublime and Visual Studio Code to support autocomplete while writing code.
Pre-built stubs for different Spotfire versions, along with instructions on how to configure various editors can be found on Tibco's community site at https://community.tibco.com/wiki/how-use-external-editor-edit-ironpython-scripts-autocomplete-and-syntax-checking
Pre-requisites:
- Spotfire, including all packages that you want to support autocomplete
- IronPython - ideally 2.7 matching spotfire
You'll need to locate the Spotfire 'modules' folder, which is normally a hidden folder within your Spotfire installation. Spotfire installs all the packages associated with the running distribution within the modules folder - so you should see lots of folders suffixed with version numbers. Stubs generation relies on having a single version of each module - behaviour with multiple versions isn't predictable (you'll likely get stubs, but the may be for the older version).
This tool works with a Spotfire 'portable' install with a single version of each module stored within the modules folder - it may also work with a regular Spotfire install as long as there is only one version of each module.
Once you locate your modules folder, make sure that the IronPython folder is on the path and execute these commands (if IronPython isn't on the path you may find that entering the full path for IPY also works - this hasn't been tested).
cd <this directory>
ipy -m stubs --spotfire="c:\spotfire\modules"
This project is a fork of the repository owned by Gui Talarico at https://github.com/gtalarico/ironpython-stubs, which is in turn a fork of the repository started by Gary Edwards on Gitlab. Thanks to Gui and Gary for their work getting the basics working - I've simply added wrapper code to handle traversing Spotfire's folders.
It uses PyCharm's Generator3 to create the stubs.