Skip to content

Commit 4e68d32

Browse files
nejchJohnVillalovos
authored andcommitted
chore: adapt style for black v24
1 parent f59aee3 commit 4e68d32

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+54
-15
lines changed

gitlab/_backends/protocol.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
class BackendResponse(Protocol):
1515
@abc.abstractmethod
16-
def __init__(self, response: requests.Response) -> None:
17-
...
16+
def __init__(self, response: requests.Response) -> None: ...
1817

1918

2019
class Backend(Protocol):
@@ -30,5 +29,4 @@ def http_request(
3029
verify: Optional[Union[bool, str]],
3130
stream: Optional[bool],
3231
**kwargs: Any,
33-
) -> BackendResponse:
34-
...
32+
) -> BackendResponse: ...

gitlab/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040

4141

4242
class Gitlab:
43-
4443
"""Represents a GitLab server connection.
4544
4645
Args:

gitlab/v4/objects/artifacts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
GitLab API:
33
https://docs.gitlab.com/ee/api/job_artifacts.html
44
"""
5+
56
from typing import Any, Callable, Iterator, Optional, TYPE_CHECKING, Union
67

78
import requests

gitlab/v4/objects/audit_events.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
GitLab API:
33
https://docs.gitlab.com/ee/api/audit_events.html
44
"""
5+
56
from typing import Any, cast, Union
67

78
from gitlab.base import RESTManager, RESTObject

gitlab/v4/objects/deployments.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
GitLab API:
33
https://docs.gitlab.com/ee/api/deployments.html
44
"""
5+
56
from typing import Any, cast, Dict, Optional, TYPE_CHECKING, Union
67

78
from gitlab import cli

gitlab/v4/objects/features.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
GitLab API:
33
https://docs.gitlab.com/ee/api/features.html
44
"""
5+
56
from typing import Any, Optional, TYPE_CHECKING, Union
67

78
from gitlab import exceptions as exc

gitlab/v4/objects/merge_requests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
https://docs.gitlab.com/ee/api/merge_requests.html
44
https://docs.gitlab.com/ee/api/merge_request_approvals.html
55
"""
6+
67
from typing import Any, cast, Dict, Optional, TYPE_CHECKING, Union
78

89
import requests

gitlab/v4/objects/projects.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
GitLab API:
33
https://docs.gitlab.com/ee/api/projects.html
44
"""
5+
56
from typing import (
67
Any,
78
Callable,

gitlab/v4/objects/repositories.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
Currently this module only contains repository-related methods for projects.
55
"""
6+
67
from typing import Any, Callable, Dict, Iterator, List, Optional, TYPE_CHECKING, Union
78

89
import requests

gitlab/v4/objects/secure_files.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
GitLab API:
33
https://docs.gitlab.com/ee/api/secure_files.html
44
"""
5+
56
from typing import Any, Callable, cast, Iterator, Optional, TYPE_CHECKING, Union
67

78
import requests

gitlab/v4/objects/users.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
https://docs.gitlab.com/ee/api/users.html
44
https://docs.gitlab.com/ee/api/projects.html#list-projects-starred-by-a-user
55
"""
6+
67
from typing import Any, cast, Dict, List, Optional, Union
78

89
import requests

gitlab/v4/objects/variables.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
https://docs.gitlab.com/ee/api/project_level_variables.html
55
https://docs.gitlab.com/ee/api/group_level_variables.html
66
"""
7+
78
from typing import Any, cast, Union
89

910
from gitlab.base import RESTManager, RESTObject

tests/functional/api/test_keys.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
GitLab API:
33
https://docs.gitlab.com/ce/api/keys.html
44
"""
5+
56
import base64
67
import hashlib
78

tests/functional/api/test_packages.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
https://docs.gitlab.com/ce/api/packages.html
44
https://docs.gitlab.com/ee/user/packages/generic_packages
55
"""
6+
67
from collections.abc import Iterator
78

89
from gitlab.v4.objects import GenericPackage

tests/functional/api/test_users.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
https://docs.gitlab.com/ee/api/users.html
44
https://docs.gitlab.com/ee/api/users.html#delete-authentication-identity-from-user
55
"""
6+
67
import requests
78

89

tests/functional/fixtures/docker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
pytest-docker fixture overrides.
33
See https://github.com/avast/pytest-docker#available-fixtures.
44
"""
5+
56
import pytest
67

78

tests/unit/meta/test_ensure_type_hints.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Original notes by John L. Villalovos
55
66
"""
7+
78
import dataclasses
89
import functools
910
import inspect

tests/unit/meta/test_imports.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
`gitlab/v4/objects/__init__.py`
44
55
"""
6+
67
import pkgutil
78
from typing import Set
89

tests/unit/meta/test_mro.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Wrongv4Object(RESTObject, Mixin):
4242
Almost all classes in gitlab/v4/objects/*py were already correct before this
4343
check was added.
4444
"""
45+
4546
import inspect
4647

4748
import pytest
@@ -53,11 +54,9 @@ def test_show_issue() -> None:
5354
"""Test case to demonstrate the TypeError that occurs"""
5455

5556
class RESTObject:
56-
def __init__(self, manager: str, attrs: int) -> None:
57-
...
57+
def __init__(self, manager: str, attrs: int) -> None: ...
5858

59-
class Mixin(RESTObject):
60-
...
59+
class Mixin(RESTObject): ...
6160

6261
with pytest.raises(TypeError) as exc_info:
6362
# Wrong ordering here
@@ -72,8 +71,7 @@ class Wrongv4Object(RESTObject, Mixin): # type: ignore
7271
assert "MRO" in exc_info.exconly()
7372

7473
# Correctly ordered class, no exception
75-
class Correctv4Object(Mixin, RESTObject):
76-
...
74+
class Correctv4Object(Mixin, RESTObject): ...
7775

7876

7977
def test_mros() -> None:

tests/unit/objects/test_badges.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
GitLab API: https://docs.gitlab.com/ee/api/project_badges.html
33
GitLab API: https://docs.gitlab.com/ee/api/group_badges.html
44
"""
5+
56
import re
67

78
import pytest

tests/unit/objects/test_bridges.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ee/api/jobs.html#list-pipeline-bridges
33
"""
4+
45
import pytest
56
import responses
67

tests/unit/objects/test_deploy_tokens.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ce/api/deploy_tokens.html
33
"""
4+
45
import pytest
56
import responses
67

tests/unit/objects/test_deployments.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ce/api/deployments.html
33
"""
4+
45
import pytest
56
import responses
67

tests/unit/objects/test_draft_notes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ee/api/draft_notes.html
33
"""
4+
45
from copy import deepcopy
56

67
import pytest

tests/unit/objects/test_environments.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ce/api/environments.html
33
"""
4+
45
import pytest
56
import responses
67

tests/unit/objects/test_issues.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ce/api/issues.html
33
"""
4+
45
import re
56

67
import pytest

tests/unit/objects/test_jobs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ee/api/jobs.html
33
"""
4+
45
import pytest
56
import responses
67

tests/unit/objects/test_keys.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ce/api/keys.html
33
"""
4+
45
import pytest
56
import responses
67

tests/unit/objects/test_members.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ee/api/members.html
33
"""
4+
45
import pytest
56
import responses
67

tests/unit/objects/test_merge_request_pipelines.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ee/api/merge_requests.html#list-mr-pipelines
33
"""
4+
45
import pytest
56
import responses
67

tests/unit/objects/test_merge_requests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
https://docs.gitlab.com/ce/api/merge_requests.html
44
https://docs.gitlab.com/ee/api/deployments.html#list-of-merge-requests-associated-with-a-deployment
55
"""
6+
67
import re
78

89
import pytest

tests/unit/objects/test_merge_trains.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
GitLab API:
33
https://docs.gitlab.com/ee/api/merge_trains.html
44
"""
5+
56
import pytest
67
import responses
78

tests/unit/objects/test_packages.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ce/api/packages.html
33
"""
4+
45
import re
56

67
import pytest

tests/unit/objects/test_pipeline_schedules.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ce/api/pipeline_schedules.html
33
"""
4+
45
import pytest
56
import responses
67

tests/unit/objects/test_pipelines.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ee/api/pipelines.html
33
"""
4+
45
import pytest
56
import responses
67

tests/unit/objects/test_project_import_export.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ce/api/project_import_export.html
33
"""
4+
45
import pytest
56
import responses
67

tests/unit/objects/test_project_merge_request_approvals.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ def resp_mr_approval_rules():
133133
mr_ars_content[0]["eligible_approvers"][0]
134134
]
135135

136-
updated_mr_ars_content[
137-
"approvals_required"
138-
] = updated_approval_rule_approvals_required
136+
updated_mr_ars_content["approvals_required"] = (
137+
updated_approval_rule_approvals_required
138+
)
139139

140140
rsps.add(
141141
method=responses.PUT,

tests/unit/objects/test_project_statistics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ce/api/project_statistics.html
33
"""
4+
45
import pytest
56
import responses
67

tests/unit/objects/test_registry_repositories.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ee/api/container_registry.html
33
"""
4+
45
import re
56

67
import pytest

tests/unit/objects/test_releases.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
https://docs.gitlab.com/ee/api/releases/index.html
44
https://docs.gitlab.com/ee/api/releases/links.html
55
"""
6+
67
import re
78

89
import pytest

tests/unit/objects/test_repositories.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
https://docs.gitlab.com/ee/api/repositories.html
44
https://docs.gitlab.com/ee/api/repository_files.html
55
"""
6+
67
from urllib.parse import quote
78

89
import pytest

tests/unit/objects/test_resource_groups.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
GitLab API:
33
https://docs.gitlab.com/ee/api/resource_groups.html
44
"""
5+
56
import pytest
67
import responses
78

tests/unit/objects/test_submodules.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ce/api/repository_submodules.html
33
"""
4+
45
import pytest
56
import responses
67

tests/unit/objects/test_todos.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ce/api/todos.html
33
"""
4+
45
import pytest
56
import responses
67

tests/unit/objects/test_topics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
GitLab API:
33
https://docs.gitlab.com/ce/api/topics.html
44
"""
5+
56
import pytest
67
import responses
78

0 commit comments

Comments
 (0)