Skip to content

Commit

Permalink
chore: fix F401 errors reported by flake8
Browse files Browse the repository at this point in the history
F401: Module imported but unused

https://www.flake8rules.com/rules/F401.html
  • Loading branch information
JohnVillalovos committed Apr 18, 2021
1 parent 630901b commit ff21eb6
Show file tree
Hide file tree
Showing 24 changed files with 93 additions and 101 deletions.
10 changes: 5 additions & 5 deletions gitlab/__init__.py
Expand Up @@ -18,18 +18,18 @@

import warnings

import gitlab.config
from gitlab.__version__ import (
import gitlab.config # noqa: F401
from gitlab.__version__ import ( # noqa: F401
__author__,
__copyright__,
__email__,
__license__,
__title__,
__version__,
)
from gitlab.client import Gitlab, GitlabList
from gitlab.const import * # noqa
from gitlab.exceptions import * # noqa
from gitlab.client import Gitlab, GitlabList # noqa: F401
from gitlab.const import * # noqa: F401,F403
from gitlab.exceptions import * # noqa: F401,F403


warnings.filterwarnings("default", category=DeprecationWarning, module="^gitlab")
2 changes: 1 addition & 1 deletion gitlab/cli.py
Expand Up @@ -23,7 +23,7 @@
import sys
from typing import Any, Callable, Dict, Optional, Tuple, Union

import gitlab.config
import gitlab.config # noqa: F401

camel_re = re.compile("(.)([A-Z])")

Expand Down
1 change: 0 additions & 1 deletion gitlab/mixins.py
Expand Up @@ -22,7 +22,6 @@
Dict,
List,
Optional,
Tuple,
Type,
TYPE_CHECKING,
Union,
Expand Down
4 changes: 1 addition & 3 deletions gitlab/tests/objects/test_bridges.py
@@ -1,12 +1,10 @@
"""
GitLab API: https://docs.gitlab.com/ee/api/jobs.html#list-pipeline-bridges
"""
import re

import pytest
import responses

from gitlab.v4.objects import Project, ProjectPipelineBridge
from gitlab.v4.objects import ProjectPipelineBridge


@pytest.fixture
Expand Down
2 changes: 0 additions & 2 deletions gitlab/tests/objects/test_submodules.py
Expand Up @@ -4,8 +4,6 @@
import pytest
import responses

from gitlab.v4.objects import Project


@pytest.fixture
def resp_update_submodule():
Expand Down
1 change: 0 additions & 1 deletion gitlab/tests/test_config.py
Expand Up @@ -16,7 +16,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import os
import unittest
from textwrap import dedent

import mock
Expand Down
2 changes: 1 addition & 1 deletion gitlab/tests/test_gitlab_http_methods.py
Expand Up @@ -3,7 +3,7 @@

from httmock import HTTMock, urlmatch, response

from gitlab import *
from gitlab import GitlabHttpError, GitlabList, GitlabParsingError


def test_build_url(gl):
Expand Down
2 changes: 1 addition & 1 deletion gitlab/v4/objects/commits.py
Expand Up @@ -2,7 +2,7 @@
from gitlab import exceptions as exc
from gitlab.base import RequiredOptional, RESTManager, RESTObject
from gitlab.mixins import CreateMixin, ListMixin, RefreshMixin, RetrieveMixin
from .discussions import ProjectCommitDiscussionManager
from .discussions import ProjectCommitDiscussionManager # noqa: F401


__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion gitlab/v4/objects/discussions.py
@@ -1,6 +1,6 @@
from gitlab.base import RequiredOptional, RESTManager, RESTObject
from gitlab.mixins import CreateMixin, RetrieveMixin, SaveMixin, UpdateMixin
from .notes import (
from .notes import ( # noqa: F401
ProjectCommitDiscussionNoteManager,
ProjectIssueDiscussionNoteManager,
ProjectMergeRequestDiscussionNoteManager,
Expand Down
2 changes: 1 addition & 1 deletion gitlab/v4/objects/epics.py
Expand Up @@ -10,7 +10,7 @@
SaveMixin,
UpdateMixin,
)
from .events import GroupEpicResourceLabelEventManager
from .events import GroupEpicResourceLabelEventManager # noqa: F401


__all__ = [
Expand Down
1 change: 0 additions & 1 deletion gitlab/v4/objects/events.py
@@ -1,4 +1,3 @@
from gitlab import exceptions as exc
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import ListMixin, RetrieveMixin

Expand Down
38 changes: 19 additions & 19 deletions gitlab/v4/objects/groups.py
Expand Up @@ -2,25 +2,25 @@
from gitlab import exceptions as exc
from gitlab.base import RequiredOptional, RESTManager, RESTObject
from gitlab.mixins import CRUDMixin, ListMixin, ObjectDeleteMixin, SaveMixin
from .access_requests import GroupAccessRequestManager
from .audit_events import GroupAuditEventManager
from .badges import GroupBadgeManager
from .boards import GroupBoardManager
from .custom_attributes import GroupCustomAttributeManager
from .export_import import GroupExportManager, GroupImportManager
from .epics import GroupEpicManager
from .issues import GroupIssueManager
from .labels import GroupLabelManager
from .members import GroupMemberManager
from .merge_requests import GroupMergeRequestManager
from .milestones import GroupMilestoneManager
from .notification_settings import GroupNotificationSettingsManager
from .packages import GroupPackageManager
from .projects import GroupProjectManager
from .runners import GroupRunnerManager
from .variables import GroupVariableManager
from .clusters import GroupClusterManager
from .deploy_tokens import GroupDeployTokenManager
from .access_requests import GroupAccessRequestManager # noqa: F401
from .audit_events import GroupAuditEventManager # noqa: F401
from .badges import GroupBadgeManager # noqa: F401
from .boards import GroupBoardManager # noqa: F401
from .custom_attributes import GroupCustomAttributeManager # noqa: F401
from .export_import import GroupExportManager, GroupImportManager # noqa: F401
from .epics import GroupEpicManager # noqa: F401
from .issues import GroupIssueManager # noqa: F401
from .labels import GroupLabelManager # noqa: F401
from .members import GroupMemberManager # noqa: F401
from .merge_requests import GroupMergeRequestManager # noqa: F401
from .milestones import GroupMilestoneManager # noqa: F401
from .notification_settings import GroupNotificationSettingsManager # noqa: F401
from .packages import GroupPackageManager # noqa: F401
from .projects import GroupProjectManager # noqa: F401
from .runners import GroupRunnerManager # noqa: F401
from .variables import GroupVariableManager # noqa: F401
from .clusters import GroupClusterManager # noqa: F401
from .deploy_tokens import GroupDeployTokenManager # noqa: F401


__all__ = [
Expand Down
8 changes: 4 additions & 4 deletions gitlab/v4/objects/issues.py
Expand Up @@ -15,13 +15,13 @@
TodoMixin,
UserAgentDetailMixin,
)
from .award_emojis import ProjectIssueAwardEmojiManager
from .discussions import ProjectIssueDiscussionManager
from .events import (
from .award_emojis import ProjectIssueAwardEmojiManager # noqa: F401
from .discussions import ProjectIssueDiscussionManager # noqa: F401
from .events import ( # noqa: F401
ProjectIssueResourceLabelEventManager,
ProjectIssueResourceMilestoneEventManager,
)
from .notes import ProjectIssueNoteManager
from .notes import ProjectIssueNoteManager # noqa: F401


__all__ = [
Expand Down
10 changes: 5 additions & 5 deletions gitlab/v4/objects/merge_requests.py
Expand Up @@ -14,14 +14,14 @@
)
from .commits import ProjectCommit, ProjectCommitManager
from .issues import ProjectIssue, ProjectIssueManager
from .merge_request_approvals import (
from .merge_request_approvals import ( # noqa: F401
ProjectMergeRequestApprovalManager,
ProjectMergeRequestApprovalRuleManager,
)
from .award_emojis import ProjectMergeRequestAwardEmojiManager
from .discussions import ProjectMergeRequestDiscussionManager
from .notes import ProjectMergeRequestNoteManager
from .events import (
from .award_emojis import ProjectMergeRequestAwardEmojiManager # noqa: F401
from .discussions import ProjectMergeRequestDiscussionManager # noqa: F401
from .notes import ProjectMergeRequestNoteManager # noqa: F401
from .events import ( # noqa: F401
ProjectMergeRequestResourceLabelEventManager,
ProjectMergeRequestResourceMilestoneEventManager,
)
Expand Down
1 change: 0 additions & 1 deletion gitlab/v4/objects/milestones.py
Expand Up @@ -7,7 +7,6 @@
ProjectMergeRequest,
ProjectMergeRequestManager,
GroupMergeRequest,
GroupMergeRequestManager,
)


Expand Down
4 changes: 1 addition & 3 deletions gitlab/v4/objects/notes.py
@@ -1,5 +1,3 @@
from gitlab import cli
from gitlab import exceptions as exc
from gitlab.base import RequiredOptional, RESTManager, RESTObject
from gitlab.mixins import (
CRUDMixin,
Expand All @@ -11,7 +9,7 @@
SaveMixin,
UpdateMixin,
)
from .award_emojis import (
from .award_emojis import ( # noqa: F401
ProjectIssueNoteAwardEmojiManager,
ProjectMergeRequestNoteAwardEmojiManager,
ProjectSnippetNoteAwardEmojiManager,
Expand Down
2 changes: 1 addition & 1 deletion gitlab/v4/objects/pipelines.py
@@ -1,4 +1,4 @@
from gitlab import cli, types
from gitlab import cli
from gitlab import exceptions as exc
from gitlab.base import RequiredOptional, RESTManager, RESTObject
from gitlab.mixins import (
Expand Down
85 changes: 44 additions & 41 deletions gitlab/v4/objects/projects.py
Expand Up @@ -11,55 +11,58 @@
UpdateMixin,
)

from .project_access_tokens import ProjectAccessTokenManager
from .access_requests import ProjectAccessRequestManager
from .badges import ProjectBadgeManager
from .boards import ProjectBoardManager
from .branches import ProjectBranchManager, ProjectProtectedBranchManager
from .clusters import ProjectClusterManager
from .commits import ProjectCommitManager
from .container_registry import ProjectRegistryRepositoryManager
from .custom_attributes import ProjectCustomAttributeManager
from .deploy_keys import ProjectKeyManager
from .deploy_tokens import ProjectDeployTokenManager
from .deployments import ProjectDeploymentManager
from .environments import ProjectEnvironmentManager
from .events import ProjectEventManager
from .audit_events import ProjectAuditEventManager
from .export_import import ProjectExportManager, ProjectImportManager
from .files import ProjectFileManager
from .hooks import ProjectHookManager
from .issues import ProjectIssueManager
from .jobs import ProjectJobManager
from .labels import ProjectLabelManager
from .members import ProjectMemberManager
from .merge_request_approvals import ProjectApprovalManager, ProjectApprovalRuleManager
from .merge_requests import ProjectMergeRequestManager
from .milestones import ProjectMilestoneManager
from .notes import ProjectNoteManager
from .notification_settings import ProjectNotificationSettingsManager
from .packages import ProjectPackageManager
from .pages import ProjectPagesDomainManager
from .pipelines import (
from .project_access_tokens import ProjectAccessTokenManager # noqa: F401
from .access_requests import ProjectAccessRequestManager # noqa: F401
from .badges import ProjectBadgeManager # noqa: F401
from .boards import ProjectBoardManager # noqa: F401
from .branches import ProjectBranchManager, ProjectProtectedBranchManager # noqa: F401
from .clusters import ProjectClusterManager # noqa: F401
from .commits import ProjectCommitManager # noqa: F401
from .container_registry import ProjectRegistryRepositoryManager # noqa: F401
from .custom_attributes import ProjectCustomAttributeManager # noqa: F401
from .deploy_keys import ProjectKeyManager # noqa: F401
from .deploy_tokens import ProjectDeployTokenManager # noqa: F401
from .deployments import ProjectDeploymentManager # noqa: F401
from .environments import ProjectEnvironmentManager # noqa: F401
from .events import ProjectEventManager # noqa: F401
from .audit_events import ProjectAuditEventManager # noqa: F401
from .export_import import ProjectExportManager, ProjectImportManager # noqa: F401
from .files import ProjectFileManager # noqa: F401
from .hooks import ProjectHookManager # noqa: F401
from .issues import ProjectIssueManager # noqa: F401
from .jobs import ProjectJobManager # noqa: F401
from .labels import ProjectLabelManager # noqa: F401
from .members import ProjectMemberManager # noqa: F401
from .merge_request_approvals import ( # noqa: F401
ProjectApprovalManager,
ProjectApprovalRuleManager,
)
from .merge_requests import ProjectMergeRequestManager # noqa: F401
from .milestones import ProjectMilestoneManager # noqa: F401
from .notes import ProjectNoteManager # noqa: F401
from .notification_settings import ProjectNotificationSettingsManager # noqa: F401
from .packages import ProjectPackageManager # noqa: F401
from .pages import ProjectPagesDomainManager # noqa: F401
from .pipelines import ( # noqa: F401
ProjectPipeline,
ProjectPipelineManager,
ProjectPipelineScheduleManager,
)
from .push_rules import ProjectPushRulesManager
from .releases import ProjectReleaseManager
from .push_rules import ProjectPushRulesManager # noqa: F401
from .releases import ProjectReleaseManager # noqa: F401
from .repositories import RepositoryMixin
from .runners import ProjectRunnerManager
from .services import ProjectServiceManager
from .snippets import ProjectSnippetManager
from .statistics import (
from .runners import ProjectRunnerManager # noqa: F401
from .services import ProjectServiceManager # noqa: F401
from .snippets import ProjectSnippetManager # noqa: F401
from .statistics import ( # noqa: F401
ProjectAdditionalStatisticsManager,
ProjectIssuesStatisticsManager,
)
from .tags import ProjectProtectedTagManager, ProjectTagManager
from .triggers import ProjectTriggerManager
from .users import ProjectUserManager
from .variables import ProjectVariableManager
from .wikis import ProjectWikiManager
from .tags import ProjectProtectedTagManager, ProjectTagManager # noqa: F401
from .triggers import ProjectTriggerManager # noqa: F401
from .users import ProjectUserManager # noqa: F401
from .variables import ProjectVariableManager # noqa: F401
from .wikis import ProjectWikiManager # noqa: F401


__all__ = [
Expand Down
2 changes: 0 additions & 2 deletions gitlab/v4/objects/releases.py
@@ -1,5 +1,3 @@
from gitlab import cli
from gitlab import exceptions as exc
from gitlab.base import RequiredOptional, RESTManager, RESTObject
from gitlab.mixins import CRUDMixin, NoUpdateMixin, ObjectDeleteMixin, SaveMixin

Expand Down
2 changes: 1 addition & 1 deletion gitlab/v4/objects/repositories.py
Expand Up @@ -4,7 +4,7 @@
Currently this module only contains repository-related methods for projects.
"""

from gitlab import cli, types, utils
from gitlab import cli, utils
from gitlab import exceptions as exc


Expand Down
1 change: 0 additions & 1 deletion gitlab/v4/objects/services.py
@@ -1,5 +1,4 @@
from gitlab import cli
from gitlab import exceptions as exc
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import (
DeleteMixin,
Expand Down
6 changes: 3 additions & 3 deletions gitlab/v4/objects/snippets.py
Expand Up @@ -3,9 +3,9 @@
from gitlab.base import RequiredOptional, RESTManager, RESTObject
from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin, UserAgentDetailMixin

from .award_emojis import ProjectSnippetAwardEmojiManager
from .discussions import ProjectSnippetDiscussionManager
from .notes import ProjectSnippetNoteManager, ProjectSnippetDiscussionNoteManager
from .award_emojis import ProjectSnippetAwardEmojiManager # noqa: F401
from .discussions import ProjectSnippetDiscussionManager # noqa: F401
from .notes import ProjectSnippetNoteManager # noqa: F401


__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/users.py
Expand Up @@ -14,8 +14,8 @@
UpdateMixin,
)

from .custom_attributes import UserCustomAttributeManager
from .events import UserEventManager
from .custom_attributes import UserCustomAttributeManager # noqa: F401
from .events import UserEventManager # noqa: F401


__all__ = [
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Expand Up @@ -53,6 +53,8 @@ commands = {posargs}
exclude = .git,.venv,.tox,dist,doc,*egg,build,
max-line-length = 88
ignore = E501,H501,H803,W503
per-file-ignores =
gitlab/v4/objects/__init__.py:F401,F403

[testenv:docs]
deps = -r{toxinidir}/rtd-requirements.txt
Expand Down

0 comments on commit ff21eb6

Please sign in to comment.