Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: add isort as a checker#1463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 2 commits intopython-gitlab:masterfromJohnVillalovos:jlvillal/isort
May 25, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions.github/workflows/lint.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,3 +32,5 @@ jobs:
run: tox -e pep8
- name: Run mypy static typing checker (http://mypy-lang.org/)
run: tox -e mypy
- name: Run isort import order checker (https://pycqa.github.io/isort/)
run: tox -e isort -- --check
1 change: 0 additions & 1 deletiongitlab/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,5 +31,4 @@
from gitlab.const import * # noqa: F401,F403
from gitlab.exceptions import * # noqa: F401,F403


warnings.filterwarnings("default", category=DeprecationWarning, module="^gitlab")
1 change: 0 additions & 1 deletiongitlab/__main__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import gitlab.cli


if __name__ == "__main__":
gitlab.cli.main()
3 changes: 2 additions & 1 deletiongitlab/base.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,9 +19,10 @@
from types import ModuleType
from typing import Any, Dict, Iterable, NamedTuple, Optional, Tuple, Type

from .client import Gitlab, GitlabList
from gitlab import types as g_types

from .client import Gitlab, GitlabList

__all__ = [
"RequiredOptional",
"RESTObject",
Expand Down
1 change: 0 additions & 1 deletiongitlab/cli.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,7 +28,6 @@
import gitlab.config
from gitlab.base import RESTObject


# This regex is based on:
# https://github.com/jpvanhal/inflection/blob/master/inflection/__init__.py
camel_upperlower_regex = re.compile(r"([A-Z]+)([A-Z][a-z])")
Expand Down
6 changes: 2 additions & 4 deletionsgitlab/client.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,17 +17,16 @@
"""Wrapper for the GitLab API."""

import time
from typing importcast, Any, Dict, List, Optional, Tuple, TYPE_CHECKING, Union
from typing importAny, cast, Dict, List, Optional, Tuple, TYPE_CHECKING, Union

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 requests_toolbelt.multipart.encoder import MultipartEncoder # type: ignore


REDIRECT_MSG = (
"python-gitlab detected an http to https redirection. You "
Expand DownExpand Up@@ -385,7 +384,6 @@ def _set_auth_info(self) -> None:

def enable_debug(self) -> None:
import logging

from http.client import HTTPConnection # noqa

HTTPConnection.debuglevel = 1 # type: ignore
Expand Down
4 changes: 2 additions & 2 deletionsgitlab/config.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,12 +15,12 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import os
import configparser
import os
import shlex
import subprocess
from typing import List, Optional, Union
from os.path import expanduser, expandvars
from typing import List, Optional, Union

from gitlab.const import USER_AGENT

Expand Down
1 change: 0 additions & 1 deletiongitlab/const.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,6 @@

from gitlab.__version__ import __title__, __version__


NO_ACCESS: int = 0
MINIMAL_ACCESS: int = 5
GUEST_ACCESS: int = 10
Expand Down
2 changes: 1 addition & 1 deletiongitlab/exceptions.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import functools
from typing import Any, Callable, cast, Optional, Type,TypeVar, TYPE_CHECKING, Union
from typing import Any, Callable, cast, Optional, Type,TYPE_CHECKING, TypeVar, Union


class GitlabError(Exception):
Expand Down
5 changes: 2 additions & 3 deletionsgitlab/mixins.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import warnings
from types import ModuleType
from typing import (
Any,
Expand All@@ -31,12 +32,10 @@
import requests

import gitlab
from gitlab import base
from gitlab import cli
from gitlab import base, cli
from gitlab import exceptions as exc
from gitlab import types as g_types
from gitlab import utils
import warnings

__all__ = [
"GetMixin",
Expand Down
1 change: 1 addition & 0 deletionsgitlab/tests/conftest.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
import pytest

import gitlab


Expand Down
2 changes: 1 addition & 1 deletiongitlab/tests/mixins/test_meta_mixins.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,8 +5,8 @@
GetMixin,
ListMixin,
NoUpdateMixin,
UpdateMixin,
RetrieveMixin,
UpdateMixin,
)


Expand Down
1 change: 0 additions & 1 deletiongitlab/tests/mixins/test_mixin_methods.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import pytest

from httmock import HTTMock, response, urlmatch # noqa

from gitlab import base
Expand Down
1 change: 0 additions & 1 deletiongitlab/tests/objects/test_appearance.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,6 @@
import pytest
import responses


title = "GitLab Test Instance"
description = "gitlab-test.example.com"
new_title = "new-title"
Expand Down
1 change: 0 additions & 1 deletiongitlab/tests/objects/test_applications.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,6 @@
import pytest
import responses


title = "GitLab Test Instance"
description = "gitlab-test.example.com"
new_title = "new-title"
Expand Down
2 changes: 1 addition & 1 deletiongitlab/tests/objects/test_badges.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@
import pytest
import responses

from gitlab.v4.objects importProjectBadge, GroupBadge
from gitlab.v4.objects importGroupBadge, ProjectBadge

link_url = (
"http://example.com/ci_status.svg?project=example-org/example-project&ref=master"
Expand Down
1 change: 0 additions & 1 deletiongitlab/tests/objects/test_deploy_tokens.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,6 @@

from gitlab.v4.objects import ProjectDeployToken


create_content = {
"id": 1,
"name": "test_deploy_token",
Expand Down
1 change: 0 additions & 1 deletiongitlab/tests/objects/test_job_artifacts.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,6 @@
import pytest
import responses


ref_name = "master"
job = "build"

Expand Down
1 change: 0 additions & 1 deletiongitlab/tests/objects/test_jobs.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,6 @@

from gitlab.v4.objects import ProjectJob


job_content = {
"commit": {
"author_email": "admin@example.com",
Expand Down
1 change: 0 additions & 1 deletiongitlab/tests/objects/test_packages.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,6 @@

from gitlab.v4.objects import GroupPackage, ProjectPackage, ProjectPackageFile


package_content = {
"id": 1,
"name": "com/mycompany/my-app",
Expand Down
1 change: 0 additions & 1 deletiongitlab/tests/objects/test_pipelines.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,6 @@

from gitlab.v4.objects import ProjectPipeline


pipeline_content = {
"id": 46,
"project_id": 1,
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,6 @@

import gitlab


approval_rule_id = 1
approval_rule_name = "security"
approvals_required = 3
Expand Down
1 change: 0 additions & 1 deletiongitlab/tests/objects/test_projects.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,6 @@

from gitlab.v4.objects import Project


project_content = {"name": "name", "id": 1}
import_content = {
"id": 1,
Expand Down
2 changes: 1 addition & 1 deletiongitlab/tests/objects/test_resource_label_events.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,9 +6,9 @@
import responses

from gitlab.v4.objects import (
GroupEpicResourceLabelEvent,
ProjectIssueResourceLabelEvent,
ProjectMergeRequestResourceLabelEvent,
GroupEpicResourceLabelEvent,
)


Expand Down
1 change: 0 additions & 1 deletiongitlab/tests/objects/test_resource_state_events.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,6 @@
ProjectMergeRequestResourceStateEvent,
)


issue_event_content = {"id": 1, "resource_type": "Issue"}
mr_event_content = {"id": 1, "resource_type": "MergeRequest"}

Expand Down
1 change: 0 additions & 1 deletiongitlab/tests/objects/test_runners.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,6 @@

import gitlab


runner_detail = {
"active": True,
"architecture": "amd64",
Expand Down
1 change: 0 additions & 1 deletiongitlab/tests/objects/test_snippets.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,6 @@
import pytest
import responses


title = "Example Snippet Title"
visibility = "private"
new_title = "new-title"
Expand Down
1 change: 0 additions & 1 deletiongitlab/tests/objects/test_todos.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,6 @@

from gitlab.v4.objects import Todo


with open(os.path.dirname(__file__) + "/../data/todo.json", "r") as json_file:
todo_content = json_file.read()
json_content = json.loads(todo_content)
Expand Down
1 change: 0 additions & 1 deletiongitlab/tests/objects/test_variables.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,7 +12,6 @@

from gitlab.v4.objects import GroupVariable, ProjectVariable, Variable


key = "TEST_VARIABLE_1"
value = "TEST_1"
new_value = "TEST_2"
Expand Down
3 changes: 2 additions & 1 deletiongitlab/tests/test_base.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,9 +17,10 @@

import pickle

from gitlab import base
import pytest

from gitlab import base


class FakeGitlab(object):
pass
Expand Down
3 changes: 1 addition & 2 deletionsgitlab/tests/test_cli.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,10 +17,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import argparse
import io
import os
import tempfile
import io

from contextlib import redirect_stderr # noqa: H302

import pytest
Expand Down
5 changes: 2 additions & 3 deletionsgitlab/tests/test_config.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,15 +15,14 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import io
import os
from textwrap import dedent

import mock
import io

from gitlab import config, USER_AGENT
import pytest

from gitlab import config, USER_AGENT

custom_user_agent = "my-package/1.0.0"

Expand Down
1 change: 0 additions & 1 deletiongitlab/tests/test_gitlab.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,7 +24,6 @@
from gitlab import Gitlab, GitlabList, USER_AGENT
from gitlab.v4.objects import CurrentUser


username = "username"
user_id = 1

Expand Down
3 changes: 1 addition & 2 deletionsgitlab/tests/test_gitlab_http_methods.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
import pytest
import requests

from httmock import HTTMock, urlmatch, response
from httmock import HTTMock, response, urlmatch

from gitlab import GitlabHttpError, GitlabList, GitlabParsingError

Expand Down
2 changes: 1 addition & 1 deletiongitlab/v4/cli.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,8 +22,8 @@

import gitlab
import gitlab.base
from gitlab import cli
import gitlab.v4.objects
from gitlab import cli


class GitlabCLI(object):
Expand Down
5 changes: 2 additions & 3 deletionsgitlab/v4/objects/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,8 +29,8 @@
from .container_registry import *
from .custom_attributes import *
from .deploy_keys import *
from .deployments import *
from .deploy_tokens import *
from .deployments import *
from .discussions import *
from .environments import *
from .epics import *
Expand All@@ -54,6 +54,7 @@
from .notification_settings import *
from .packages import *
from .pages import *
from .personal_access_tokens import *
from .pipelines import *
from .projects import *
from .push_rules import *
Expand All@@ -71,8 +72,6 @@
from .users import *
from .variables import *
from .wikis import *
from .personal_access_tokens import *


# TODO: deprecate these in favor of gitlab.const.*
VISIBILITY_PRIVATE = "private"
Expand Down
1 change: 0 additions & 1 deletiongitlab/v4/objects/access_requests.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,6 @@
ObjectDeleteMixin,
)


__all__ = [
"GroupAccessRequest",
"GroupAccessRequestManager",
Expand Down
1 change: 0 additions & 1 deletiongitlab/v4/objects/appearance.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,6 @@
from gitlab.base import RequiredOptional, RESTManager, RESTObject
from gitlab.mixins import GetWithoutIdMixin, SaveMixin, UpdateMixin


__all__ = [
"ApplicationAppearance",
"ApplicationAppearanceManager",
Expand Down
1 change: 0 additions & 1 deletiongitlab/v4/objects/award_emojis.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
from gitlab.base import RequiredOptional, RESTManager, RESTObject
from gitlab.mixins import NoUpdateMixin, ObjectDeleteMixin


__all__ = [
"ProjectIssueAwardEmoji",
"ProjectIssueAwardEmojiManager",
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp