Developing and testing plugin with custom build of Pycharm
Answered
The normal work flow with plugin development appears to be setting a version of PyCharm in the build.grade.kts file. When running the plugin with the runIde target, gradle pulls down the specified version of PyCharm and runs it loading the plugin. If any breakpoints are hit, it pauses execution.
I have build PyCharm from the source code on Github. My build includes some minor plugin related modifications which I need in order to debug my plugin. How do I force gradle to use my local build of PyCharm?
Please sign in to leave a comment.
Hi Andrew,
See: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#intellij-extension-localpath
Hi Karol,
Thanks for pointing that out. Unfortunately I am having issues getting it to work. If I set the localPath to point to the project directory of my local IntelliJ build I see the following error:
Could not determine the dependencies of task ':prepareSandbox'.
> Failed to query the value of task ':prepareSandbox' property 'pluginDependencies'.
> Cannot find builtin plugin 'python-ce' for IDE: C:\Users\agrant\develop\intellij-community
If I point to the python sub directory I see :
Could not determine the dependencies of task ':prepareSandbox'.
> Failed to query the value of task ':prepareSandbox' property 'librariesToIgnore'.
> java.nio.file.NoSuchFileException: C:\Users\agrant\develop\intellij-community\python\build.txt
Hi Andrew,
Are you setting the value to the sources directory or to the built IDE distribution installation folder? The latter is correct.
Hi Karol,
I only see an out directory. Do I need to build the installers?
Thanks
Andrew
Yes, the mentioned localPath property should point to a local IDE installation directory.
Thank you for your assistance. I am now able to build installers for my modified version of PyCharm. Ideally though I would like to get my fix merged into the version JetBrains is shipping. I raised a PR https://github.com/JetBrains/intellij-community/pull/2537 which refers to the YouTrack issue I raised https://youtrack.jetbrains.com/issue/PY-61600/Regression-in-support-for-the-pyAddSdkProvider-extension-point-starting-with-Pycharm-CE-version-2022.2x
Is there anything else I need to do to get this fix incorporated?
Thanks
Andrew
Hi Andrew,
I can see the PR got a reviewer assigned, so nothing more is needed. In case it gets delayed, feel free to ping the reviewer on GitHub or in the issue.