Verified Commit 402573f7 authored by Adrian DC's avatar Adrian DC
Browse files

fix(gitlab): resolve new Python typings issues and warnings

Signed-off-by: default avatarAdrian DC <radian.dc@gmail.com>
parent 829b2df0
Loading
Loading
Loading
Loading
Loading
+5 −6
Changes for src/features/gitlab.py: 5 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -2,11 +2,10 @@

# Standard libraries
from time import sleep
from typing import cast, Dict, List, Optional, Union
from typing import Dict, List, Optional, Union

# Modules libraries
from gitlab import Gitlab
from gitlab.base import RESTObject, RESTObjectList
from gitlab.const import AccessLevel as GitLabAccessLevel
from gitlab.exceptions import (
    GitlabDeleteError,
@@ -126,7 +125,7 @@ class GitLabFeature:
    def group_get_labels(
        self,
        criteria: str,
    ) -> Union[RESTObjectList, List[RESTObject]]:
    ) -> List[GroupLabel]:

        # Get group labels
        group = self.group(criteria)
@@ -647,7 +646,7 @@ class GitLabFeature:
    def project_get_issues_boards(
        self,
        criteria: str,
    ) -> Union[RESTObjectList, List[RESTObject]]:
    ) -> List[ProjectBoard]:

        # Get project issues boards
        project = self.project(criteria)
@@ -657,7 +656,7 @@ class GitLabFeature:
    def project_get_labels(
        self,
        criteria: str,
    ) -> Union[RESTObjectList, List[RESTObject]]:
    ) -> List[ProjectLabel]:

        # Get project labels
        project = self.project(criteria)
@@ -974,7 +973,7 @@ class GitLabFeature:
    ) -> User:
        users = self.__gitlab.users.list(all=True, iterator=True, username=criteria)
        for user in users:
            return cast(User, user)
            return user
        raise RuntimeError(f'Could not find user {criteria}')

    # User name