Contributing to the Live Coding in Python Project
If you like this project and want to make it better, help out. It could be as simple as sending @donkirkby a nice note on Twitter, you could report a bug, or pitch in with some development work. There are usually some issues labeled as good first issues or help wanted.
Bug Reports and Enhancement Requests
Please create issue descriptions on GitHub. Be as specific as possible. Which version are you using? What did you do? What did you expect to happen? Are you planning to submit your own fix in a pull request? Please include a small code sample and what you would like the live code display to show for that code.
If you want to see what's currently being worked on, check out the latest milestone.
Running from source code
- You need to install the PDE. You can either install the standard edition of Eclipse that includes it, or you can open the Help menu, choose Eclipse Marketplace..., click on the Yoxos marketplace, search for PDE, and install it.
- Open the plugin.xml file with the Plug-in Manifest Editor.
- Click on the green play button to launch the Eclipse application.
- Create a new PyDev project, add a Python file, and then turn on Live Coding.
- Now you can hack on the live-py source code and see the results.
Creating an Install Package for the Eclipse plugin
- Check that all the Java unit tests run.
toxto check that all the Python unit tests run in the latest versions of both Python 2 and Python 3.
- Open these files and increment the Version field in each file.
- Look in the
docsfolder with the update project nested inside, and open the update project's
- Click the Add Feature... button, type "live", select
live_py_featurefrom the list, and click OK.
live_py_featureunder the devtools group, and click the Build button.
- Commit the new version files, push, and create a release on GitHub. (Finish the PyCharm release before marking the release on GitHub, if you're releasing both).
- Update the version number on the Eclipse marketplace.
Running from Source Code
Download and install IntelliJ IDEA, then open the
Install the Python plugin. It will probably prompt you when you open the project.
Use Git to clone the IDEA source code. (It takes a while.)
git clone git://git.jetbrains.org/idea/community.git idea
Check out the Git label that matches the version of IDEA you are using. Find the build number in the Help: About dialog. List the available tags, then check out the one that matches.
cd idea git tag git checkout tags/x.y
Back in IDEA, configure the IntelliJ platform plugin SDK. Don't forget to add a source path for the IDEA source code that you downloaded.
In that SDK's classpath, add an entry for the Python plugin. Look in the IDEA configuration folder, something like this:
You might have to add a Python SDK as well. One good way to get a useful Python configuration is to run tox in the
live-py-pluginfolder. Then configure a Python SDK using
live-py-plugin/.tox/py36/bin/python3.6, for example.
From the Run menu, choose Run..., and configure a Plugin launch. Then launch it. It will prompt you to set up a new project.
In the new project, create a
.pyfile. Then install the Python plugin when it prompts you. That will make you restart IDEA.
Configure a Python SDK in the new project. It's in the File menu under Project Structure.
Creating an Install Package for the PyCharm plugin
- Check that all of the Python unit tests pass, by running tox.
- Update the version number and change notes in
- Right-click the plugin module in the Project view and select Prepare Plugin Module 'livepy' For Deployment in the context menu.
- Install the new plugin jar into your IntelliJ or PyCharm. Sometimes it behaves differently as a jar. From the File menu, choose Settings....
- Navigate down to the plugins section, and click the Install plugin from disk... button.
- Select the jar file you just created, and click the Restart button.
- Once it restarts, open a Python file, and check that live coding works.
- Commit the version number changes, push, and create a release on GitHub. (Finish the Eclipse release before marking the release on GitHub, if you're releasing both).
- Upload the jar file to the plugin repository by clicking the Update plugin button on the plugin page.
live-py-mode package as described in the README file, then replace all the files in
~/.emacs.d/elpa/live-py-mode-X.Y with symbolic links to your git repository.
Releases are built automatically on each commit, and published at melpa.org. Stable releases are built from each tag.
Debugging live-py-mode in Emacs
When adding temporary debugging messages it is recommended to open a second
Emacs frame for the Messages buffer by typing
C-x 5 2 in the Messages
Run the commands listed in
.travis.yml in the section "script:" manually
to check for compiler warnings and test regressions.
Adding Support For a New Editor
If you want to use live coding with a new editor, you can add basic support with two features:
First, launch a process like this:
Then pass the source code from the editor as the standard input for that process, and capture the standard output.
Second, display that standard output beside the source code, and keep the two windows synchronized as they scroll up and down.
If you use your editor's plug-in system to package that up with the four files
PySrc folder, then you're ready to publish your first release.
To add more features, look at the options by running:
python plugin/PySrc/code_tracer.py -h
The canvas commands are for turtle graphics and matplotlib:
create_image. Look at
SplitFileEditor.TurtleCanvas in the
pycharm project for an example.
The driver command and arguments let you use another script or unit tests to call the live coding file.