summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2022-01-03 22:11:46 -0800
committerJohn L. Villalovos <john@sodarock.com>2022-01-03 22:11:46 -0800
commit6b3e7c0f5f77baed94cc807b7087feaaf0fac121 (patch)
treea9d8d3b3f04b072e6707f775861e1835e94afc8d
parent789122d5df9b4f39331e23c7fdb6e9021e7836cf (diff)
downloadgitlab-jlvillal/relative_imports.tar.gz
chore: convert to using relative importsjlvillal/relative_imports
Switch to using relative imports to ensure that we are importing from within our library. Also use the form: from foo import bar as bar When we want to signify that we want the import to be re-exported. https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-no-implicit-reexport
-rw-r--r--gitlab/__init__.py27
-rw-r--r--gitlab/__main__.py4
-rw-r--r--gitlab/base.py11
-rw-r--r--gitlab/cli.py22
-rw-r--r--gitlab/client.py50
-rw-r--r--gitlab/config.py2
-rw-r--r--gitlab/mixins.py31
-rw-r--r--gitlab/v4/cli.py78
-rw-r--r--gitlab/v4/objects/access_requests.py4
-rw-r--r--gitlab/v4/objects/appearance.py6
-rw-r--r--gitlab/v4/objects/applications.py4
-rw-r--r--gitlab/v4/objects/audit_events.py4
-rw-r--r--gitlab/v4/objects/award_emojis.py4
-rw-r--r--gitlab/v4/objects/badges.py4
-rw-r--r--gitlab/v4/objects/boards.py4
-rw-r--r--gitlab/v4/objects/branches.py4
-rw-r--r--gitlab/v4/objects/broadcast_messages.py4
-rw-r--r--gitlab/v4/objects/clusters.py6
-rw-r--r--gitlab/v4/objects/commits.py9
-rw-r--r--gitlab/v4/objects/container_registry.py8
-rw-r--r--gitlab/v4/objects/custom_attributes.py4
-rw-r--r--gitlab/v4/objects/deploy_keys.py8
-rw-r--r--gitlab/v4/objects/deploy_tokens.py6
-rw-r--r--gitlab/v4/objects/deployments.py5
-rw-r--r--gitlab/v4/objects/discussions.py5
-rw-r--r--gitlab/v4/objects/environments.py8
-rw-r--r--gitlab/v4/objects/epics.py9
-rw-r--r--gitlab/v4/objects/events.py4
-rw-r--r--gitlab/v4/objects/export_import.py4
-rw-r--r--gitlab/v4/objects/features.py8
-rw-r--r--gitlab/v4/objects/files.py10
-rw-r--r--gitlab/v4/objects/geo_nodes.py8
-rw-r--r--gitlab/v4/objects/groups.py14
-rw-r--r--gitlab/v4/objects/hooks.py4
-rw-r--r--gitlab/v4/objects/issues.py11
-rw-r--r--gitlab/v4/objects/jobs.py10
-rw-r--r--gitlab/v4/objects/keys.py4
-rw-r--r--gitlab/v4/objects/labels.py6
-rw-r--r--gitlab/v4/objects/ldap.py4
-rw-r--r--gitlab/v4/objects/members.py6
-rw-r--r--gitlab/v4/objects/merge_request_approvals.py6
-rw-r--r--gitlab/v4/objects/merge_requests.py16
-rw-r--r--gitlab/v4/objects/merge_trains.py4
-rw-r--r--gitlab/v4/objects/milestones.py11
-rw-r--r--gitlab/v4/objects/namespaces.py4
-rw-r--r--gitlab/v4/objects/notes.py5
-rw-r--r--gitlab/v4/objects/notification_settings.py4
-rw-r--r--gitlab/v4/objects/packages.py10
-rw-r--r--gitlab/v4/objects/pages.py4
-rw-r--r--gitlab/v4/objects/personal_access_tokens.py4
-rw-r--r--gitlab/v4/objects/pipelines.py8
-rw-r--r--gitlab/v4/objects/project_access_tokens.py4
-rw-r--r--gitlab/v4/objects/projects.py11
-rw-r--r--gitlab/v4/objects/push_rules.py4
-rw-r--r--gitlab/v4/objects/releases.py4
-rw-r--r--gitlab/v4/objects/repositories.py13
-rw-r--r--gitlab/v4/objects/runners.py10
-rw-r--r--gitlab/v4/objects/services.py6
-rw-r--r--gitlab/v4/objects/settings.py8
-rw-r--r--gitlab/v4/objects/sidekiq.py6
-rw-r--r--gitlab/v4/objects/snippets.py11
-rw-r--r--gitlab/v4/objects/statistics.py4
-rw-r--r--gitlab/v4/objects/tags.py4
-rw-r--r--gitlab/v4/objects/templates.py4
-rw-r--r--gitlab/v4/objects/todos.py8
-rw-r--r--gitlab/v4/objects/triggers.py4
-rw-r--r--gitlab/v4/objects/users.py11
-rw-r--r--gitlab/v4/objects/variables.py4
-rw-r--r--gitlab/v4/objects/wikis.py4
69 files changed, 301 insertions, 319 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py
index be1794a..e354354 100644
--- a/gitlab/__init__.py
+++ b/gitlab/__init__.py
@@ -19,17 +19,18 @@
import warnings
from typing import Any
-import gitlab.config # noqa: F401
-from gitlab.version import ( # noqa: F401
- __author__,
- __copyright__,
- __email__,
- __license__,
- __title__,
- __version__,
-)
-from gitlab.client import Gitlab, GitlabList # noqa: F401
-from gitlab.exceptions import * # noqa: F401,F403
+from . import config as config # noqa: F401
+from . import const as const
+from . import exceptions as exceptions # noqa: F401
+from .client import Gitlab as Gitlab # noqa: F401
+from .client import GitlabList as GitlabList # noqa: F401
+from .exceptions import * # noqa: F401,F403
+from .version import __author__ as __author__ # noqa: F401
+from .version import __copyright__ as __copyright__ # noqa: F401
+from .version import __email__ as __email__ # noqa: F401
+from .version import __license__ as __license__ # noqa: F401
+from .version import __title__ as __title__ # noqa: F401
+from .version import __version__ as __version__ # noqa: F401
warnings.filterwarnings("default", category=DeprecationWarning, module="^gitlab")
@@ -39,12 +40,12 @@ warnings.filterwarnings("default", category=DeprecationWarning, module="^gitlab"
# 'from gitlab.const import *' statement.
def __getattr__(name: str) -> Any:
# Deprecate direct access to constants without namespace
- if name in gitlab.const._DEPRECATED:
+ if name in const._DEPRECATED:
warnings.warn(
f"\nDirect access to 'gitlab.{name}' is deprecated and will be "
f"removed in a future major python-gitlab release. Please "
f"use 'gitlab.const.{name}' instead.",
DeprecationWarning,
)
- return getattr(gitlab.const, name)
+ return getattr(const, name)
raise AttributeError(f"module {__name__} has no attribute {name}")
diff --git a/gitlab/__main__.py b/gitlab/__main__.py
index e1a914c..a4912bc 100644
--- a/gitlab/__main__.py
+++ b/gitlab/__main__.py
@@ -1,4 +1,4 @@
-import gitlab.cli
+from . import cli
if __name__ == "__main__":
- gitlab.cli.main()
+ cli.main()
diff --git a/gitlab/base.py b/gitlab/base.py
index 50f09c5..8b97bfd 100644
--- a/gitlab/base.py
+++ b/gitlab/base.py
@@ -20,11 +20,10 @@ import textwrap
from types import ModuleType
from typing import Any, Dict, Iterable, NamedTuple, Optional, Tuple, Type
-import gitlab
-from gitlab import types as g_types
-from gitlab.exceptions import GitlabParsingError
-
from .client import Gitlab, GitlabList
+from .exceptions import GitlabParsingError
+from .types import GitlabAttribute
+from .version import __version__
__all__ = [
"RequiredOptional",
@@ -35,7 +34,7 @@ __all__ = [
_URL_ATTRIBUTE_ERROR = (
- f"https://python-gitlab.readthedocs.io/en/{gitlab.__version__}/"
+ f"https://python-gitlab.readthedocs.io/en/{__version__}/"
f"faq.html#attribute-error-list"
)
@@ -317,7 +316,7 @@ class RESTManager(object):
_path: Optional[str] = None
_obj_cls: Optional[Type[RESTObject]] = None
_from_parent_attrs: Dict[str, Any] = {}
- _types: Dict[str, Type[g_types.GitlabAttribute]] = {}
+ _types: Dict[str, Type[GitlabAttribute]] = {}
_computed_path: Optional[str]
_parent: Optional[RESTObject]
diff --git a/gitlab/cli.py b/gitlab/cli.py
index a48b53b..a9af068 100644
--- a/gitlab/cli.py
+++ b/gitlab/cli.py
@@ -27,8 +27,10 @@ from typing import Any, Callable, cast, Dict, Optional, Tuple, Type, TypeVar, Un
from requests.structures import CaseInsensitiveDict
-import gitlab.config
-from gitlab.base import RESTObject
+from . import __version__
+from . import config as gl_config
+from .base import RESTObject
+from .client import Gitlab
# This regex is based on:
# https://github.com/jpvanhal/inflection/blob/master/inflection/__init__.py
@@ -246,10 +248,10 @@ def _get_base_parser(add_help: bool = True) -> argparse.ArgumentParser:
def _get_parser() -> argparse.ArgumentParser:
# NOTE: We must delay import of gitlab.v4.cli until now or
# otherwise it will cause circular import errors
- import gitlab.v4.cli
+ from .v4 import cli
parser = _get_base_parser()
- return gitlab.v4.cli.extend_parser(parser)
+ return cli.extend_parser(parser)
def _parse_value(v: Any) -> Any:
@@ -279,7 +281,7 @@ def docs() -> argparse.ArgumentParser: # pragma: no cover
def main() -> None:
if "--version" in sys.argv:
- print(gitlab.__version__)
+ print(__version__)
sys.exit(0)
parser = _get_base_parser(add_help=False)
@@ -289,8 +291,8 @@ def main() -> None:
# any subparser setup
(options, _) = parser.parse_known_args(sys.argv)
try:
- config = gitlab.config.GitlabConfigParser(options.gitlab, options.config_file)
- except gitlab.config.ConfigError as e:
+ config = gl_config.GitlabConfigParser(options.gitlab, options.config_file)
+ except gl_config.ConfigError as e:
if "--help" in sys.argv or "-h" in sys.argv:
parser.print_help()
sys.exit(0)
@@ -346,7 +348,7 @@ def main() -> None:
args_dict = {k: _parse_value(v) for k, v in args_dict.items() if v is not None}
try:
- gl = gitlab.Gitlab.merge_config(vars(options), gitlab_id, config_files)
+ gl = Gitlab.merge_config(vars(options), gitlab_id, config_files)
if gl.private_token or gl.oauth_token:
gl.auth()
except Exception as e:
@@ -355,4 +357,6 @@ def main() -> None:
if debug:
gl.enable_debug()
- gitlab.v4.cli.run(gl, what, action, args_dict, verbose, output, fields)
+ from .v4 import cli
+
+ cli.run(gl, what, action, args_dict, verbose, output, fields)
diff --git a/gitlab/client.py b/gitlab/client.py
index b791c8f..6eccb50 100644
--- a/gitlab/client.py
+++ b/gitlab/client.py
@@ -24,10 +24,8 @@ import requests
import requests.utils
from requests_toolbelt.multipart.encoder import MultipartEncoder # type: ignore
-import gitlab.config
-import gitlab.const
-import gitlab.exceptions
-from gitlab import utils
+from . import config as gl_config
+from . import const, exceptions, utils
REDIRECT_MSG = (
"python-gitlab detected a {status_code} ({reason!r}) redirection. You must update "
@@ -73,7 +71,7 @@ class Gitlab(object):
per_page: Optional[int] = None,
pagination: Optional[str] = None,
order_by: Optional[str] = None,
- user_agent: str = gitlab.const.USER_AGENT,
+ user_agent: str = const.USER_AGENT,
retry_transient_errors: bool = False,
) -> None:
@@ -110,9 +108,9 @@ class Gitlab(object):
raise ModuleNotFoundError(name=f"gitlab.v{self._api_version}.objects")
# NOTE: We must delay import of gitlab.v4.objects until now or
# otherwise it will cause circular import errors
- import gitlab.v4.objects
+ from .v4 import objects as v4_objects
- objects = gitlab.v4.objects
+ objects = v4_objects
self._objects = objects
self.broadcastmessages = objects.BroadcastMessageManager(self)
@@ -202,9 +200,9 @@ class Gitlab(object):
raise ModuleNotFoundError(name=f"gitlab.v{self._api_version}.objects")
# NOTE: We must delay import of gitlab.v4.objects until now or
# otherwise it will cause circular import errors
- import gitlab.v4.objects
+ from .v4 import objects as v4_objects
- self._objects = gitlab.v4.objects
+ self._objects = v4_objects
@property
def url(self) -> str:
@@ -237,7 +235,7 @@ class Gitlab(object):
Raises:
gitlab.config.GitlabDataError: If the configuration is not correct.
"""
- config = gitlab.config.GitlabConfigParser(
+ config = gl_config.GitlabConfigParser(
gitlab_id=gitlab_id, config_files=config_files
)
return cls(
@@ -287,14 +285,14 @@ class Gitlab(object):
Raises:
gitlab.config.GitlabDataError: If the configuration is not correct.
"""
- config = gitlab.config.GitlabConfigParser(
+ config = gl_config.GitlabConfigParser(
gitlab_id=gitlab_id, config_files=config_files
)
url = (
options.get("server_url")
or config.url
or os.getenv("CI_SERVER_URL")
- or gitlab.const.DEFAULT_URL
+ or const.DEFAULT_URL
)
private_token, oauth_token, job_token = cls._merge_auth(options, config)
@@ -313,7 +311,7 @@ class Gitlab(object):
)
@staticmethod
- def _merge_auth(options: dict, config: gitlab.config.GitlabConfigParser) -> Tuple:
+ def _merge_auth(options: dict, config: gl_config.GitlabConfigParser) -> Tuple:
"""
Return a tuple where at most one of 3 token types ever has a value.
Since multiple types of tokens may be present in the environment,
@@ -371,7 +369,7 @@ class Gitlab(object):
return cast(str, self._server_version), cast(str, self._server_revision)
- @gitlab.exceptions.on_http_error(gitlab.exceptions.GitlabVerifyError)
+ @exceptions.on_http_error(exceptions.GitlabVerifyError)
def lint(self, content: str, **kwargs: Any) -> Tuple[bool, List[str]]:
"""Validate a gitlab CI configuration.
@@ -392,7 +390,7 @@ class Gitlab(object):
assert not isinstance(data, requests.Response)
return (data["status"] == "valid", data["errors"])
- @gitlab.exceptions.on_http_error(gitlab.exceptions.GitlabMarkdownError)
+ @exceptions.on_http_error(exceptions.GitlabMarkdownError)
def markdown(
self, text: str, gfm: bool = False, project: Optional[str] = None, **kwargs: Any
) -> str:
@@ -419,7 +417,7 @@ class Gitlab(object):
assert not isinstance(data, requests.Response)
return data["html"]
- @gitlab.exceptions.on_http_error(gitlab.exceptions.GitlabLicenseError)
+ @exceptions.on_http_error(exceptions.GitlabLicenseError)
def get_license(self, **kwargs: Any) -> Dict[str, Any]:
"""Retrieve information about the current license.
@@ -438,7 +436,7 @@ class Gitlab(object):
return result
return {}
- @gitlab.exceptions.on_http_error(gitlab.exceptions.GitlabLicenseError)
+ @exceptions.on_http_error(exceptions.GitlabLicenseError)
def set_license(self, license: str, **kwargs: Any) -> Dict[str, Any]:
"""Add a new license.
@@ -529,7 +527,7 @@ class Gitlab(object):
The base URL
"""
if not url:
- return gitlab.const.DEFAULT_URL
+ return const.DEFAULT_URL
return url.rstrip("/")
@@ -563,7 +561,7 @@ class Gitlab(object):
if item.request.method == "GET":
continue
target = item.headers.get("location")
- raise gitlab.exceptions.RedirectError(
+ raise exceptions.RedirectError(
REDIRECT_MSG.format(
status_code=item.status_code,
reason=item.reason,
@@ -718,13 +716,13 @@ class Gitlab(object):
pass
if result.status_code == 401:
- raise gitlab.exceptions.GitlabAuthenticationError(
+ raise exceptions.GitlabAuthenticationError(
response_code=result.status_code,
error_message=error_message,
response_body=result.content,
)
- raise gitlab.exceptions.GitlabHttpError(
+ raise exceptions.GitlabHttpError(
response_code=result.status_code,
error_message=error_message,
response_body=result.content,
@@ -770,7 +768,7 @@ class Gitlab(object):
try:
return result.json()
except Exception as e:
- raise gitlab.exceptions.GitlabParsingError(
+ raise exceptions.GitlabParsingError(
error_message="Failed to parse the server message"
) from e
else:
@@ -867,7 +865,7 @@ class Gitlab(object):
if result.headers.get("Content-Type", None) == "application/json":
return result.json()
except Exception as e:
- raise gitlab.exceptions.GitlabParsingError(
+ raise exceptions.GitlabParsingError(
error_message="Failed to parse the server message"
) from e
return result
@@ -915,7 +913,7 @@ class Gitlab(object):
try:
return result.json()
except Exception as e:
- raise gitlab.exceptions.GitlabParsingError(
+ raise exceptions.GitlabParsingError(
error_message="Failed to parse the server message"
) from e
@@ -935,7 +933,7 @@ class Gitlab(object):
"""
return self.http_request("delete", path, **kwargs)
- @gitlab.exceptions.on_http_error(gitlab.exceptions.GitlabSearchError)
+ @exceptions.on_http_error(exceptions.GitlabSearchError)
def search(
self, scope: str, search: str, **kwargs: Any
) -> Union["GitlabList", List[Dict[str, Any]]]:
@@ -1009,7 +1007,7 @@ class GitlabList(object):
try:
self._data: List[Dict[str, Any]] = result.json()
except Exception as e:
- raise gitlab.exceptions.GitlabParsingError(
+ raise exceptions.GitlabParsingError(
error_message="Failed to parse the server message"
) from e
diff --git a/gitlab/config.py b/gitlab/config.py
index c11a4e9..290af88 100644
--- a/gitlab/config.py
+++ b/gitlab/config.py
@@ -23,7 +23,7 @@ from os.path import expanduser, expandvars
from pathlib import Path
from typing import List, Optional, Union
-from gitlab.const import USER_AGENT
+from .const import USER_AGENT
_DEFAULT_FILES: List[str] = [
"/etc/python-gitlab.cfg",
diff --git a/gitlab/mixins.py b/gitlab/mixins.py
index 1abffa1..250faab 100644
--- a/gitlab/mixins.py
+++ b/gitlab/mixins.py
@@ -30,11 +30,10 @@ from typing import (
import requests
-import gitlab
-from gitlab import base, cli
-from gitlab import exceptions as exc
-from gitlab import types as g_types
-from gitlab import utils
+from . import base, cli, client, const
+from . import exceptions as exc
+from . import types as g_types
+from . import utils
__all__ = [
"GetMixin",
@@ -77,7 +76,7 @@ class GetMixin(_RestManagerBase):
_parent: Optional[base.RESTObject]
_parent_attrs: Dict[str, Any]
_path: Optional[str]
- gitlab: gitlab.Gitlab
+ gitlab: client.Gitlab
@exc.on_http_error(exc.GitlabGetError)
def get(
@@ -122,7 +121,7 @@ class GetWithoutIdMixin(_RestManagerBase):
_parent: Optional[base.RESTObject]
_parent_attrs: Dict[str, Any]
_path: Optional[str]
- gitlab: gitlab.Gitlab
+ gitlab: client.Gitlab
@exc.on_http_error(exc.GitlabGetError)
def get(
@@ -192,7 +191,7 @@ class ListMixin(_RestManagerBase):
_parent: Optional[base.RESTObject]
_parent_attrs: Dict[str, Any]
_path: Optional[str]
- gitlab: gitlab.Gitlab
+ gitlab: client.Gitlab
@exc.on_http_error(exc.GitlabListError)
def list(self, **kwargs: Any) -> Union[base.RESTObjectList, List[base.RESTObject]]:
@@ -252,7 +251,7 @@ class RetrieveMixin(ListMixin, GetMixin):
_parent: Optional[base.RESTObject]
_parent_attrs: Dict[str, Any]
_path: Optional[str]
- gitlab: gitlab.Gitlab
+ gitlab: client.Gitlab
pass
@@ -264,7 +263,7 @@ class CreateMixin(_RestManagerBase):
_parent: Optional[base.RESTObject]
_parent_attrs: Dict[str, Any]
_path: Optional[str]
- gitlab: gitlab.Gitlab
+ gitlab: client.Gitlab
def _check_missing_create_attrs(self, data: Dict[str, Any]) -> None:
missing = []
@@ -333,7 +332,7 @@ class UpdateMixin(_RestManagerBase):
_parent_attrs: Dict[str, Any]
_path: Optional[str]
_update_uses_post: bool = False
- gitlab: gitlab.Gitlab
+ gitlab: client.Gitlab
def _check_missing_update_attrs(self, data: Dict[str, Any]) -> None:
if TYPE_CHECKING:
@@ -426,7 +425,7 @@ class SetMixin(_RestManagerBase):
_parent: Optional[base.RESTObject]
_parent_attrs: Dict[str, Any]
_path: Optional[str]
- gitlab: gitlab.Gitlab
+ gitlab: client.Gitlab
@exc.on_http_error(exc.GitlabSetError)
def set(self, key: str, value: str, **kwargs: Any) -> base.RESTObject:
@@ -460,7 +459,7 @@ class DeleteMixin(_RestManagerBase):
_parent: Optional[base.RESTObject]
_parent_attrs: Dict[str, Any]
_path: Optional[str]
- gitlab: gitlab.Gitlab
+ gitlab: client.Gitlab
@exc.on_http_error(exc.GitlabDeleteError)
def delete(self, id: Union[str, int], **kwargs: Any) -> None:
@@ -490,7 +489,7 @@ class CRUDMixin(GetMixin, ListMixin, CreateMixin, UpdateMixin, DeleteMixin):
_parent: Optional[base.RESTObject]
_parent_attrs: Dict[str, Any]
_path: Optional[str]
- gitlab: gitlab.Gitlab
+ gitlab: client.Gitlab
pass
@@ -502,7 +501,7 @@ class NoUpdateMixin(GetMixin, ListMixin, CreateMixin, DeleteMixin):
_parent: Optional[base.RESTObject]
_parent_attrs: Dict[str, Any]
_path: Optional[str]
- gitlab: gitlab.Gitlab
+ gitlab: client.Gitlab
pass
@@ -618,7 +617,7 @@ class AccessRequestMixin(_RestObjectBase):
)
@exc.on_http_error(exc.GitlabUpdateError)
def approve(
- self, access_level: int = gitlab.const.DEVELOPER_ACCESS, **kwargs: Any
+ self, access_level: int = const.DEVELOPER_ACCESS, **kwargs: Any
) -> None:
"""Approve an access request.
diff --git a/gitlab/v4/cli.py b/gitlab/v4/cli.py
index 675f93a..4f9dce9 100644
--- a/gitlab/v4/cli.py
+++ b/gitlab/v4/cli.py
@@ -21,32 +21,28 @@ import operator
import sys
from typing import Any, Dict, List, Optional, Type, TYPE_CHECKING, Union
-import gitlab
-import gitlab.base
-import gitlab.v4.objects
-from gitlab import cli
+from .. import base, cli, client, mixins
+from . import objects as v4_objects
class GitlabCLI(object):
def __init__(
- self, gl: gitlab.Gitlab, what: str, action: str, args: Dict[str, str]
+ self, gl: client.Gitlab, what: str, action: str, args: Dict[str, str]
) -> None:
- self.cls: Type[gitlab.base.RESTObject] = cli.what_to_cls(
- what, namespace=gitlab.v4.objects
- )
+ self.cls: Type[base.RESTObject] = cli.what_to_cls(what, namespace=v4_objects)
self.cls_name = self.cls.__name__
self.what = what.replace("-", "_")
self.action = action.lower()
self.gl = gl
self.args = args
self.mgr_cls: Union[
- Type[gitlab.mixins.CreateMixin],
- Type[gitlab.mixins.DeleteMixin],
- Type[gitlab.mixins.GetMixin],
- Type[gitlab.mixins.GetWithoutIdMixin],
- Type[gitlab.mixins.ListMixin],
- Type[gitlab.mixins.UpdateMixin],
- ] = getattr(gitlab.v4.objects, f"{self.cls.__name__}Manager")
+ Type[mixins.CreateMixin],
+ Type[mixins.DeleteMixin],
+ Type[mixins.GetMixin],
+ Type[mixins.GetWithoutIdMixin],
+ Type[mixins.ListMixin],
+ Type[mixins.UpdateMixin],
+ ] = getattr(v4_objects, f"{self.cls.__name__}Manager")
# We could do something smart, like splitting the manager name to find
# parents, build the chain of managers to get to the final object.
# Instead we do something ugly and efficient: interpolate variables in
@@ -86,7 +82,7 @@ class GitlabCLI(object):
if self.mgr._from_parent_attrs:
for k in self.mgr._from_parent_attrs:
data[k] = self.args[k]
- if not issubclass(self.cls, gitlab.mixins.GetWithoutIdMixin):
+ if not issubclass(self.cls, mixins.GetWithoutIdMixin):
if TYPE_CHECKING:
assert isinstance(self.cls._id_attr, str)
data[self.cls._id_attr] = self.args.pop(self.cls._id_attr)
@@ -110,9 +106,9 @@ class GitlabCLI(object):
except Exception as e:
cli.die("Impossible to download the export", e)
- def do_create(self) -> gitlab.base.RESTObject:
+ def do_create(self) -> base.RESTObject:
if TYPE_CHECKING:
- assert isinstance(self.mgr, gitlab.mixins.CreateMixin)
+ assert isinstance(self.mgr, mixins.CreateMixin)
try:
result = self.mgr.create(self.args)
except Exception as e:
@@ -121,17 +117,17 @@ class GitlabCLI(object):
def do_list(
self,
- ) -> Union[gitlab.base.RESTObjectList, List[gitlab.base.RESTObject]]:
+ ) -> Union[base.RESTObjectList, List[base.RESTObject]]:
if TYPE_CHECKING:
- assert isinstance(self.mgr, gitlab.mixins.ListMixin)
+ assert isinstance(self.mgr, mixins.ListMixin)
try:
result = self.mgr.list(**self.args)
except Exception as e:
cli.die("Impossible to list objects", e)
return result
- def do_get(self) -> Optional[gitlab.base.RESTObject]:
- if isinstance(self.mgr, gitlab.mixins.GetWithoutIdMixin):
+ def do_get(self) -> Optional[base.RESTObject]:
+ if isinstance(self.mgr, mixins.GetWithoutIdMixin):
try:
result = self.mgr.get(id=None, **self.args)
except Exception as e:
@@ -139,7 +135,7 @@ class GitlabCLI(object):
return result
if TYPE_CHECKING:
- assert isinstance(self.mgr, gitlab.mixins.GetMixin)
+ assert isinstance(self.mgr, mixins.GetMixin)
assert isinstance(self.cls._id_attr, str)
id = self.args.pop(self.cls._id_attr)
@@ -151,7 +147,7 @@ class GitlabCLI(object):
def do_delete(self) -> None:
if TYPE_CHECKING:
- assert isinstance(self.mgr, gitlab.mixins.DeleteMixin)
+ assert isinstance(self.mgr, mixins.DeleteMixin)
assert isinstance(self.cls._id_attr, str)
id = self.args.pop(self.cls._id_attr)
try:
@@ -161,8 +157,8 @@ class GitlabCLI(object):
def do_update(self) -> Dict[str, Any]:
if TYPE_CHECKING:
- assert isinstance(self.mgr, gitlab.mixins.UpdateMixin)
- if issubclass(self.mgr_cls, gitlab.mixins.GetWithoutIdMixin):
+ assert isinstance(self.mgr, mixins.UpdateMixin)
+ if issubclass(self.mgr_cls, mixins.GetWithoutIdMixin):
id = None
else:
if TYPE_CHECKING:
@@ -177,10 +173,10 @@ class GitlabCLI(object):
def _populate_sub_parser_by_class(
- cls: Type[gitlab.base.RESTObject], sub_parser: argparse._SubParsersAction
+ cls: Type[base.RESTObject], sub_parser: argparse._SubParsersAction
) -> None:
mgr_cls_name = f"{cls.__name__}Manager"
- mgr_cls = getattr(gitlab.v4.objects, mgr_cls_name)
+ mgr_cls = getattr(v4_objects, mgr_cls_name)
for action_name in ["list", "get", "create", "update", "delete"]:
if not hasattr(mgr_cls, action_name):
@@ -210,7 +206,7 @@ def _populate_sub_parser_by_class(
sub_parser_action.add_argument(f"--{id_attr}", required=True)
if action_name == "get":
- if not issubclass(cls, gitlab.mixins.GetWithoutIdMixin):
+ if not issubclass(cls, mixins.GetWithoutIdMixin):
if cls._id_attr is not None:
id_attr = cls._id_attr.replace("_", "-")
sub_parser_action.add_argument(f"--{id_attr}", required=True)
@@ -260,7 +256,7 @@ def _populate_sub_parser_by_class(
sub_parser_action.add_argument("--sudo", required=False)
# We need to get the object somehow
- if not issubclass(cls, gitlab.mixins.GetWithoutIdMixin):
+ if not issubclass(cls, mixins.GetWithoutIdMixin):
if cls._id_attr is not None:
id_attr = cls._id_attr.replace("_", "-")
sub_parser_action.add_argument(f"--{id_attr}", required=True)
@@ -309,10 +305,10 @@ def extend_parser(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
# populate argparse for all Gitlab Object
classes = []
- for cls in gitlab.v4.objects.__dict__.values():
+ for cls in v4_objects.__dict__.values():
if not isinstance(cls, type):
continue
- if issubclass(cls, gitlab.base.RESTManager):
+ if issubclass(cls, base.RESTManager):
if cls._obj_cls is not None:
classes.append(cls._obj_cls)
classes.sort(key=operator.attrgetter("__name__"))
@@ -331,7 +327,7 @@ def extend_parser(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
def get_dict(
- obj: Union[str, gitlab.base.RESTObject], fields: List[str]
+ obj: Union[str, base.RESTObject], fields: List[str]
) -> Union[str, Dict[str, Any]]:
if isinstance(obj, str):
return obj
@@ -349,7 +345,7 @@ class JSONPrinter(object):
def display_list(
self,
- data: List[Union[str, gitlab.base.RESTObject]],
+ data: List[Union[str, base.RESTObject]],
fields: List[str],
**kwargs: Any,
) -> None:
@@ -373,7 +369,7 @@ class YAMLPrinter(object):
def display_list(
self,
- data: List[Union[str, gitlab.base.RESTObject]],
+ data: List[Union[str, base.RESTObject]],
fields: List[str],
**kwargs: Any,
) -> None:
@@ -397,7 +393,7 @@ class LegacyPrinter(object):
def display(self, d: Union[str, Dict[str, Any]], **kwargs: Any) -> None:
verbose = kwargs.get("verbose", False)
padding = kwargs.get("padding", 0)
- obj: Optional[Union[Dict[str, Any], gitlab.base.RESTObject]] = kwargs.get("obj")
+ obj: Optional[Union[Dict[str, Any], base.RESTObject]] = kwargs.get("obj")
if TYPE_CHECKING:
assert obj is not None
@@ -427,7 +423,7 @@ class LegacyPrinter(object):
else:
if TYPE_CHECKING:
- assert isinstance(obj, gitlab.base.RESTObject)
+ assert isinstance(obj, base.RESTObject)
if obj._id_attr:
id = getattr(obj, obj._id_attr)
print(f"{obj._id_attr.replace('_', '-')}: {id}")
@@ -444,13 +440,13 @@ class LegacyPrinter(object):
def display_list(
self,
- data: List[Union[str, gitlab.base.RESTObject]],
+ data: List[Union[str, base.RESTObject]],
fields: List[str],
**kwargs: Any,
) -> None:
verbose = kwargs.get("verbose", False)
for obj in data:
- if isinstance(obj, gitlab.base.RESTObject):
+ if isinstance(obj, base.RESTObject):
self.display(get_dict(obj, fields), verbose=verbose, obj=obj)
else:
print(obj)
@@ -467,7 +463,7 @@ PRINTERS: Dict[
def run(
- gl: gitlab.Gitlab,
+ gl: client.Gitlab,
what: str,
action: str,
args: Dict[str, Any],
@@ -484,7 +480,7 @@ def run(
printer.display(data, verbose=True, obj=data)
elif isinstance(data, list):
printer.display_list(data, fields, verbose=verbose)
- elif isinstance(data, gitlab.base.RESTObject):
+ elif isinstance(data, base.RESTObject):
printer.display(get_dict(data, fields), verbose=verbose, obj=data)
elif isinstance(data, str):
print(data)
diff --git a/gitlab/v4/objects/access_requests.py b/gitlab/v4/objects/access_requests.py
index e70eb27..0269c99 100644
--- a/gitlab/v4/objects/access_requests.py
+++ b/gitlab/v4/objects/access_requests.py
@@ -1,5 +1,5 @@
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import (
+from ...base import RESTManager, RESTObject
+from ...mixins import (
AccessRequestMixin,
CreateMixin,
DeleteMixin,
diff --git a/gitlab/v4/objects/appearance.py b/gitlab/v4/objects/appearance.py
index f6643f4..c7f1cc5 100644
--- a/gitlab/v4/objects/appearance.py
+++ b/gitlab/v4/objects/appearance.py
@@ -1,8 +1,8 @@
from typing import Any, cast, Dict, Optional, Union
-from gitlab import exceptions as exc
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import GetWithoutIdMixin, SaveMixin, UpdateMixin
+from ... import exceptions as exc
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import GetWithoutIdMixin, SaveMixin, UpdateMixin
__all__ = [
"ApplicationAppearance",
diff --git a/gitlab/v4/objects/applications.py b/gitlab/v4/objects/applications.py
index c91dee1..f84a47f 100644
--- a/gitlab/v4/objects/applications.py
+++ b/gitlab/v4/objects/applications.py
@@ -1,5 +1,5 @@
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin
__all__ = [
"Application",
diff --git a/gitlab/v4/objects/audit_events.py b/gitlab/v4/objects/audit_events.py
index 649dc9d..bef3201 100644
--- a/gitlab/v4/objects/audit_events.py
+++ b/gitlab/v4/objects/audit_events.py
@@ -4,8 +4,8 @@ https://docs.gitlab.com/ee/api/audit_events.html
"""
from typing import Any, cast, Union
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import RetrieveMixin
+from ...base import RESTManager, RESTObject
+from ...mixins import RetrieveMixin
__all__ = [
"AuditEvent",
diff --git a/gitlab/v4/objects/award_emojis.py b/gitlab/v4/objects/award_emojis.py
index 3f9d777..dc2d070 100644
--- a/gitlab/v4/objects/award_emojis.py
+++ b/gitlab/v4/objects/award_emojis.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import NoUpdateMixin, ObjectDeleteMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import NoUpdateMixin, ObjectDeleteMixin
__all__ = [
"GroupEpicAwardEmoji",
diff --git a/gitlab/v4/objects/badges.py b/gitlab/v4/objects/badges.py
index 4dee75a..4ee4ba7 100644
--- a/gitlab/v4/objects/badges.py
+++ b/gitlab/v4/objects/badges.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import BadgeRenderMixin, CRUDMixin, ObjectDeleteMixin, SaveMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import BadgeRenderMixin, CRUDMixin, ObjectDeleteMixin, SaveMixin
__all__ = [
"GroupBadge",
diff --git a/gitlab/v4/objects/boards.py b/gitlab/v4/objects/boards.py
index 73c652b..4413a63 100644
--- a/gitlab/v4/objects/boards.py
+++ b/gitlab/v4/objects/boards.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
__all__ = [
"GroupBoardList",
diff --git a/gitlab/v4/objects/branches.py b/gitlab/v4/objects/branches.py
index d06d6b4..325474c 100644
--- a/gitlab/v4/objects/branches.py
+++ b/gitlab/v4/objects/branches.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import NoUpdateMixin, ObjectDeleteMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import NoUpdateMixin, ObjectDeleteMixin
__all__ = [
"ProjectBranch",
diff --git a/gitlab/v4/objects/broadcast_messages.py b/gitlab/v4/objects/broadcast_messages.py
index 7e28be6..86ad393 100644
--- a/gitlab/v4/objects/broadcast_messages.py
+++ b/gitlab/v4/objects/broadcast_messages.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
__all__ = [
"BroadcastMessage",
diff --git a/gitlab/v4/objects/clusters.py b/gitlab/v4/objects/clusters.py
index dc02ee0..b72eea5 100644
--- a/gitlab/v4/objects/clusters.py
+++ b/gitlab/v4/objects/clusters.py
@@ -1,8 +1,8 @@
from typing import Any, cast, Dict, Optional, Union
-from gitlab import exceptions as exc
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CreateMixin, CRUDMixin, ObjectDeleteMixin, SaveMixin
+from ... import exceptions as exc
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CreateMixin, CRUDMixin, ObjectDeleteMixin, SaveMixin
__all__ = [
"GroupCluster",
diff --git a/gitlab/v4/objects/commits.py b/gitlab/v4/objects/commits.py
index 30db0de..6ff9aa0 100644
--- a/gitlab/v4/objects/commits.py
+++ b/gitlab/v4/objects/commits.py
@@ -2,11 +2,10 @@ from typing import Any, cast, Dict, Optional, TYPE_CHECKING, Union
import requests
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CreateMixin, ListMixin, RefreshMixin, RetrieveMixin
-
+from ... import cli
+from ... import exceptions as exc
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CreateMixin, ListMixin, RefreshMixin, RetrieveMixin
from .discussions import ProjectCommitDiscussionManager # noqa: F401
__all__ = [
diff --git a/gitlab/v4/objects/container_registry.py b/gitlab/v4/objects/container_registry.py
index a144dc1..d71e949 100644
--- a/gitlab/v4/objects/container_registry.py
+++ b/gitlab/v4/objects/container_registry.py
@@ -1,9 +1,9 @@
from typing import Any, cast, TYPE_CHECKING, Union
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import DeleteMixin, ListMixin, ObjectDeleteMixin, RetrieveMixin
+from ... import cli
+from ... import exceptions as exc
+from ...base import RESTManager, RESTObject
+from ...mixins import DeleteMixin, ListMixin, ObjectDeleteMixin, RetrieveMixin
__all__ = [
"ProjectRegistryRepository",
diff --git a/gitlab/v4/objects/custom_attributes.py b/gitlab/v4/objects/custom_attributes.py
index d061614..79c238a 100644
--- a/gitlab/v4/objects/custom_attributes.py
+++ b/gitlab/v4/objects/custom_attributes.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import DeleteMixin, ObjectDeleteMixin, RetrieveMixin, SetMixin
+from ...base import RESTManager, RESTObject
+from ...mixins import DeleteMixin, ObjectDeleteMixin, RetrieveMixin, SetMixin
__all__ = [
"GroupCustomAttribute",
diff --git a/gitlab/v4/objects/deploy_keys.py b/gitlab/v4/objects/deploy_keys.py
index f325f69..758042c 100644
--- a/gitlab/v4/objects/deploy_keys.py
+++ b/gitlab/v4/objects/deploy_keys.py
@@ -2,10 +2,10 @@ from typing import Any, cast, Dict, Union
import requests
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CRUDMixin, ListMixin, ObjectDeleteMixin, SaveMixin
+from ... import cli
+from ... import exceptions as exc
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CRUDMixin, ListMixin, ObjectDeleteMixin, SaveMixin
__all__ = [
"DeployKey",
diff --git a/gitlab/v4/objects/deploy_tokens.py b/gitlab/v4/objects/deploy_tokens.py
index 97f3270..7c3e8c9 100644
--- a/gitlab/v4/objects/deploy_tokens.py
+++ b/gitlab/v4/objects/deploy_tokens.py
@@ -1,6 +1,6 @@
-from gitlab import types
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin
+from ... import types
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin
__all__ = [
"DeployToken",
diff --git a/gitlab/v4/objects/deployments.py b/gitlab/v4/objects/deployments.py
index 9aee699..e9e212b 100644
--- a/gitlab/v4/objects/deployments.py
+++ b/gitlab/v4/objects/deployments.py
@@ -1,8 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CreateMixin, RetrieveMixin, SaveMixin, UpdateMixin
-
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CreateMixin, RetrieveMixin, SaveMixin, UpdateMixin
from .merge_requests import ProjectDeploymentMergeRequestManager # noqa: F401
__all__ = [
diff --git a/gitlab/v4/objects/discussions.py b/gitlab/v4/objects/discussions.py
index fa874c4..dc429fd 100644
--- a/gitlab/v4/objects/discussions.py
+++ b/gitlab/v4/objects/discussions.py
@@ -1,8 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CreateMixin, RetrieveMixin, SaveMixin, UpdateMixin
-
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CreateMixin, RetrieveMixin, SaveMixin, UpdateMixin
from .notes import ( # noqa: F401
ProjectCommitDiscussionNoteManager,
ProjectIssueDiscussionNoteManager,
diff --git a/gitlab/v4/objects/environments.py b/gitlab/v4/objects/environments.py
index 35f2fb2..85f1f90 100644
--- a/gitlab/v4/objects/environments.py
+++ b/gitlab/v4/objects/environments.py
@@ -2,10 +2,10 @@ from typing import Any, cast, Dict, Union
import requests
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import (
+from ... import cli
+from ... import exceptions as exc
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import (
CreateMixin,
DeleteMixin,
ObjectDeleteMixin,
diff --git a/gitlab/v4/objects/epics.py b/gitlab/v4/objects/epics.py
index 999c45f..3b1e900 100644
--- a/gitlab/v4/objects/epics.py
+++ b/gitlab/v4/objects/epics.py
@@ -1,9 +1,9 @@
from typing import Any, cast, Dict, Optional, TYPE_CHECKING, Union
-from gitlab import exceptions as exc
-from gitlab import types
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import (
+from ... import exceptions as exc
+from ... import types
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import (
CreateMixin,
CRUDMixin,
DeleteMixin,
@@ -12,7 +12,6 @@ from gitlab.mixins import (
SaveMixin,
UpdateMixin,
)
-
from .events import GroupEpicResourceLabelEventManager # noqa: F401
__all__ = [
diff --git a/gitlab/v4/objects/events.py b/gitlab/v4/objects/events.py
index b7d8fd1..0dbdc59 100644
--- a/gitlab/v4/objects/events.py
+++ b/gitlab/v4/objects/events.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import ListMixin, RetrieveMixin
+from ...base import RESTManager, RESTObject
+from ...mixins import ListMixin, RetrieveMixin
__all__ = [
"Event",
diff --git a/gitlab/v4/objects/export_import.py b/gitlab/v4/objects/export_import.py
index 6bba322..f06c936 100644
--- a/gitlab/v4/objects/export_import.py
+++ b/gitlab/v4/objects/export_import.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Optional, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CreateMixin, DownloadMixin, GetWithoutIdMixin, RefreshMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CreateMixin, DownloadMixin, GetWithoutIdMixin, RefreshMixin
__all__ = [
"GroupExport",
diff --git a/gitlab/v4/objects/features.py b/gitlab/v4/objects/features.py
index 2e92596..7c843df 100644
--- a/gitlab/v4/objects/features.py
+++ b/gitlab/v4/objects/features.py
@@ -4,10 +4,10 @@ https://docs.gitlab.com/ee/api/features.html
"""
from typing import Any, Optional, TYPE_CHECKING, Union
-from gitlab import exceptions as exc
-from gitlab import utils
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import DeleteMixin, ListMixin, ObjectDeleteMixin
+from ... import exceptions as exc
+from ... import utils
+from ...base import RESTManager, RESTObject
+from ...mixins import DeleteMixin, ListMixin, ObjectDeleteMixin
__all__ = [
"Feature",
diff --git a/gitlab/v4/objects/files.py b/gitlab/v4/objects/files.py
index c3a8ec8..477c73c 100644
--- a/gitlab/v4/objects/files.py
+++ b/gitlab/v4/objects/files.py
@@ -3,11 +3,11 @@ from typing import Any, Callable, cast, Dict, List, Optional, TYPE_CHECKING
import requests
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab import utils
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import (
+from ... import cli
+from ... import exceptions as exc
+from ... import utils
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import (
CreateMixin,
DeleteMixin,
GetMixin,
diff --git a/gitlab/v4/objects/geo_nodes.py b/gitlab/v4/objects/geo_nodes.py
index ebeb0d6..2fd93f6 100644
--- a/gitlab/v4/objects/geo_nodes.py
+++ b/gitlab/v4/objects/geo_nodes.py
@@ -1,9 +1,9 @@
from typing import Any, cast, Dict, List, TYPE_CHECKING, Union
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import (
+from ... import cli
+from ... import exceptions as exc
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import (
DeleteMixin,
ObjectDeleteMixin,
RetrieveMixin,
diff --git a/gitlab/v4/objects/groups.py b/gitlab/v4/objects/groups.py
index 7479cfb..8492eca 100644
--- a/gitlab/v4/objects/groups.py
+++ b/gitlab/v4/objects/groups.py
@@ -2,13 +2,11 @@ from typing import Any, BinaryIO, cast, Dict, List, Optional, Type, TYPE_CHECKIN
import requests
-import gitlab
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab import types
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CRUDMixin, ListMixin, ObjectDeleteMixin, SaveMixin
-
+from ... import cli, client
+from ... import exceptions as exc
+from ... import types
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CRUDMixin, ListMixin, ObjectDeleteMixin, SaveMixin
from .access_requests import GroupAccessRequestManager # noqa: F401
from .audit_events import GroupAuditEventManager # noqa: F401
from .badges import GroupBadgeManager # noqa: F401
@@ -97,7 +95,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
@exc.on_http_error(exc.GitlabSearchError)
def search(
self, scope: str, search: str, **kwargs: Any
- ) -> Union[gitlab.GitlabList, List[Dict[str, Any]]]:
+ ) -> Union[client.GitlabList, List[Dict[str, Any]]]:
"""Search the group resources matching the provided string.'
Args:
diff --git a/gitlab/v4/objects/hooks.py b/gitlab/v4/objects/hooks.py
index 0b0092e..af2ea0f 100644
--- a/gitlab/v4/objects/hooks.py
+++ b/gitlab/v4/objects/hooks.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CRUDMixin, NoUpdateMixin, ObjectDeleteMixin, SaveMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CRUDMixin, NoUpdateMixin, ObjectDeleteMixin, SaveMixin
__all__ = [
"Hook",
diff --git a/gitlab/v4/objects/issues.py b/gitlab/v4/objects/issues.py
index 5a99a09..fb032c3 100644
--- a/gitlab/v4/objects/issues.py
+++ b/gitlab/v4/objects/issues.py
@@ -1,10 +1,10 @@
from typing import Any, cast, Dict, Tuple, TYPE_CHECKING, Union
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab import types
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import (
+from ... import cli
+from ... import exceptions as exc
+from ... import types
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import (
CreateMixin,
CRUDMixin,
DeleteMixin,
@@ -18,7 +18,6 @@ from gitlab.mixins import (
TodoMixin,
UserAgentDetailMixin,
)
-
from .award_emojis import ProjectIssueAwardEmojiManager # noqa: F401
from .discussions import ProjectIssueDiscussionManager # noqa: F401
from .events import ( # noqa: F401
diff --git a/gitlab/v4/objects/jobs.py b/gitlab/v4/objects/jobs.py
index be06f86..8424838 100644
--- a/gitlab/v4/objects/jobs.py
+++ b/gitlab/v4/objects/jobs.py
@@ -2,11 +2,11 @@ from typing import Any, Callable, cast, Dict, Optional, TYPE_CHECKING, Union
import requests
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab import utils
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import RefreshMixin, RetrieveMixin
+from ... import cli
+from ... import exceptions as exc
+from ... import utils
+from ...base import RESTManager, RESTObject
+from ...mixins import RefreshMixin, RetrieveMixin
__all__ = [
"ProjectJob",
diff --git a/gitlab/v4/objects/keys.py b/gitlab/v4/objects/keys.py
index c03dced..3cd6ce5 100644
--- a/gitlab/v4/objects/keys.py
+++ b/gitlab/v4/objects/keys.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Optional, TYPE_CHECKING, Union
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import GetMixin
+from ...base import RESTManager, RESTObject
+from ...mixins import GetMixin
__all__ = [
"Key",
diff --git a/gitlab/v4/objects/labels.py b/gitlab/v4/objects/labels.py
index f899852..00ff65f 100644
--- a/gitlab/v4/objects/labels.py
+++ b/gitlab/v4/objects/labels.py
@@ -1,8 +1,8 @@
from typing import Any, cast, Dict, Optional, TYPE_CHECKING, Union
-from gitlab import exceptions as exc
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import (
+from ... import exceptions as exc
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import (
CreateMixin,
DeleteMixin,
ListMixin,
diff --git a/gitlab/v4/objects/ldap.py b/gitlab/v4/objects/ldap.py
index 10667b4..081f8aa 100644
--- a/gitlab/v4/objects/ldap.py
+++ b/gitlab/v4/objects/ldap.py
@@ -1,7 +1,7 @@
from typing import Any, List, Union
-from gitlab import exceptions as exc
-from gitlab.base import RESTManager, RESTObject, RESTObjectList
+from ... import exceptions as exc
+from ...base import RESTManager, RESTObject, RESTObjectList
__all__ = [
"LDAPGroup",
diff --git a/gitlab/v4/objects/members.py b/gitlab/v4/objects/members.py
index 8fa2bb3..9479d7f 100644
--- a/gitlab/v4/objects/members.py
+++ b/gitlab/v4/objects/members.py
@@ -1,8 +1,8 @@
from typing import Any, cast, Union
-from gitlab import types
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import (
+from ... import types
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import (
CRUDMixin,
DeleteMixin,
ListMixin,
diff --git a/gitlab/v4/objects/merge_request_approvals.py b/gitlab/v4/objects/merge_request_approvals.py
index 2bbd399..5044d6d 100644
--- a/gitlab/v4/objects/merge_request_approvals.py
+++ b/gitlab/v4/objects/merge_request_approvals.py
@@ -1,8 +1,8 @@
from typing import Any, cast, Dict, List, Optional, TYPE_CHECKING, Union
-from gitlab import exceptions as exc
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import (
+from ... import exceptions as exc
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import (
CreateMixin,
DeleteMixin,
GetWithoutIdMixin,
diff --git a/gitlab/v4/objects/merge_requests.py b/gitlab/v4/objects/merge_requests.py
index 11c962b..53e698c 100644
--- a/gitlab/v4/objects/merge_requests.py
+++ b/gitlab/v4/objects/merge_requests.py
@@ -7,12 +7,11 @@ from typing import Any, cast, Dict, Optional, TYPE_CHECKING, Union
import requests
-import gitlab
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab import types
-from gitlab.base import RequiredOptional, RESTManager, RESTObject, RESTObjectList
-from gitlab.mixins import (
+from ... import cli, client
+from ... import exceptions as exc
+from ... import types
+from ...base import RequiredOptional, RESTManager, RESTObject, RESTObjectList
+from ...mixins import (
CRUDMixin,
ListMixin,
ObjectDeleteMixin,
@@ -23,7 +22,6 @@ from gitlab.mixins import (
TimeTrackingMixin,
TodoMixin,
)
-
from .award_emojis import ProjectMergeRequestAwardEmojiManager # noqa: F401
from .commits import ProjectCommit, ProjectCommitManager
from .discussions import ProjectMergeRequestDiscussionManager # noqa: F401
@@ -213,7 +211,7 @@ class ProjectMergeRequest(
path = f"{self.manager.path}/{self.get_id()}/closes_issues"
data_list = self.manager.gitlab.http_list(path, as_list=False, **kwargs)
if TYPE_CHECKING:
- assert isinstance(data_list, gitlab.GitlabList)
+ assert isinstance(data_list, client.GitlabList)
manager = ProjectIssueManager(self.manager.gitlab, parent=self.manager._parent)
return RESTObjectList(manager, ProjectIssue, data_list)
@@ -241,7 +239,7 @@ class ProjectMergeRequest(
path = f"{self.manager.path}/{self.get_id()}/commits"
data_list = self.manager.gitlab.http_list(path, as_list=False, **kwargs)
if TYPE_CHECKING:
- assert isinstance(data_list, gitlab.GitlabList)
+ assert isinstance(data_list, client.GitlabList)
manager = ProjectCommitManager(self.manager.gitlab, parent=self.manager._parent)
return RESTObjectList(manager, ProjectCommit, data_list)
diff --git a/gitlab/v4/objects/merge_trains.py b/gitlab/v4/objects/merge_trains.py
index 9f8e1df..0819e03 100644
--- a/gitlab/v4/objects/merge_trains.py
+++ b/gitlab/v4/objects/merge_trains.py
@@ -1,5 +1,5 @@
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import ListMixin
+from ...base import RESTManager, RESTObject
+from ...mixins import ListMixin
__all__ = [
"ProjectMergeTrain",
diff --git a/gitlab/v4/objects/milestones.py b/gitlab/v4/objects/milestones.py
index a1e48a5..9b0e60a 100644
--- a/gitlab/v4/objects/milestones.py
+++ b/gitlab/v4/objects/milestones.py
@@ -1,11 +1,10 @@
from typing import Any, cast, TYPE_CHECKING, Union
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab import types
-from gitlab.base import RequiredOptional, RESTManager, RESTObject, RESTObjectList
-from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, PromoteMixin, SaveMixin
-
+from ... import cli
+from ... import exceptions as exc
+from ... import types
+from ...base import RequiredOptional, RESTManager, RESTObject, RESTObjectList
+from ...mixins import CRUDMixin, ObjectDeleteMixin, PromoteMixin, SaveMixin
from .issues import GroupIssue, GroupIssueManager, ProjectIssue, ProjectIssueManager
from .merge_requests import (
GroupMergeRequest,
diff --git a/gitlab/v4/objects/namespaces.py b/gitlab/v4/objects/namespaces.py
index 91a1850..1271a1a 100644
--- a/gitlab/v4/objects/namespaces.py
+++ b/gitlab/v4/objects/namespaces.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import RetrieveMixin
+from ...base import RESTManager, RESTObject
+from ...mixins import RetrieveMixin
__all__ = [
"Namespace",
diff --git a/gitlab/v4/objects/notes.py b/gitlab/v4/objects/notes.py
index 833f632..e5526fc 100644
--- a/gitlab/v4/objects/notes.py
+++ b/gitlab/v4/objects/notes.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import (
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import (
CreateMixin,
CRUDMixin,
DeleteMixin,
@@ -11,7 +11,6 @@ from gitlab.mixins import (
SaveMixin,
UpdateMixin,
)
-
from .award_emojis import ( # noqa: F401
GroupEpicNoteAwardEmojiManager,
ProjectIssueNoteAwardEmojiManager,
diff --git a/gitlab/v4/objects/notification_settings.py b/gitlab/v4/objects/notification_settings.py
index b5a3797..0004570 100644
--- a/gitlab/v4/objects/notification_settings.py
+++ b/gitlab/v4/objects/notification_settings.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Optional, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import GetWithoutIdMixin, SaveMixin, UpdateMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import GetWithoutIdMixin, SaveMixin, UpdateMixin
__all__ = [
"NotificationSettings",
diff --git a/gitlab/v4/objects/packages.py b/gitlab/v4/objects/packages.py
index 0461bdc..da7f811 100644
--- a/gitlab/v4/objects/packages.py
+++ b/gitlab/v4/objects/packages.py
@@ -9,11 +9,11 @@ from typing import Any, Callable, cast, Optional, TYPE_CHECKING, Union
import requests
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab import utils
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import DeleteMixin, GetMixin, ListMixin, ObjectDeleteMixin
+from ... import cli
+from ... import exceptions as exc
+from ... import utils
+from ...base import RESTManager, RESTObject
+from ...mixins import DeleteMixin, GetMixin, ListMixin, ObjectDeleteMixin
__all__ = [
"GenericPackage",
diff --git a/gitlab/v4/objects/pages.py b/gitlab/v4/objects/pages.py
index 3fc0404..dd30b5d 100644
--- a/gitlab/v4/objects/pages.py
+++ b/gitlab/v4/objects/pages.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CRUDMixin, ListMixin, ObjectDeleteMixin, SaveMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CRUDMixin, ListMixin, ObjectDeleteMixin, SaveMixin
__all__ = [
"PagesDomain",
diff --git a/gitlab/v4/objects/personal_access_tokens.py b/gitlab/v4/objects/personal_access_tokens.py
index 74ba231..d0b45dd 100644
--- a/gitlab/v4/objects/personal_access_tokens.py
+++ b/gitlab/v4/objects/personal_access_tokens.py
@@ -1,5 +1,5 @@
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin
__all__ = [
"PersonalAccessToken",
diff --git a/gitlab/v4/objects/pipelines.py b/gitlab/v4/objects/pipelines.py
index ac4290f..903c91e 100644
--- a/gitlab/v4/objects/pipelines.py
+++ b/gitlab/v4/objects/pipelines.py
@@ -2,10 +2,10 @@ from typing import Any, cast, Dict, Optional, TYPE_CHECKING, Union
import requests
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import (
+from ... import cli
+from ... import exceptions as exc
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import (
CreateMixin,
CRUDMixin,
DeleteMixin,
diff --git a/gitlab/v4/objects/project_access_tokens.py b/gitlab/v4/objects/project_access_tokens.py
index 6293f21..be59a4f 100644
--- a/gitlab/v4/objects/project_access_tokens.py
+++ b/gitlab/v4/objects/project_access_tokens.py
@@ -1,5 +1,5 @@
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin
+from ...base import RESTManager, RESTObject
+from ...mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin
__all__ = [
"ProjectAccessToken",
diff --git a/gitlab/v4/objects/projects.py b/gitlab/v4/objects/projects.py
index 74671c8..b6da6e6 100644
--- a/gitlab/v4/objects/projects.py
+++ b/gitlab/v4/objects/projects.py
@@ -2,11 +2,11 @@ from typing import Any, Callable, cast, Dict, List, Optional, TYPE_CHECKING, Uni
import requests
-from gitlab import cli, client
-from gitlab import exceptions as exc
-from gitlab import types, utils
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import (
+from ... import cli, client
+from ... import exceptions as exc
+from ... import types, utils
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import (
CreateMixin,
CRUDMixin,
ListMixin,
@@ -15,7 +15,6 @@ from gitlab.mixins import (
SaveMixin,
UpdateMixin,
)
-
from .access_requests import ProjectAccessRequestManager # noqa: F401
from .audit_events import ProjectAuditEventManager # noqa: F401
from .badges import ProjectBadgeManager # noqa: F401
diff --git a/gitlab/v4/objects/push_rules.py b/gitlab/v4/objects/push_rules.py
index b948a01..18ace69 100644
--- a/gitlab/v4/objects/push_rules.py
+++ b/gitlab/v4/objects/push_rules.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Optional, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import (
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import (
CreateMixin,
DeleteMixin,
GetWithoutIdMixin,
diff --git a/gitlab/v4/objects/releases.py b/gitlab/v4/objects/releases.py
index e14f42a..9a470f7 100644
--- a/gitlab/v4/objects/releases.py
+++ b/gitlab/v4/objects/releases.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
__all__ = [
"ProjectRelease",
diff --git a/gitlab/v4/objects/repositories.py b/gitlab/v4/objects/repositories.py
index b520ab7..53d255f 100644
--- a/gitlab/v4/objects/repositories.py
+++ b/gitlab/v4/objects/repositories.py
@@ -7,14 +7,13 @@ from typing import Any, Callable, Dict, List, Optional, TYPE_CHECKING, Union
import requests
-import gitlab
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab import utils
+from ... import base, cli, client
+from ... import exceptions as exc
+from ... import utils
if TYPE_CHECKING:
# When running mypy we use these as the base classes
- _RestObjectBase = gitlab.base.RESTObject
+ _RestObjectBase = base.RESTObject
else:
_RestObjectBase = object
@@ -50,7 +49,7 @@ class RepositoryMixin(_RestObjectBase):
@exc.on_http_error(exc.GitlabGetError)
def repository_tree(
self, path: str = "", ref: str = "", recursive: bool = False, **kwargs: Any
- ) -> Union[gitlab.client.GitlabList, List[Dict[str, Any]]]:
+ ) -> Union[client.GitlabList, List[Dict[str, Any]]]:
"""Return a list of files in the repository.
Args:
@@ -165,7 +164,7 @@ class RepositoryMixin(_RestObjectBase):
@exc.on_http_error(exc.GitlabGetError)
def repository_contributors(
self, **kwargs: Any
- ) -> Union[gitlab.client.GitlabList, List[Dict[str, Any]]]:
+ ) -> Union[client.GitlabList, List[Dict[str, Any]]]:
"""Return a list of contributors for the project.
Args:
diff --git a/gitlab/v4/objects/runners.py b/gitlab/v4/objects/runners.py
index d340b99..3196d56 100644
--- a/gitlab/v4/objects/runners.py
+++ b/gitlab/v4/objects/runners.py
@@ -1,10 +1,10 @@
from typing import Any, cast, List, Optional, Union
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab import types
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import (
+from ... import cli
+from ... import exceptions as exc
+from ... import types
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import (
CreateMixin,
CRUDMixin,
DeleteMixin,
diff --git a/gitlab/v4/objects/services.py b/gitlab/v4/objects/services.py
index 4aa87cc..ff5701d 100644
--- a/gitlab/v4/objects/services.py
+++ b/gitlab/v4/objects/services.py
@@ -1,8 +1,8 @@
from typing import Any, cast, Dict, List, Optional, Union
-from gitlab import cli
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import (
+from ... import cli
+from ...base import RESTManager, RESTObject
+from ...mixins import (
DeleteMixin,
GetMixin,
ListMixin,
diff --git a/gitlab/v4/objects/settings.py b/gitlab/v4/objects/settings.py
index 96f2539..3d795f4 100644
--- a/gitlab/v4/objects/settings.py
+++ b/gitlab/v4/objects/settings.py
@@ -1,9 +1,9 @@
from typing import Any, cast, Dict, Optional, Union
-from gitlab import exceptions as exc
-from gitlab import types
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import GetWithoutIdMixin, SaveMixin, UpdateMixin
+from ... import exceptions as exc
+from ... import types
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import GetWithoutIdMixin, SaveMixin, UpdateMixin
__all__ = [
"ApplicationSettings",
diff --git a/gitlab/v4/objects/sidekiq.py b/gitlab/v4/objects/sidekiq.py
index c0bf9d2..16b258d 100644
--- a/gitlab/v4/objects/sidekiq.py
+++ b/gitlab/v4/objects/sidekiq.py
@@ -2,9 +2,9 @@ from typing import Any, Dict, Union
import requests
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab.base import RESTManager
+from ... import cli
+from ... import exceptions as exc
+from ...base import RESTManager
__all__ = [
"SidekiqManager",
diff --git a/gitlab/v4/objects/snippets.py b/gitlab/v4/objects/snippets.py
index 66459c0..9b54b23 100644
--- a/gitlab/v4/objects/snippets.py
+++ b/gitlab/v4/objects/snippets.py
@@ -2,12 +2,11 @@ from typing import Any, Callable, cast, List, Optional, TYPE_CHECKING, Union
import requests
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab import utils
-from gitlab.base import RequiredOptional, RESTManager, RESTObject, RESTObjectList
-from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin, UserAgentDetailMixin
-
+from ... import cli
+from ... import exceptions as exc
+from ... import utils
+from ...base import RequiredOptional, RESTManager, RESTObject, RESTObjectList
+from ...mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin, UserAgentDetailMixin
from .award_emojis import ProjectSnippetAwardEmojiManager # noqa: F401
from .discussions import ProjectSnippetDiscussionManager # noqa: F401
from .notes import ProjectSnippetNoteManager # noqa: F401
diff --git a/gitlab/v4/objects/statistics.py b/gitlab/v4/objects/statistics.py
index 2941f91..ab8216a 100644
--- a/gitlab/v4/objects/statistics.py
+++ b/gitlab/v4/objects/statistics.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Optional, Union
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import GetWithoutIdMixin, RefreshMixin
+from ...base import RESTManager, RESTObject
+from ...mixins import GetWithoutIdMixin, RefreshMixin
__all__ = [
"GroupIssuesStatistics",
diff --git a/gitlab/v4/objects/tags.py b/gitlab/v4/objects/tags.py
index c76799d..36d7279 100644
--- a/gitlab/v4/objects/tags.py
+++ b/gitlab/v4/objects/tags.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import NoUpdateMixin, ObjectDeleteMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import NoUpdateMixin, ObjectDeleteMixin
__all__ = [
"ProjectTag",
diff --git a/gitlab/v4/objects/templates.py b/gitlab/v4/objects/templates.py
index bbe2ae6..5379b97 100644
--- a/gitlab/v4/objects/templates.py
+++ b/gitlab/v4/objects/templates.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import RetrieveMixin
+from ...base import RESTManager, RESTObject
+from ...mixins import RetrieveMixin
__all__ = [
"Dockerfile",
diff --git a/gitlab/v4/objects/todos.py b/gitlab/v4/objects/todos.py
index e441eff..ab06ffb 100644
--- a/gitlab/v4/objects/todos.py
+++ b/gitlab/v4/objects/todos.py
@@ -1,9 +1,9 @@
from typing import Any, Dict, TYPE_CHECKING
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import DeleteMixin, ListMixin, ObjectDeleteMixin
+from ... import cli
+from ... import exceptions as exc
+from ...base import RESTManager, RESTObject
+from ...mixins import DeleteMixin, ListMixin, ObjectDeleteMixin
__all__ = [
"Todo",
diff --git a/gitlab/v4/objects/triggers.py b/gitlab/v4/objects/triggers.py
index e75be13..2804ca0 100644
--- a/gitlab/v4/objects/triggers.py
+++ b/gitlab/v4/objects/triggers.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
__all__ = [
"ProjectTrigger",
diff --git a/gitlab/v4/objects/users.py b/gitlab/v4/objects/users.py
index 53376a9..1876bdf 100644
--- a/gitlab/v4/objects/users.py
+++ b/gitlab/v4/objects/users.py
@@ -7,11 +7,11 @@ from typing import Any, cast, Dict, List, Optional, Union
import requests
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab import types
-from gitlab.base import RequiredOptional, RESTManager, RESTObject, RESTObjectList
-from gitlab.mixins import (
+from ... import cli
+from ... import exceptions as exc
+from ... import types
+from ...base import RequiredOptional, RESTManager, RESTObject, RESTObjectList
+from ...mixins import (
CreateMixin,
CRUDMixin,
DeleteMixin,
@@ -23,7 +23,6 @@ from gitlab.mixins import (
SaveMixin,
UpdateMixin,
)
-
from .custom_attributes import UserCustomAttributeManager # noqa: F401
from .events import UserEventManager # noqa: F401
from .personal_access_tokens import UserPersonalAccessTokenManager # noqa: F401
diff --git a/gitlab/v4/objects/variables.py b/gitlab/v4/objects/variables.py
index ba425c8..4121099 100644
--- a/gitlab/v4/objects/variables.py
+++ b/gitlab/v4/objects/variables.py
@@ -6,8 +6,8 @@ https://docs.gitlab.com/ee/api/group_level_variables.html
"""
from typing import Any, cast, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
__all__ = [
"Variable",
diff --git a/gitlab/v4/objects/wikis.py b/gitlab/v4/objects/wikis.py
index c4055da..8f8bbc1 100644
--- a/gitlab/v4/objects/wikis.py
+++ b/gitlab/v4/objects/wikis.py
@@ -1,7 +1,7 @@
from typing import Any, cast, Union
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
+from ...base import RequiredOptional, RESTManager, RESTObject
+from ...mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
__all__ = [
"ProjectWiki",