summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects/packages.py
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-11-24 01:36:48 +0100
committerNejc Habjan <hab.nejc@gmail.com>2021-11-24 01:36:48 +0100
commit81a392ca6e9b44444c0f1287139abe788d50119d (patch)
tree97e0f03be6f8819cb9b8a5dd0d46432ff6dfc5a4 /gitlab/v4/objects/packages.py
parent7ba5995ed472997e6bf98e8ae58107af307a5615 (diff)
downloadgitlab-chore/sphinx-annotations.tar.gz
chore: deduplicate type annotations in docschore/sphinx-annotations
Diffstat (limited to 'gitlab/v4/objects/packages.py')
-rw-r--r--gitlab/v4/objects/packages.py46
1 files changed, 23 insertions, 23 deletions
diff --git a/gitlab/v4/objects/packages.py b/gitlab/v4/objects/packages.py
index 0062067..9aa496c 100644
--- a/gitlab/v4/objects/packages.py
+++ b/gitlab/v4/objects/packages.py
@@ -52,12 +52,12 @@ class GenericPackageManager(RESTManager):
"""Upload a file as a generic package.
Args:
- package_name (str): The package name. Must follow generic package
+ package_name: The package name. Must follow generic package
name regex rules
- package_version (str): The package version. Must follow semantic
+ package_version: The package version. Must follow semantic
version regex rules
- file_name (str): The name of the file as uploaded in the registry
- path (str): The path to a local file to upload
+ file_name: The name of the file as uploaded in the registry
+ path: The path to a local file to upload
Raises:
GitlabConnectionError: If the server cannot be reached
@@ -65,7 +65,7 @@ class GenericPackageManager(RESTManager):
GitlabUploadError: If ``filepath`` cannot be read
Returns:
- GenericPackage: An object storing the metadata of the uploaded package.
+ An object storing the metadata of the uploaded package.
https://docs.gitlab.com/ee/user/packages/generic_packages/
"""
@@ -109,24 +109,24 @@ class GenericPackageManager(RESTManager):
) -> Optional[bytes]:
"""Download a generic package.
- Args:
- package_name (str): The package name.
- package_version (str): The package version.
- file_name (str): The name of the file in the registry
- streamed (bool): If True the data will be processed by chunks of
- `chunk_size` and each chunk is passed to `action` for
- treatment
- action (callable): Callable responsible of dealing with chunk of
- data
- chunk_size (int): Size of each chunk
- **kwargs: Extra options to send to the server (e.g. sudo)
-
- Raises:
- GitlabAuthenticationError: If authentication is not correct
- GitlabGetError: If the server failed to perform the request
-
- Returns:
- str: The package content if streamed is False, None otherwise
+ Args:
+ package_name: The package name.
+ package_version: The package version.
+ file_name: The name of the file in the registry
+ streamed: If True the data will be processed by chunks of
+ `chunk_size` and each chunk is passed to `action` for
+ treatment
+ action (callable): Callable responsible of dealing with chunk of
+ data
+ chunk_size: Size of each chunk
+ **kwargs: Extra options to send to the server (e.g. sudo)
+
+ Raises:
+ GitlabAuthenticationError: If authentication is not correct
+ GitlabGetError: If the server failed to perform the request
+
+ Returns:
+ The package content if streamed is False, None otherwise
"""
path = f"{self._computed_path}/{package_name}/{package_version}/{file_name}"
result = self.gitlab.http_get(path, streamed=streamed, raw=True, **kwargs)