Skip to content

Commit

Permalink
fix: fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tngraf committed Dec 8, 2023
1 parent 503c4dc commit cb92fe8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions sw360/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
# SPDX-License-Identifier: MIT
# -------------------------------------------------------------------------------

from typing import Any, Dict, List, Optional
import sys
from typing import Any, Dict, List, Optional, Union

import requests

Expand All @@ -18,9 +19,11 @@


class ComponentsMixin(BaseMixin):
# return type List[Dict[str, Any]] | Optional[Dict[str, Any]] for Python 3.11 is good,
# Union[List[Dict[str, Any]], Optional[Dict[str, Any]]] for lower Python versions is not good
def get_all_components(self, fields=None, page=-1, page_size=-1,
all_details: bool = False,
sort: str = "") -> List[Dict[str, Any]] | Optional[Dict[str, Any]]:
sort: str = "") -> Any:
"""Get information of about all components
API endpoint: GET /components
Expand Down
4 changes: 3 additions & 1 deletion sw360/releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ def get_releases_by_name(self, name: str) -> List[Any]:

return []

# return type List[Dict[str, Any]] | Optional[Dict[str, Any]] for Python 3.11 is good,
# Union[List[Dict[str, Any]], Optional[Dict[str, Any]]] for lower Python versions is not good
def get_all_releases(self, fields: str = "", all_details: bool = False, page: int = -1,
page_size: int = -1, sort: str = "") -> List[Dict[str, Any]] | Optional[Dict[str, Any]]:
page_size: int = -1, sort: str = "") -> Any:
"""Get information of about all releases
API endpoint: GET /releases
Expand Down

0 comments on commit cb92fe8

Please sign in to comment.