On Sunday, March 29, 2020 at 12:34:56 AM UTC-4, Matt Wilkie wrote:
>
> So if I had a clone at d:\leo-clone, I'd use the following?
>>
>> python -m pip install --editable d:\leo-clone
>>
>  
> Yes.
>
> I  have been setting PYTHONPATH to d:\leo-clone.  This has always seemed 
>> to work well, as long as the dependencies have been installed in my main 
>> Python install (because of a previous Leo install, for example).  This way, 
>> I can always switch back to using the previous install just by launching 
>> from another terminal without setting PYTHONPATH.
>>
>
> If your diferent versions are in the same SCM repo (eg. hg, git) then 
> resettng to or checking out your desired version can be done without 
> messing with PYTHONPATH. This is the primary benefit of editable install, 
> it always uses what's in that directory tree *right now, *allowing you to 
> test code changes immediately.
>
> pip install -e d:\leo-clone
> pushd d:\leo-clone
> git checkout v6.1
> python -m leo.core.runLeo
> # hack, hack. do stuff in Leo 6.1. exit.
> git checkout v6.2
> python -m leo.core.runLeo
> # hack, hack. do stuff in Leo 6.2. exit.
> ...etc
>

You get the same result if you point PYTHONPATH to the clone location.  
 

> If you want to run different versions of Leo side by side then *don't *pip 
> install Leo at all, editable or not, and set PYTHONPATH the way you have 
> been. I think it's cleaner to not to change PYTHONPATH though and to use 
> `python d:\leo-clone-2\launchLeo.py` for starting. (It might mess with some 
> imports or make them unpredictable as they search in Leo's tree instead of 
> the real python tree.)
>

Yes, that's a problem because Leo plugins aren't found the same way as 
ordinary imports.  I've been thinking of asking for a change so that the 
plugins are found using the PYTHONPATH instead of the current method.  Then 
you could keep your development code entirely out of the repo until you got 
it to the point it was worth adding it in.  I'd like that.
 

> Also for sde-byside it's best not to use the same HOME, as files in the 
> .leo folder might get messed up. 
>

That's a problem that I sometimes have, not only with side-by-side.  I 
don't like to use side-by-side anyway except for, let's say, checking that 
something still works in a different version of Leo.  Even virtual 
environments don't solve this, do they? 

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/9c5422b1-adef-4bc7-8ff3-54f01e49ddd7%40googlegroups.com.

Reply via email to