diff options
author | John L. Villalovos <john@sodarock.com> | 2021-04-17 14:20:05 -0700 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2021-04-18 08:24:40 -0700 |
commit | ff21eb664871904137e6df18308b6e90290ad490 (patch) | |
tree | 27d27ca27dd6aad41de74fa4fcf2a1c93b29bd24 | |
parent | 630901b30911af01da5543ca609bd27bc5a1a44c (diff) | |
download | gitlab-ff21eb664871904137e6df18308b6e90290ad490.tar.gz |
chore: fix F401 errors reported by flake8
F401: Module imported but unused
https://www.flake8rules.com/rules/F401.html
-rw-r--r-- | gitlab/__init__.py | 10 | ||||
-rw-r--r-- | gitlab/cli.py | 2 | ||||
-rw-r--r-- | gitlab/mixins.py | 1 | ||||
-rw-r--r-- | gitlab/tests/objects/test_bridges.py | 4 | ||||
-rw-r--r-- | gitlab/tests/objects/test_submodules.py | 2 | ||||
-rw-r--r-- | gitlab/tests/test_config.py | 1 | ||||
-rw-r--r-- | gitlab/tests/test_gitlab_http_methods.py | 2 | ||||
-rw-r--r-- | gitlab/v4/objects/commits.py | 2 | ||||
-rw-r--r-- | gitlab/v4/objects/discussions.py | 2 | ||||
-rw-r--r-- | gitlab/v4/objects/epics.py | 2 | ||||
-rw-r--r-- | gitlab/v4/objects/events.py | 1 | ||||
-rw-r--r-- | gitlab/v4/objects/groups.py | 38 | ||||
-rw-r--r-- | gitlab/v4/objects/issues.py | 8 | ||||
-rw-r--r-- | gitlab/v4/objects/merge_requests.py | 10 | ||||
-rw-r--r-- | gitlab/v4/objects/milestones.py | 1 | ||||
-rw-r--r-- | gitlab/v4/objects/notes.py | 4 | ||||
-rw-r--r-- | gitlab/v4/objects/pipelines.py | 2 | ||||
-rw-r--r-- | gitlab/v4/objects/projects.py | 85 | ||||
-rw-r--r-- | gitlab/v4/objects/releases.py | 2 | ||||
-rw-r--r-- | gitlab/v4/objects/repositories.py | 2 | ||||
-rw-r--r-- | gitlab/v4/objects/services.py | 1 | ||||
-rw-r--r-- | gitlab/v4/objects/snippets.py | 6 | ||||
-rw-r--r-- | gitlab/v4/objects/users.py | 4 | ||||
-rw-r--r-- | tox.ini | 2 |
24 files changed, 93 insertions, 101 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py index b264e5a..4d3ebfb 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -18,8 +18,8 @@ import warnings -import gitlab.config -from gitlab.__version__ import ( +import gitlab.config # noqa: F401 +from gitlab.__version__ import ( # noqa: F401 __author__, __copyright__, __email__, @@ -27,9 +27,9 @@ from gitlab.__version__ import ( __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") diff --git a/gitlab/cli.py b/gitlab/cli.py index bd2c13d..ce50406 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -23,7 +23,7 @@ import re 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])") diff --git a/gitlab/mixins.py b/gitlab/mixins.py index 9fce3da..ea6f3a8 100644 --- a/gitlab/mixins.py +++ b/gitlab/mixins.py @@ -22,7 +22,6 @@ from typing import ( Dict, List, Optional, - Tuple, Type, TYPE_CHECKING, Union, diff --git a/gitlab/tests/objects/test_bridges.py b/gitlab/tests/objects/test_bridges.py index ea8c634..4d39186 100644 --- a/gitlab/tests/objects/test_bridges.py +++ b/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 diff --git a/gitlab/tests/objects/test_submodules.py b/gitlab/tests/objects/test_submodules.py index 539af7b..69c1cd7 100644 --- a/gitlab/tests/objects/test_submodules.py +++ b/gitlab/tests/objects/test_submodules.py @@ -4,8 +4,6 @@ GitLab API: https://docs.gitlab.com/ce/api/repository_submodules.html import pytest import responses -from gitlab.v4.objects import Project - @pytest.fixture def resp_update_submodule(): diff --git a/gitlab/tests/test_config.py b/gitlab/tests/test_config.py index b456cff..18b54c8 100644 --- a/gitlab/tests/test_config.py +++ b/gitlab/tests/test_config.py @@ -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 diff --git a/gitlab/tests/test_gitlab_http_methods.py b/gitlab/tests/test_gitlab_http_methods.py index 7d9e61e..020fabf 100644 --- a/gitlab/tests/test_gitlab_http_methods.py +++ b/gitlab/tests/test_gitlab_http_methods.py @@ -3,7 +3,7 @@ import requests from httmock import HTTMock, urlmatch, response -from gitlab import * +from gitlab import GitlabHttpError, GitlabList, GitlabParsingError def test_build_url(gl): diff --git a/gitlab/v4/objects/commits.py b/gitlab/v4/objects/commits.py index bb81407..037a90d 100644 --- a/gitlab/v4/objects/commits.py +++ b/gitlab/v4/objects/commits.py @@ -2,7 +2,7 @@ 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 .discussions import ProjectCommitDiscussionManager +from .discussions import ProjectCommitDiscussionManager # noqa: F401 __all__ = [ diff --git a/gitlab/v4/objects/discussions.py b/gitlab/v4/objects/discussions.py index 3477158..2209185 100644 --- a/gitlab/v4/objects/discussions.py +++ b/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, diff --git a/gitlab/v4/objects/epics.py b/gitlab/v4/objects/epics.py index 600378d..023d0a6 100644 --- a/gitlab/v4/objects/epics.py +++ b/gitlab/v4/objects/epics.py @@ -10,7 +10,7 @@ from gitlab.mixins import ( SaveMixin, UpdateMixin, ) -from .events import GroupEpicResourceLabelEventManager +from .events import GroupEpicResourceLabelEventManager # noqa: F401 __all__ = [ diff --git a/gitlab/v4/objects/events.py b/gitlab/v4/objects/events.py index d1c3cb4..98936da 100644 --- a/gitlab/v4/objects/events.py +++ b/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 diff --git a/gitlab/v4/objects/groups.py b/gitlab/v4/objects/groups.py index 588c506..bc83889 100644 --- a/gitlab/v4/objects/groups.py +++ b/gitlab/v4/objects/groups.py @@ -2,25 +2,25 @@ from gitlab import cli, types 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__ = [ diff --git a/gitlab/v4/objects/issues.py b/gitlab/v4/objects/issues.py index 4da7f91..1854eb3 100644 --- a/gitlab/v4/objects/issues.py +++ b/gitlab/v4/objects/issues.py @@ -15,13 +15,13 @@ from gitlab.mixins import ( 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__ = [ diff --git a/gitlab/v4/objects/merge_requests.py b/gitlab/v4/objects/merge_requests.py index f9b305a..1491793 100644 --- a/gitlab/v4/objects/merge_requests.py +++ b/gitlab/v4/objects/merge_requests.py @@ -14,14 +14,14 @@ from gitlab.mixins import ( ) 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, ) diff --git a/gitlab/v4/objects/milestones.py b/gitlab/v4/objects/milestones.py index 748f0c6..463fbf6 100644 --- a/gitlab/v4/objects/milestones.py +++ b/gitlab/v4/objects/milestones.py @@ -7,7 +7,6 @@ from .merge_requests import ( ProjectMergeRequest, ProjectMergeRequestManager, GroupMergeRequest, - GroupMergeRequestManager, ) diff --git a/gitlab/v4/objects/notes.py b/gitlab/v4/objects/notes.py index 362f901..6fa50b9 100644 --- a/gitlab/v4/objects/notes.py +++ b/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, @@ -11,7 +9,7 @@ from gitlab.mixins import ( SaveMixin, UpdateMixin, ) -from .award_emojis import ( +from .award_emojis import ( # noqa: F401 ProjectIssueNoteAwardEmojiManager, ProjectMergeRequestNoteAwardEmojiManager, ProjectSnippetNoteAwardEmojiManager, diff --git a/gitlab/v4/objects/pipelines.py b/gitlab/v4/objects/pipelines.py index 703d40b..bafab9b 100644 --- a/gitlab/v4/objects/pipelines.py +++ b/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 ( diff --git a/gitlab/v4/objects/projects.py b/gitlab/v4/objects/projects.py index c78c8c9..3dba95d 100644 --- a/gitlab/v4/objects/projects.py +++ b/gitlab/v4/objects/projects.py @@ -11,55 +11,58 @@ from gitlab.mixins import ( 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__ = [ diff --git a/gitlab/v4/objects/releases.py b/gitlab/v4/objects/releases.py index 2c549b1..ea74adb 100644 --- a/gitlab/v4/objects/releases.py +++ b/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 diff --git a/gitlab/v4/objects/repositories.py b/gitlab/v4/objects/repositories.py index 6a04174..a171ffb 100644 --- a/gitlab/v4/objects/repositories.py +++ b/gitlab/v4/objects/repositories.py @@ -4,7 +4,7 @@ GitLab API: https://docs.gitlab.com/ee/api/repositories.html 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 diff --git a/gitlab/v4/objects/services.py b/gitlab/v4/objects/services.py index c638336..17bf63a 100644 --- a/gitlab/v4/objects/services.py +++ b/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, diff --git a/gitlab/v4/objects/snippets.py b/gitlab/v4/objects/snippets.py index 6159442..330cc8c 100644 --- a/gitlab/v4/objects/snippets.py +++ b/gitlab/v4/objects/snippets.py @@ -3,9 +3,9 @@ from gitlab import exceptions as exc 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__ = [ diff --git a/gitlab/v4/objects/users.py b/gitlab/v4/objects/users.py index 940cf07..c90a7c9 100644 --- a/gitlab/v4/objects/users.py +++ b/gitlab/v4/objects/users.py @@ -14,8 +14,8 @@ from gitlab.mixins import ( UpdateMixin, ) -from .custom_attributes import UserCustomAttributeManager -from .events import UserEventManager +from .custom_attributes import UserCustomAttributeManager # noqa: F401 +from .events import UserEventManager # noqa: F401 __all__ = [ @@ -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 |