There are two levels of PyCharm development. It's probably best to start with the Python code that runs in all versions of the Live Coding in Python project as well as the Python tests. The second level is to work on the Java code of the PyCharm extension. For either level, you'll need IntelliJ IDEA, and follow the plugin development guidelines. You'll also need the git download instructions if you don't already have it.
If you're trying to find the Java code for some feature of PyCharm,
put a breakpoint in ActionUtil.performDumbAwareWithCallbacks()
, then use the
feature and step through the code after the breakpoint.
- Download and install IntelliJ IDEA, then open the
live-py-plugin
project. Wait a while for IDEA to download all the tools for the Gradle project. - Install the Python plugin. It will probably prompt you when you open the project. Note that there's a full version of the Python plugin for IDEA Ultimate and community edition for IDEA Community Edition.
- 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-plugin
folder. Then configure a Python SDK usinglive-py-plugin/.tox/py36/bin/python3.6
, for example. - If the Gradle window isn't already open, from the Help menu, choose Find Action... and search for Gradle with the elephant icon. Click on it to open the Gradle window.
- In the Gradle window, double-click on livepy: Tasks: intellij: runIde to launch a second copy with your plugin. It will prompt you to set up a new project.
- In the new project, create a
.py
file. 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.
Once you've got everything working with the current IDEA version selected in
build.gradle.kts
, you might want to use different versions to reproduce a bug
or test compatibility with new features. To do that, find the exact build
number you want to use. Start with the IDEA build number ranges, then go to
the IDEA source code, and filter the tag names for the release you want.
Finally, go to the Python plugin page, and find which version is compatible
with the IDEA version you want. Remember the Python plugin has a
full version and a community edition to go with the
two types of IDEA release.
- Check that all the Python unit tests pass, by running tox.
- Update the version number in
about.py
andpycharm/build.gradle.kts
, and the change notes inpycharm/src/main/resources/META-INF/plugin.xml
. Keep the version in sync withhtml/meta.yaml
. - Run the
verifyPlugin
andbuildPlugin
Gradle tasks. Check that you're verifying against the latest release, and that thesinceBuild
matches the oldest verified release. You should get alivepy-X.Y.Z.zip
file for the new version underpycharm/build/distributions
. - Install the new plugin zip file into your IntelliJ or PyCharm. Sometimes it behaves differently as a zip file. From the File menu, choose Settings....
- Navigate down to the plugins section, click on the gear icon at the top, and choose Install plugin from disk... from the menu.
- Select the zip 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 other releases before marking the release on GitHub, if you're releasing more.)
- Upload the zip file to the plugin repository by clicking the Update plugin button on the plugin page.