diff options
author | John L. Villalovos <john@sodarock.com> | 2022-06-03 16:47:51 -0700 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2022-06-04 09:18:22 -0700 |
commit | 1324ce1a439befb4620953a4df1f70b74bf70cbd (patch) | |
tree | 410d390b51fd98a4ee8a03e0e3e7da1d21cdaf53 | |
parent | 80aadaf4262016a8181b5150ca7e17c8139c15fa (diff) | |
download | gitlab-1324ce1a439befb4620953a4df1f70b74bf70cbd.tar.gz |
chore: enable pylint check: "redefined-outer-name",
Enable the pylint check "redefined-outer-name" and fix the errors
detected.
-rw-r--r-- | gitlab/cli.py | 4 | ||||
-rw-r--r-- | gitlab/client.py | 7 | ||||
-rw-r--r-- | pyproject.toml | 1 |
3 files changed, 5 insertions, 7 deletions
diff --git a/gitlab/cli.py b/gitlab/cli.py index 18618eb..d6e7d77 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -252,10 +252,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 gitlab.v4 import cli as v4_cli parser = _get_base_parser() - return gitlab.v4.cli.extend_parser(parser) + return v4_cli.extend_parser(parser) def _parse_value(v: Any) -> Any: diff --git a/gitlab/client.py b/gitlab/client.py index 0019c0e..f5d12df 100644 --- a/gitlab/client.py +++ b/gitlab/client.py @@ -119,9 +119,8 @@ class Gitlab: raise ModuleNotFoundError(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 gitlab.v4 import objects - objects = gitlab.v4.objects self._objects = objects self.user: Optional[objects.CurrentUser] = None @@ -214,9 +213,9 @@ class Gitlab: ) # pragma: no cover, dead code currently # NOTE: We must delay import of gitlab.v4.objects until now or # otherwise it will cause circular import errors - import gitlab.v4.objects + from gitlab.v4 import objects - self._objects = gitlab.v4.objects + self._objects = objects @property def url(self) -> str: diff --git a/pyproject.toml b/pyproject.toml index 986c7ca..fc6c1ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,6 @@ disable = [ "missing-module-docstring", "protected-access", "redefined-builtin", - "redefined-outer-name", "signature-differs", "too-few-public-methods", "too-many-ancestors", |