idiap_devtools.gitlab#
Utilities to interact with GitLab.
Functions
|
Downloads paths from gitlab, with an optional recurse. |
Returns an instance of the gitlab object for remote operations. |
- idiap_devtools.gitlab.get_gitlab_instance()[source]#
Returns an instance of the gitlab object for remote operations.
- Return type:
- idiap_devtools.gitlab.download_path(package, path, output=None, ref=None)[source]#
Downloads paths from gitlab, with an optional recurse.
This method will download an archive of the repository from chosen reference, and then it will search inside the zip blob for the path to be copied into output. It uses
zipfile.ZipFile
to do this search. This method will not be very efficient for larger repository references, but works recursively by default.- Parameters:
package (
Project
) – the gitlab package object to use (should be pre-fetched)path (
str
) – the path on the project to downloadoutput (
Optional
[Path
]) – where to place the path to be downloaded - if not provided, use the basename ofpath
as storage point with respect to the current directoryref (
Optional
[str
]) – the name of the git reference (branch, tag or commit hash) to use. If None specified, defaults to the default branch of the input package
- Return type: