-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace git
subprocess by pygit2
#1045
Comments
I like the idea of removing the prerequisite of having Git installed. But I stumbled over one caveat that is a blocker for me:
I don't use Windows, but I know many who do, and supporting SSH is quite important in our environment. |
But perhaps
I'm no laywer, but since both Apache v2+ and GPL v2+ are possible, I think it should be fine (mainly looking at Apache v2+ here). WDYT, @astrojuanlu? |
I'd suggest that we implement this with a fallback to the |
I havw no experience with either, but @pawamoy suggestion looks sensible enough! |
Just to be sure: is this issue open for pull requests then? Or is there more discussion needed? |
I think this can be split in 2. The 1st thing is to not require git. Copier can work with gitless templates. They have less features, but they work. Git should only be required when using a gitful template. If you want a gitful template, I can't imagine why would you not have git installed, so that could be the real fix here. If there are reasons why that can happen and still dulwitch works for us (copier uses git deeply and intensely), then replacing git is the 2nd part of the story. FWIW if we're about letting users use gitful templates without git, another option is to support templates in zip files. Also we can bundle git propagated in the nix package, so installing copier with nix just works out of the box. |
Related to #312. |
For reference, part (1) of @yajo's comment above (gh-312) was implemented in gh-1074 👍🏽 |
Maybe still there's work to do. See #1304. |
Is your feature request related to a problem? Please describe.
Now
copier
relies ongit
being installed in the system:copier/README.md
Line 25 in 47f3d59
However, it would be nice if all the dependencies could be installed with pip without having to reach for the system package manager. This would be useful for folks that don't have admin access to their systems, but can
pip install
to their user locations.Describe the solution you'd like
Replace subprocess calls to
git
throughplumbum
:copier/copier/main.py
Lines 801 to 811 in 47f3d59
with
pygit2
, the Python bindings forlibgit2
, which ship precompiled binary wheels for plenty of platforms:https://pypi.org/project/pygit2/1.11.1/#files
As a side effect, this will also probably be faster (but I don't have data to back this up).
Describe alternatives you've considered
Could not think of other alternatives.
Additional context
This was rejected for cookiecutter as early as 2016: cookiecutter/cookiecutter#846 (comment)
In Kedro we are trying to remove our dependency with system
git
kedro-org/kedro#2051 which prompted me to open this issue.The text was updated successfully, but these errors were encountered: