Skip to content

Commit

Permalink
chore: add type-hints to gitlab/v4/objects/sidekiq.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnVillalovos committed Nov 22, 2021
1 parent 8da0b75 commit a91a303
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
16 changes: 12 additions & 4 deletions gitlab/v4/objects/sidekiq.py
@@ -1,3 +1,7 @@
from typing import Any, Dict, Union

import requests

from gitlab import cli
from gitlab import exceptions as exc
from gitlab.base import RESTManager
Expand All @@ -16,7 +20,7 @@ class SidekiqManager(RESTManager):

@cli.register_custom_action("SidekiqManager")
@exc.on_http_error(exc.GitlabGetError)
def queue_metrics(self, **kwargs):
def queue_metrics(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]:
"""Return the registered queues information.
Args:
Expand All @@ -33,7 +37,9 @@ def queue_metrics(self, **kwargs):

@cli.register_custom_action("SidekiqManager")
@exc.on_http_error(exc.GitlabGetError)
def process_metrics(self, **kwargs):
def process_metrics(
self, **kwargs: Any
) -> Union[Dict[str, Any], requests.Response]:
"""Return the registered sidekiq workers.
Args:
Expand All @@ -50,7 +56,7 @@ def process_metrics(self, **kwargs):

@cli.register_custom_action("SidekiqManager")
@exc.on_http_error(exc.GitlabGetError)
def job_stats(self, **kwargs):
def job_stats(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]:
"""Return statistics about the jobs performed.
Args:
Expand All @@ -67,7 +73,9 @@ def job_stats(self, **kwargs):

@cli.register_custom_action("SidekiqManager")
@exc.on_http_error(exc.GitlabGetError)
def compound_metrics(self, **kwargs):
def compound_metrics(
self, **kwargs: Any
) -> Union[Dict[str, Any], requests.Response]:
"""Return all available metrics and statistics.
Args:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Expand Up @@ -14,7 +14,6 @@ module = [
"docs.ext.*",
"gitlab.v4.objects.files",
"gitlab.v4.objects.labels",
"gitlab.v4.objects.sidekiq",
"tests.functional.*",
"tests.functional.api.*",
"tests.meta.*",
Expand Down

0 comments on commit a91a303

Please sign in to comment.