Use PyRunConfigurationFactory from PyCharm Plugin
Answered
I am trying to create a plugin for PyCharm and would like to use the PyRunConfigurationFactory to create a configuration. This doesn't appear to be available and I am not sure what I am doing wrong.
I tried adding the following to my plugin.xml, but it can not find the dependency:
<depends>com.intellij.modules.python</depends>
Please sign in to leave a comment.
Chris,
Do you use Gradle? If so, did you add Python plugin as a dependency or set PyCharm as a target IDE?
Please check the PyCharm Plugin Development chapter in our docs.
I used the information from the documents section you referenced to set up my project.
Here is the intellij section of my build.gradle:
intellij {version '2020.1.1'
type "PY"
plugins ['Pythonid']
}
I have tried with and without the plugins line.
When I try to add the dependency to my plugins.xml file, I still get this:
If I remove that dependency, the project runs and I can perform the generic action defined in the plugin. I just do not have the ability to use the Python RunManager and RunConfiguration classes I would like to.
What is the Pythonid in your plugins array?
To make the com.intellij.modules.python available, you'll need to add a python to your plugins list in Gradle configuration:
That came from log output in the form of [Plugin: Pythonid], I incorrectly assumed this was what I needed to use there.
Changing my intellij section to
intellij {version '2020.1.1'
type "PY"
plugins "python"
}
resolved my issue and I was able to get the desired functionality. Thanks Jakub.