Skip to content

Commit

Permalink
chore: remove usage of 'from ... import *'
Browse files Browse the repository at this point in the history
In gitlab/v4/objects/*.py remove usage of:
  * from gitlab.base import *
  * from gitlab.mixins import *

Change them to:
  * from gitlab.base import CLASS_NAME
  * from gitlab.mixins import CLASS_NAME

Programmatically update code to explicitly import needed classes only.

After the change the output of:
  $ flake8 gitlab/v4/objects/*py | grep 'REST\|Mixin'

Is empty. Before many messages about unable to determine if it was a
valid name.
  • Loading branch information
JohnVillalovos committed Feb 24, 2021
1 parent a7ec67f commit c83eaf4
Show file tree
Hide file tree
Showing 57 changed files with 244 additions and 114 deletions.
10 changes: 8 additions & 2 deletions gitlab/v4/objects/access_requests.py
@@ -1,5 +1,11 @@
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import (
AccessRequestMixin,
CreateMixin,
DeleteMixin,
ListMixin,
ObjectDeleteMixin,
)


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/appearance.py
@@ -1,6 +1,6 @@
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import GetWithoutIdMixin, SaveMixin, UpdateMixin


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/applications.py
@@ -1,5 +1,5 @@
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin

__all__ = [
"Application",
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/audit_events.py
Expand Up @@ -3,8 +3,8 @@
https://docs.gitlab.com/ee/api/audit_events.html#project-audit-events
"""

from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import RetrieveMixin

__all__ = [
"ProjectAudit",
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/award_emojis.py
@@ -1,5 +1,5 @@
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import NoUpdateMixin, ObjectDeleteMixin


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/badges.py
@@ -1,5 +1,5 @@
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import BadgeRenderMixin, CRUDMixin, ObjectDeleteMixin, SaveMixin


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/boards.py
@@ -1,5 +1,5 @@
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/branches.py
@@ -1,7 +1,7 @@
from gitlab import cli
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import NoUpdateMixin, ObjectDeleteMixin


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/broadcast_messages.py
@@ -1,5 +1,5 @@
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/clusters.py
@@ -1,6 +1,6 @@
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import CRUDMixin, CreateMixin, ObjectDeleteMixin, SaveMixin


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/commits.py
@@ -1,7 +1,7 @@
from gitlab import cli
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import CreateMixin, ListMixin, RefreshMixin, RetrieveMixin
from .discussions import ProjectCommitDiscussionManager


Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/container_registry.py
@@ -1,7 +1,7 @@
from gitlab import cli
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import DeleteMixin, ListMixin, ObjectDeleteMixin, RetrieveMixin


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/custom_attributes.py
@@ -1,5 +1,5 @@
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import DeleteMixin, ObjectDeleteMixin, RetrieveMixin, SetMixin


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/deploy_keys.py
@@ -1,7 +1,7 @@
from gitlab import cli
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import CRUDMixin, ListMixin, ObjectDeleteMixin, SaveMixin


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/deploy_tokens.py
@@ -1,5 +1,5 @@
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/deployments.py
@@ -1,5 +1,5 @@
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import CreateMixin, RetrieveMixin, SaveMixin, UpdateMixin


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/discussions.py
@@ -1,5 +1,5 @@
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import CreateMixin, RetrieveMixin, SaveMixin, UpdateMixin
from .notes import (
ProjectCommitDiscussionNoteManager,
ProjectIssueDiscussionNoteManager,
Expand Down
11 changes: 9 additions & 2 deletions gitlab/v4/objects/environments.py
@@ -1,7 +1,14 @@
from gitlab import cli
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import (
CreateMixin,
DeleteMixin,
ObjectDeleteMixin,
RetrieveMixin,
SaveMixin,
UpdateMixin,
)


__all__ = [
Expand Down
12 changes: 10 additions & 2 deletions gitlab/v4/objects/epics.py
@@ -1,7 +1,15 @@
from gitlab import types
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import (
CRUDMixin,
CreateMixin,
DeleteMixin,
ListMixin,
ObjectDeleteMixin,
SaveMixin,
UpdateMixin,
)
from .events import GroupEpicResourceLabelEventManager


Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/events.py
@@ -1,6 +1,6 @@
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import ListMixin, RetrieveMixin


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/export_import.py
@@ -1,5 +1,5 @@
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import CreateMixin, DownloadMixin, GetWithoutIdMixin, RefreshMixin


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/features.py
@@ -1,7 +1,7 @@
from gitlab import utils
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import DeleteMixin, ListMixin, ObjectDeleteMixin


__all__ = [
Expand Down
11 changes: 9 additions & 2 deletions gitlab/v4/objects/files.py
@@ -1,8 +1,15 @@
import base64
from gitlab import cli, utils
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import (
CreateMixin,
DeleteMixin,
GetMixin,
ObjectDeleteMixin,
SaveMixin,
UpdateMixin,
)


__all__ = [
Expand Down
10 changes: 8 additions & 2 deletions gitlab/v4/objects/geo_nodes.py
@@ -1,7 +1,13 @@
from gitlab import cli
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import (
DeleteMixin,
ObjectDeleteMixin,
RetrieveMixin,
SaveMixin,
UpdateMixin,
)


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/groups.py
@@ -1,7 +1,7 @@
from gitlab import cli, types
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import CRUDMixin, ListMixin, ObjectDeleteMixin, SaveMixin
from .access_requests import GroupAccessRequestManager
from .badges import GroupBadgeManager
from .boards import GroupBoardManager
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/hooks.py
@@ -1,5 +1,5 @@
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import CRUDMixin, NoUpdateMixin, ObjectDeleteMixin, SaveMixin


__all__ = [
Expand Down
17 changes: 15 additions & 2 deletions gitlab/v4/objects/issues.py
@@ -1,7 +1,20 @@
from gitlab import cli, types
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import (
CRUDMixin,
CreateMixin,
DeleteMixin,
ListMixin,
ObjectDeleteMixin,
ParticipantsMixin,
RetrieveMixin,
SaveMixin,
SubscribableMixin,
TimeTrackingMixin,
TodoMixin,
UserAgentDetailMixin,
)
from .award_emojis import ProjectIssueAwardEmojiManager
from .discussions import ProjectIssueDiscussionManager
from .events import (
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/jobs.py
@@ -1,7 +1,7 @@
from gitlab import cli, utils
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import RefreshMixin, RetrieveMixin


__all__ = [
Expand Down
13 changes: 11 additions & 2 deletions gitlab/v4/objects/labels.py
@@ -1,6 +1,15 @@
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import (
CreateMixin,
DeleteMixin,
ListMixin,
ObjectDeleteMixin,
RetrieveMixin,
SaveMixin,
SubscribableMixin,
UpdateMixin,
)


__all__ = [
Expand Down
3 changes: 1 addition & 2 deletions gitlab/v4/objects/ldap.py
@@ -1,6 +1,5 @@
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject, RESTObjectList


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/members.py
@@ -1,7 +1,7 @@
from gitlab import cli
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin


__all__ = [
Expand Down
12 changes: 10 additions & 2 deletions gitlab/v4/objects/merge_request_approvals.py
@@ -1,6 +1,14 @@
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import (
CreateMixin,
DeleteMixin,
GetWithoutIdMixin,
ListMixin,
ObjectDeleteMixin,
SaveMixin,
UpdateMixin,
)


__all__ = [
Expand Down
14 changes: 12 additions & 2 deletions gitlab/v4/objects/merge_requests.py
@@ -1,7 +1,17 @@
from gitlab import cli, types
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject, RESTObjectList
from gitlab.mixins import (
CRUDMixin,
ListMixin,
ObjectDeleteMixin,
ParticipantsMixin,
RetrieveMixin,
SaveMixin,
SubscribableMixin,
TimeTrackingMixin,
TodoMixin,
)
from .commits import ProjectCommit, ProjectCommitManager
from .issues import ProjectIssue, ProjectIssueManager
from .merge_request_approvals import (
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/milestones.py
@@ -1,7 +1,7 @@
from gitlab import cli
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject, RESTObjectList
from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
from .issues import GroupIssue, GroupIssueManager, ProjectIssue, ProjectIssueManager
from .merge_requests import (
ProjectMergeRequest,
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/namespaces.py
@@ -1,5 +1,5 @@
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import RetrieveMixin


__all__ = [
Expand Down

0 comments on commit c83eaf4

Please sign in to comment.