-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
[Feat] g.extension: improved git support #625
Comments
Also (suggestion by Panos) support to install an add-on from a specific commit. |
Branch option implemented in: 1ed8b2c |
Backported to the upcoming GRASS GIS 7.8.5 in d3d71a0 |
New related issue reported in #1150 |
Since tagging will not be possible in grass-addons, we would like to refer to fixed commit to access an addon at a given timestamp. Example Would be
Would that be feasible? |
I see, that way you would get a "stable" version of an addon and exclude one possible point of failure... With the current approach using I looked a bit into alternatives to |
The following code (not fine tuned):
would download a given addon (here i.sentinel), through the GitHub API recursively (meaning all subdirectories in case of bundeled modules or for modules with libraries). I have not tested fully if the commit-reference works as expected That would remove dependencies to svn. The API could also be used instead of The downside is that it downloads each file individually and uncompressed. On my box with a decent internet connection, that is ~ 8 sec for i.sentinel, compared to ~ 5 sec when using svn export... That would however be a bigger change and requires sufficient discussion. Personally, I think the advantages of dropping |
@ninsbl I tested different things to download a single folder from github, but does not found one that is really faster than I have found a git alternative to svn export, but it takes much longer (45 sec instead of 7 or 8 sec):
|
@anikaweinmann , thanks for following up. IMHO, the two main arguments of e.g. switching to API download (instead of svn / git) are: If there are no major performance issues with API download, I would say those two reasons outweigh a few seconds in download time and a few bytes of additional network traffic, by far. i.sentinel is an addon collections with relatively many files and also images in the documentation. So they are in a way the worst case scenario for the API download. And here the performance difference is 4 sec (svn export) to 3-8 sec (API download). For smaller addons like e.g v.median, the difference is 2 (svn) to 1.5 (API), where my test included the start of the Python interpreter. So, API download may even give a performance gain (though tat is irrelevant given a) and b). The API download should probably be tested on a slower internet connection... |
@ninsbl would it be possible to add support for this? (at least for Python based addons): Example:
The code is there but with the GitHub style name scheme: |
This should work on Linux: |
Yes, sorry, I forgot to add that it doesn't work on Windows. |
Please see/consider also #376. |
Shouldn't this milestone be moved to 8.2? |
Here is how git command can be used to get an addon together with history of the code:
Or getting a version with a specific commit hash:
|
Is your feature request related to a problem? Please describe.
Since GRASS moved to git it would be nice to support more options to work with git repositories and more specifically, common git work flows. This includes:
With proxies some authentication is already supported and with switching from urllib to requests (g.extension: fix installation from gitlab repositories #624, see: https://requests.readthedocs.io/en/master/user/authentication/) also authentication via
.netrc
file is (probably) implemented (and thus just needs test and documentation). However, adding options for authentication explicitly might make it easier for users to use e.g. private repos...When providing the full download link to a zip file, people can already install AddOns from specific branches. That however requires some knowledge of the functions on git platforms (andsome extra steps to get the full URL). Just pointing to a repository URL fetches master by default. Should be relatively easy to implement...
If people have forks of the official repository, it would be nice to be able to install AddOns from branches in those repos for testing... This might require a flag or the like to indicate that the given URL represents a fork of the official repo...
Currently, installation from online resources is not tested. This should be added, at least for the most common options.
A short git section and mainly examples should do...
Describe the solution you'd like
Additional context
Aim would be to foster usage/development and contribution...
The text was updated successfully, but these errors were encountered: