I still don't understand what "--editable" accomplishes, so I've never used 
it.

What I do, when I want to run from a git clone, is to set PYTHONPATH to the 
top directory of the clone.  Then Python will use, say, the Leo clone but 
it find all its other packages from the regular installed site-packages 
directory.  If I'm working on code for Leo, I keep the working code in a 
separate development directory, and bind a hot key to a little script that 
copies that file or files to the git clone.

This way, if the clone gets trashed somehow, I haven't lost any work.  I 
can just copy it to a new clone.

This approach is also compatible with using a virtual environment.

On Thursday, March 26, 2020 at 2:00:41 AM UTC-4, tfer wrote:
>
> I've been making a mistake in setting up Leo and using it for years!
>
> I've always run Leo from my local git clone of it, (usually the develop 
> branch), never realizing I should have been using setup.py to make sure the 
> python it is running under is fully ready to support it.  I just used 
> launchleo.py to start it, adding any packages that it complained about as 
> "missing" and carrying on.
>
> I was using the very "fat" anaconda as my system python and not using any 
> virtual environments.  Now that their conda utility program has been made 
> to work under powershell, (it only worked "cmd", before), --note use 
> "<path-to-conda>/conda init" to integrate it into powershell, I realiize 
> this wasn't the way to go.
>
> I got rid of Anaconda, (not easy, uninstall and getting rid of 
> directories...), then just went with Miniconda.  I now can create conda 
> env(s), leobase, leobase1, leobase2, and so on.  This is were I finally 
> tumbled on what setup.py was for!  
>
> My first naive approach was to run the script directly with the leobase 
> enviroment active, but it does not run completely this way, (it does a 
> bunch of stuff, then exits with a failed import).  I found (and Matt 
> pointed out to me), that I should be using pip, specifically: "pip install 
> --editable ." --while in the git directory of leo.
>
> Anyway, I expanded the docstring of setup.py and put in a guard to prevent 
> anyone from using it naively like I did.   I've attached below.
>

-- 
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/0116e10a-0448-442e-a009-73ca5874eb1b%40googlegroups.com.

Reply via email to