buildinspace / peru

a generic package manager, for including other people's code in your projects
MIT License
1.11k stars 69 forks source link

use libgit2 via pygit2 instead of shelling out #8

Open oconnor663 opened 10 years ago

oconnor663 commented 10 years ago

The main blocker for this one is Cache.merge_trees(). We use the --prefix flag for git-read-tree, and libgit2 doesn't seem to support a similar feature. Tracking issue: https://github.com/libgit2/libgit2/issues/154 We could use the treebuilder feature to build a prefixed tree, and then use git_merge_trees() on that, but that function isn't exposed through pygit2 anyway.

Other features we need in pygit2 that we've already implemented: setting the working dir: https://github.com/oconnor663/pygit2/commit/a063867fe0e4506e29f22c45dd403d805e3fb1b7 setting a detatched HEAD: https://github.com/oconnor663/pygit2/commit/b190169f5e83cbdb2346acd52cea30e14a205eb5 EDIT: These were pushed as part of pygit2 v0.21.0 https://github.com/libgit2/pygit2/pull/377

oconnor663 commented 10 years ago

As of 25c8577c3e42417df04e260796efbd335a130458 (on my libgit2 branch), this is finished for Cache. It might be nice to replace the shellout code in tests too, since they will probably run a lot faster.

The real blocker here is the stability of libgit2 itself. I'm not sure how well we'll be able to package peru with a bleeding edge dependency.

oconnor663 commented 8 years ago

Note that PyYAML uses a bdist wheel. We could totally do this.