Loading gitlab/base.py +2 −12 Original line number Diff line number Diff line Loading @@ -7,13 +7,7 @@ import pprint import textwrap from collections.abc import Iterable from types import ModuleType from typing import ( Any, ClassVar, Generic, TYPE_CHECKING, TypeVar, ) from typing import Any, ClassVar, Generic, TYPE_CHECKING, TypeVar import gitlab from gitlab import types as g_types Loading @@ -21,11 +15,7 @@ from gitlab.exceptions import GitlabParsingError from .client import Gitlab, GitlabList __all__ = [ "RESTObject", "RESTObjectList", "RESTManager", ] __all__ = ["RESTObject", "RESTObjectList", "RESTManager"] _URL_ATTRIBUTE_ERROR = ( Loading gitlab/cli.py +1 −8 Original line number Diff line number Diff line Loading @@ -8,14 +8,7 @@ import pathlib import re import sys from types import ModuleType from typing import ( Any, Callable, cast, NoReturn, TYPE_CHECKING, TypeVar, ) from typing import Any, Callable, cast, NoReturn, TYPE_CHECKING, TypeVar from requests.structures import CaseInsensitiveDict Loading gitlab/client.py +7 −25 Original line number Diff line number Diff line Loading @@ -4,12 +4,7 @@ from __future__ import annotations import os import re from typing import ( Any, BinaryIO, cast, TYPE_CHECKING, ) from typing import Any, BinaryIO, cast, TYPE_CHECKING from urllib import parse import requests Loading Loading @@ -952,11 +947,7 @@ class Gitlab: f"`get_all=False` to the `list()` call." ) show_caller = True utils.warn( message=message, category=UserWarning, show_caller=show_caller, ) utils.warn(message=message, category=UserWarning, show_caller=show_caller) return items def http_post( Loading Loading @@ -1097,12 +1088,7 @@ class Gitlab: post_data = post_data or {} result = self.http_request( "patch", path, query_data=query_data, post_data=post_data, raw=raw, **kwargs, "patch", path, query_data=query_data, post_data=post_data, raw=raw, **kwargs ) if result.status_code in gitlab.const.NO_JSON_RESPONSE_CODES: return result Loading Loading @@ -1383,13 +1369,11 @@ class GraphQL(_BaseGraphQL): if e.code == 401: raise gitlab.exceptions.GitlabAuthenticationError( response_code=e.code, error_message=str(e), response_code=e.code, error_message=str(e) ) raise gitlab.exceptions.GitlabHttpError( response_code=e.code, error_message=str(e), response_code=e.code, error_message=str(e) ) return result Loading Loading @@ -1459,13 +1443,11 @@ class AsyncGraphQL(_BaseGraphQL): if e.code == 401: raise gitlab.exceptions.GitlabAuthenticationError( response_code=e.code, error_message=str(e), response_code=e.code, error_message=str(e) ) raise gitlab.exceptions.GitlabHttpError( response_code=e.code, error_message=str(e), response_code=e.code, error_message=str(e) ) return result gitlab/config.py +1 −3 Original line number Diff line number Diff line Loading @@ -26,9 +26,7 @@ def _resolve_file(filepath: Path | str) -> str: return str(resolved) def _get_config_files( config_files: list[str] | None = None, ) -> str | list[str]: def _get_config_files(config_files: list[str] | None = None) -> str | list[str]: """ Return resolved path(s) to config files if they exist, with precedence: 1. Files passed in config_files Loading gitlab/mixins.py +3 −13 Original line number Diff line number Diff line Loading @@ -3,13 +3,7 @@ from __future__ import annotations import enum from collections.abc import Iterator from types import ModuleType from typing import ( Any, Callable, Literal, overload, TYPE_CHECKING, ) from typing import Any, Callable, Literal, overload, TYPE_CHECKING import requests Loading Loading @@ -261,9 +255,7 @@ class UpdateMixin(base.RESTManager[base.TObjCls]): # Update mixins attrs for easier implementation _update_method: UpdateMethod = UpdateMethod.PUT def _get_update_method( self, ) -> Callable[..., dict[str, Any] | requests.Response]: def _get_update_method(self) -> Callable[..., dict[str, Any] | requests.Response]: """Return the HTTP method to use. Returns: Loading Loading @@ -931,9 +923,7 @@ class PromoteMixin(_RestObjectBase): _update_method: UpdateMethod = UpdateMethod.PUT manager: base.RESTManager[Any] def _get_update_method( self, ) -> Callable[..., dict[str, Any] | requests.Response]: def _get_update_method(self) -> Callable[..., dict[str, Any] | requests.Response]: """Return the HTTP method to use. Returns: Loading Loading
gitlab/base.py +2 −12 Original line number Diff line number Diff line Loading @@ -7,13 +7,7 @@ import pprint import textwrap from collections.abc import Iterable from types import ModuleType from typing import ( Any, ClassVar, Generic, TYPE_CHECKING, TypeVar, ) from typing import Any, ClassVar, Generic, TYPE_CHECKING, TypeVar import gitlab from gitlab import types as g_types Loading @@ -21,11 +15,7 @@ from gitlab.exceptions import GitlabParsingError from .client import Gitlab, GitlabList __all__ = [ "RESTObject", "RESTObjectList", "RESTManager", ] __all__ = ["RESTObject", "RESTObjectList", "RESTManager"] _URL_ATTRIBUTE_ERROR = ( Loading
gitlab/cli.py +1 −8 Original line number Diff line number Diff line Loading @@ -8,14 +8,7 @@ import pathlib import re import sys from types import ModuleType from typing import ( Any, Callable, cast, NoReturn, TYPE_CHECKING, TypeVar, ) from typing import Any, Callable, cast, NoReturn, TYPE_CHECKING, TypeVar from requests.structures import CaseInsensitiveDict Loading
gitlab/client.py +7 −25 Original line number Diff line number Diff line Loading @@ -4,12 +4,7 @@ from __future__ import annotations import os import re from typing import ( Any, BinaryIO, cast, TYPE_CHECKING, ) from typing import Any, BinaryIO, cast, TYPE_CHECKING from urllib import parse import requests Loading Loading @@ -952,11 +947,7 @@ class Gitlab: f"`get_all=False` to the `list()` call." ) show_caller = True utils.warn( message=message, category=UserWarning, show_caller=show_caller, ) utils.warn(message=message, category=UserWarning, show_caller=show_caller) return items def http_post( Loading Loading @@ -1097,12 +1088,7 @@ class Gitlab: post_data = post_data or {} result = self.http_request( "patch", path, query_data=query_data, post_data=post_data, raw=raw, **kwargs, "patch", path, query_data=query_data, post_data=post_data, raw=raw, **kwargs ) if result.status_code in gitlab.const.NO_JSON_RESPONSE_CODES: return result Loading Loading @@ -1383,13 +1369,11 @@ class GraphQL(_BaseGraphQL): if e.code == 401: raise gitlab.exceptions.GitlabAuthenticationError( response_code=e.code, error_message=str(e), response_code=e.code, error_message=str(e) ) raise gitlab.exceptions.GitlabHttpError( response_code=e.code, error_message=str(e), response_code=e.code, error_message=str(e) ) return result Loading Loading @@ -1459,13 +1443,11 @@ class AsyncGraphQL(_BaseGraphQL): if e.code == 401: raise gitlab.exceptions.GitlabAuthenticationError( response_code=e.code, error_message=str(e), response_code=e.code, error_message=str(e) ) raise gitlab.exceptions.GitlabHttpError( response_code=e.code, error_message=str(e), response_code=e.code, error_message=str(e) ) return result
gitlab/config.py +1 −3 Original line number Diff line number Diff line Loading @@ -26,9 +26,7 @@ def _resolve_file(filepath: Path | str) -> str: return str(resolved) def _get_config_files( config_files: list[str] | None = None, ) -> str | list[str]: def _get_config_files(config_files: list[str] | None = None) -> str | list[str]: """ Return resolved path(s) to config files if they exist, with precedence: 1. Files passed in config_files Loading
gitlab/mixins.py +3 −13 Original line number Diff line number Diff line Loading @@ -3,13 +3,7 @@ from __future__ import annotations import enum from collections.abc import Iterator from types import ModuleType from typing import ( Any, Callable, Literal, overload, TYPE_CHECKING, ) from typing import Any, Callable, Literal, overload, TYPE_CHECKING import requests Loading Loading @@ -261,9 +255,7 @@ class UpdateMixin(base.RESTManager[base.TObjCls]): # Update mixins attrs for easier implementation _update_method: UpdateMethod = UpdateMethod.PUT def _get_update_method( self, ) -> Callable[..., dict[str, Any] | requests.Response]: def _get_update_method(self) -> Callable[..., dict[str, Any] | requests.Response]: """Return the HTTP method to use. Returns: Loading Loading @@ -931,9 +923,7 @@ class PromoteMixin(_RestObjectBase): _update_method: UpdateMethod = UpdateMethod.PUT manager: base.RESTManager[Any] def _get_update_method( self, ) -> Callable[..., dict[str, Any] | requests.Response]: def _get_update_method(self) -> Callable[..., dict[str, Any] | requests.Response]: """Return the HTTP method to use. Returns: Loading