Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm: Sharing run configurations across platforms

Tags:

python

pycharm

I would like to share PyCharm run configurations across multiple machines and platforms by storing them under version control. However, I have noticed that the run configuration XML file contains platform-dependent information, namely the full path of the python interpreter:

File .idea/runConfigurations/job.xml:
<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="job_name" type="tests" factoryName="Nosetests">
    ...
    <option name="SDK_HOME" value="/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python" />
    ...
  </configuration>
</component>

How can I share my run configurations without keeping the full python interpreter path around?

like image 884
Felix Avatar asked Mar 21 '23 10:03

Felix


1 Answers

After trying it out, it turns out that the SDK_HOME field doesn't need to have a value, as long as the project has a python interpreter set: <option name="SDK_HOME" value="" />

To remove a given interpreter from all job files:

sed -i -e 's#SDK_HOME" value=".*"#SDK_HOME" value=""#g' *xml

Setting the project's python interpreter does change misc.xml and semantic-planning.iml, but presumably these could be ignored from version control.

like image 195
Felix Avatar answered Mar 26 '23 10:03

Felix