diff options
author | John L. Villalovos <john@sodarock.com> | 2021-11-06 21:33:07 -0700 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2021-11-08 07:21:17 -0800 |
commit | 7828ba2fd13c833c118a673bac09b215587ba33b (patch) | |
tree | 71312fe159fcc62ace0aeb24be94072ee4cf33cf /gitlab/v4/objects/packages.py | |
parent | 9a2f54cf044929dfc3fd89714ce657fa839e35d0 (diff) | |
download | gitlab-jlvillal/mypy_small_files_1.tar.gz |
chore: enforce type-hints on most files in gitlab/v4/objects/jlvillal/mypy_small_files_1
* Add type-hints to some of the files in gitlab/v4/objects/
* Fix issues detected when adding type-hints
* Changed mypy exclusion to explicitly list the 13 files that have
not yet had type-hints added.
Diffstat (limited to 'gitlab/v4/objects/packages.py')
-rw-r--r-- | gitlab/v4/objects/packages.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gitlab/v4/objects/packages.py b/gitlab/v4/objects/packages.py index d049d28..57f2f60 100644 --- a/gitlab/v4/objects/packages.py +++ b/gitlab/v4/objects/packages.py @@ -1,3 +1,9 @@ +""" +GitLab API: +https://docs.gitlab.com/ee/api/packages.html +https://docs.gitlab.com/ee/user/packages/generic_packages/ +""" + from pathlib import Path from typing import Any, Callable, Optional, TYPE_CHECKING, Union @@ -41,7 +47,7 @@ class GenericPackageManager(RESTManager): package_version: str, file_name: str, path: Union[str, Path], - **kwargs, + **kwargs: Any, ) -> GenericPackage: """Upload a file as a generic package. @@ -60,6 +66,8 @@ class GenericPackageManager(RESTManager): Returns: GenericPackage: An object storing the metadata of the uploaded package. + + https://docs.gitlab.com/ee/user/packages/generic_packages/ """ try: @@ -70,6 +78,8 @@ class GenericPackageManager(RESTManager): url = f"{self._computed_path}/{package_name}/{package_version}/{file_name}" server_data = self.gitlab.http_put(url, post_data=file_data, raw=True, **kwargs) + if TYPE_CHECKING: + assert isinstance(server_data, dict) return self._obj_cls( self, |