Update: Refactoring Python In Emacs Remote Virtualenvs

, Wellesley, MA

I made a little more progress on getting Rope working in Emacs with remote Python virtualenvs since my previous attempt.

On Friday, some changes I made to python.el landed on Emacs trunk. Emacs had recently broken support for remote Python interpreters when it eliminated the need for its emacs.py file. My changes restored support for remote Python interpreters.

My tramp-virtualenv package is shaping up as a nice alternative to virtualenv.el. It handles remote Python projects and changes virtualenvs for me when I switch to a buffer in a different project.

I turned my attention to Rope, Ropemacs, and Pymacs tonight. I have a small change to Pymacs that lets it start a remote Python interpreter, and I started making experimental changes in Ropemacs to teach it how to handle TRAMP file paths.

Installing packages including my changes looks like this now:

$ pip install rope
$ pip install -e hg+https://matthewlmcclure@bitbucket.org/matthewlmcclure/ropemacs#egg=ropemacs
$ pip install -e git+https://github.com/matthewlmcclure/Pymacs.git@tramp-attempt-2#egg=pymacs
$ pushd $VIRTUAL_ENV/src/pymacs
$ make install

In Emacs:

M-x find-file /path/to/pymacs.el
M-x eval-buffer

The Ropemacs documentation is pretty thin. The README.txt file in the Ropemacs repository has a lot of good documentation, and this StackOverflow post has been helpful to get a basic understanding of how to use Ropemacs on local Python files.

Enjoyed reading this post? Discuss it on Reddit, or follow me on Twitter.