Pymacs, ropemacs, virtualenv

Registered by Andreas Roehler

http://slacy.com/blog/2011/03/pymacs-ropemacs-and-virtualenv-all-at-the-same-time/

pymacs, ropemacs, and virtualenv, all at the same time.
Posted on March 4, 2011 by slacy

So, you’re developing for Python, and you want to use rope and ropemacs and pymacs, but it’s totally busted when you use your virtualenv.

In addition, the packaged versions of pymacs+ropemacs for ubuntu 10.10 (and 11.04) are also kind of busted, because they complains with really odd errors.

Here’s the solution:

Install the latest, greatest versions of everything into your virtualenv:

. ./env/bin/activate
pip install -e hg+https://bitbucket.org/agr/rope#egg=rope
pip install -e hg+https://bitbucket.org/agr/ropemacs#egg=ropemacs
pip install -e hg+https://bitbucket.org/agr/ropemode#egg=ropemode
pip install -e git+https://github.com/pinard/Pymacs.git#egg=pymacs

Unfortunately, pymacs doesn’t cleanly install, so then need to:

cd env/src/pymacs
make

Once that’s done, you should have env/src/pymacs/pymacs.el. Great.

Am 29.01.2012 04:24, schrieb François Pinard:
> Andreas Röhler<email address hidden> writes:
>
>> If we provide the next Python-mode/Pymacs release using Make as Pymacs
>> does, the top directory should contain only the minimal requiring,
>> i.e, INSTALL, README etc.
>
> Hi, Andreas, and gang.
>
> Recently, I noticed that pymacs.el within python-mode (should be
> Pymacs.el from now on), has a small local modification. When Emacs
> launches the Python helper, it first does:
>
> " sys.path.insert(1, os.getenv('PYMACS_INSTALL_DIR'));"
>
> Let me comment a bit about this change:
>
> * Nowhere in python-mode README nor INSTALL, this PYMACS_INSTALL_DIR
> environment variable is presented nor explained, while it really
> should. Average Python mode users are unlikely to guess they have to
> set this environment variable prior to calling Emacs.
>
> * The change addresses a need that python-mode has and which Pymacs
> currently does not offer, which is the need of use it without prior
> installation. Don't shudder, I'm surely not going to ask you to go to
> GitHub and file a report about this. If I needed it, I'd do it myself
> rather than ask others to do it in my place -- you know me! :-)
>
> * It would be comfortable that python-mode could work with the minimum
> setup possible. Granted that Pymacs is not the easiest thing to
> package, especially since the advent of Python 3. Yet, if we could
> avoid the formal installation step, it would be nice.
>
> * I first thought about yet another Emacs variable to tell where
> exactly sits Pymacs.py, but this is not a good idea. If Emacs is
> not able to find Pymacs.py, other Python modules written by users
> would also be unable to import from Pymacs. It would be broken,
> just at a later stage.
>
> * So, if Pymacs.py is not installed or not available in the regular
> Python search path, it better be somewhere along the
> pymacs-load-path list. So my idea would be to launch the Pymacs
> helper from any Pymacs.py found in a directory listed in
> pymacs-load-path. If none found, then it would fall back on looking
> elsewhere in the system. Does it sound reasonable? Does someone
> see a flaw in this?
>
> Have a nice evening, everybody.
>
> François
>
> P.S. A few more points, maybe, conveying personal opinions:
>
> * If python-mode distributes packages copied from external sources
> (Pymacs in this example, there are a few others), it should pay
> attention at keeping its copies reasonably up-to-date. Otherwise
> confusion, then frustration will eventually develop.
>
> * Observed flaws or developed corrections for packages included in
> python-mode from external source should be duly reported upstream.
> The GPL applies of course, one may play by the law (I recently read
> python-mode archives, and saw such games acted by David Love, which
> were not always tasteful). My point is that symmetrical collaboration
> is more polite, and likely more fruitful in the long run.

Blueprint information

Status:
Started
Approver:
None
Priority:
Medium
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Discussion
Series goal:
None
Implementation:
Started
Milestone target:
None
Started by
Andreas Roehler

Related branches

Sprints

Whiteboard

Hi François,

what about the following:

I'll fork Pymacs on Github into another PDEE branch, lets assume
https://github.com/pdee/pdee/tree/master/python-modes/pymacs/Pymacs

afterwards copy the python-mode files in pymacs, the branch name

than it's yours to raise "make" out from Pymacs and turning it into a general make, prepared to deal with a lot of more stuff to come.

Agreed?

Andreas

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.