Tip: faster dev pip installs with shallow clones

36 views
Skip to first unread message

Matt Wilkie

unread,
Jul 25, 2019, 3:40:54 PM7/25/19
to leo-editor
Things I learned today.

When running `pip install --editable path/to/leo` the  "Installing build dependencies ..." step can take a loooong time. Apparently this is because it creates a copy of the folder tree including the `.git` folder, which can be quite large (ref). My machine right now: .git is 183 MB, while Leo is only 40 MB.

Solution: periodically create a new leo-editor shallow clone:

cd d:\code
git clone
--depth=100 https://github.com/leo-editor/leo-editor.git d:/code/shallow-leo-editor
move d
:\code\leo-editor d:\code\leo-editor-bloated
move d
:\code\shallow-leo-editor d:\code\leo-editor


At current commit rate
  • depth=100 is 6 months of history and 60mb (.git & Leo together)
  • depth=500 is 2 years and 73 MB
  • depth={infinity} is 11 years and 242 MB

-matt
 

Edward K. Ream

unread,
Jul 26, 2019, 10:14:35 AM7/26/19
to leo-editor
On Thu, Jul 25, 2019 at 2:40 PM Matt Wilkie <map...@gmail.com> wrote:
Things I learned today.

When running `pip install --editable path/to/leo` the  "Installing build dependencies ..." step can take a loooong time. Apparently this is because it creates a copy of the folder tree including the `.git` folder, which can be quite large (ref). My machine right now: .git is 183 MB, while Leo is only 40 MB.

Thanks for this.  I'll make this a tip and a FAQ entry.

Edward

Matt Wilkie

unread,
Jul 31, 2019, 11:03:46 AM7/31/19
to leo-e...@googlegroups.com
The command shown only fetches master branch, and checkout of other branches will fail. Two solutions:

# add all remote branch names
# use 'devel' instead of '*' to get only devel branch
# quotes are significant
git remote set-branches origin '*'
git fetch
git checkout devel

Or:

# shallow clone each branch
git clone
--depth=nn --no-single-branch ...


Edward K. Ream

unread,
Jul 31, 2019, 1:50:26 PM7/31/19
to leo-editor
Noted.  I'll be adding a tip to LeoDocs.leo soon.
 
Reply all
Reply to author
Forward
0 new messages