fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] Making env changes persistent to the current session?


From: Jorge Vargas
Subject: Re: [Fab-user] Making env changes persistent to the current session?
Date: Thu, 1 Dec 2011 09:21:14 -0400

Hi,

I think I expressed myself wrong. What I want is to have the effect
spawn outside of python. So I can provide a fab command that will
enhance the activate script from virtualenv.

For example:

$ fab activate
$ pip install some_package

and some_package will end up inside the venv as it was activated by
the fabric script.

My goal here will be to replace an equivalent activate.sh that
modifies the state of the current session (in the shell) not in
python.

On Sun, Nov 27, 2011 at 4:46 PM, Jeff Forcier <address@hidden> wrote:
> Hi Jorge,
>
> On Thu, Nov 24, 2011 at 2:34 PM, Jorge Vargas <address@hidden> wrote:
>> Hi,
>>
>> I was wondering if this is possible. I want something like this.
>>
>> def activate():
>>    local('source env/bin/activate')
>
> You'll need to use prefix() for this, it's in the context managers API docs:
>
>    
> http://docs.fabfile.org/en/1.3.3/api/core/context_managers.html#fabric.context_managers.prefix
>
> As for why, see this FAQ:
>
>    
> http://docs.fabfile.org/en/1.3.3/faq.html#my-cd-workon-export-etc-calls-don-t-seem-to-work
>
> Best,
> Jeff
>
> --
> Jeff Forcier
> Unix sysadmin; Python/Ruby engineer
> http://bitprophet.org
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]