PyCharm recently added some excellent configuration options to facilitate using a remote Python interpreter. With them you can run PyCharm on a host machine, and execute everything on a guest VM. You can keep a single copy of the code and a virtualenv, shared between the host and guest, and tell PyCharm how to map the local and remote filesystem paths to each other. PyCharm will even do code completion without having a second copy of the code or virtualenv on the host machine. Beautiful!
- Shared filesystems, with a mapping between guest and host.
- TRAMP, referencing the code over SSH using TRAMP.
The former is pretty raw and incomplete. The latter is more promising in the near term. It consists of:
python.el- a replacement for the
python.eldistributed with Emacs 24 that makes its python-send-region TRAMP-aware.
demo.py- an interactive demo.
bootstrap-virtualenv.sh- a Bash script to bootstrap a virtualenv for use via Emacs over TRAMP.
python.sh- a Bash script to run python in a virtualenv.
.dir.locals.el- configuration for Emacs to run python via the Bash script wrapper.
tramp-dir-locals.el- a hack to make directory local variables work in directories opened via TRAMP.
If you’re doing anything similar, I’d love to know how.