python-gitlab 5.3.1__py3-none-any.whl → 5.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gitlab/_version.py +1 -1
- gitlab/client.py +5 -0
- gitlab/const.py +52 -52
- gitlab/mixins.py +36 -1
- gitlab/utils.py +1 -1
- gitlab/v4/objects/__init__.py +1 -0
- gitlab/v4/objects/artifacts.py +93 -3
- gitlab/v4/objects/commits.py +7 -2
- gitlab/v4/objects/files.py +46 -4
- gitlab/v4/objects/issues.py +1 -1
- gitlab/v4/objects/jobs.py +114 -1
- gitlab/v4/objects/labels.py +2 -2
- gitlab/v4/objects/merge_requests.py +2 -0
- gitlab/v4/objects/packages.py +45 -1
- gitlab/v4/objects/projects.py +117 -1
- gitlab/v4/objects/repositories.py +84 -1
- gitlab/v4/objects/secure_files.py +45 -2
- gitlab/v4/objects/snippets.py +79 -2
- gitlab/v4/objects/status_checks.py +52 -0
- {python_gitlab-5.3.1.dist-info → python_gitlab-5.5.0.dist-info}/METADATA +2 -2
- {python_gitlab-5.3.1.dist-info → python_gitlab-5.5.0.dist-info}/RECORD +26 -25
- {python_gitlab-5.3.1.dist-info → python_gitlab-5.5.0.dist-info}/WHEEL +1 -1
- {python_gitlab-5.3.1.dist-info → python_gitlab-5.5.0.dist-info}/AUTHORS +0 -0
- {python_gitlab-5.3.1.dist-info → python_gitlab-5.5.0.dist-info}/COPYING +0 -0
- {python_gitlab-5.3.1.dist-info → python_gitlab-5.5.0.dist-info}/entry_points.txt +0 -0
- {python_gitlab-5.3.1.dist-info → python_gitlab-5.5.0.dist-info}/top_level.txt +0 -0
gitlab/_version.py
CHANGED
gitlab/client.py
CHANGED
@@ -654,6 +654,7 @@ class Gitlab:
|
|
654
654
|
obey_rate_limit: bool = True,
|
655
655
|
retry_transient_errors: Optional[bool] = None,
|
656
656
|
max_retries: int = 10,
|
657
|
+
extra_headers: Optional[Dict[str, Any]] = None,
|
657
658
|
**kwargs: Any,
|
658
659
|
) -> requests.Response:
|
659
660
|
"""Make an HTTP request to the Gitlab server.
|
@@ -675,6 +676,7 @@ class Gitlab:
|
|
675
676
|
or 52x responses. Defaults to False.
|
676
677
|
max_retries: Max retries after 429 or transient errors,
|
677
678
|
set to -1 to retry forever. Defaults to 10.
|
679
|
+
extra_headers: Add and override HTTP headers for the request.
|
678
680
|
**kwargs: Extra options to send to the server (e.g. sudo)
|
679
681
|
|
680
682
|
Returns:
|
@@ -721,6 +723,9 @@ class Gitlab:
|
|
721
723
|
send_data = self._backend.prepare_send_data(files, post_data, raw)
|
722
724
|
opts["headers"]["Content-type"] = send_data.content_type
|
723
725
|
|
726
|
+
if extra_headers is not None:
|
727
|
+
opts["headers"].update(extra_headers)
|
728
|
+
|
724
729
|
retry = utils.Retry(
|
725
730
|
max_retries=max_retries,
|
726
731
|
obey_rate_limit=obey_rate_limit,
|
gitlab/const.py
CHANGED
@@ -9,83 +9,83 @@ class GitlabEnum(str, Enum):
|
|
9
9
|
|
10
10
|
# https://gitlab.com/gitlab-org/gitlab/-/blob/e97357824bedf007e75f8782259fe07435b64fbb/lib/gitlab/access.rb#L12-18
|
11
11
|
class AccessLevel(IntEnum):
|
12
|
-
NO_ACCESS
|
13
|
-
MINIMAL_ACCESS
|
14
|
-
GUEST
|
15
|
-
PLANNER
|
16
|
-
REPORTER
|
17
|
-
DEVELOPER
|
18
|
-
MAINTAINER
|
19
|
-
OWNER
|
20
|
-
ADMIN
|
12
|
+
NO_ACCESS = 0
|
13
|
+
MINIMAL_ACCESS = 5
|
14
|
+
GUEST = 10
|
15
|
+
PLANNER = 15
|
16
|
+
REPORTER = 20
|
17
|
+
DEVELOPER = 30
|
18
|
+
MAINTAINER = 40
|
19
|
+
OWNER = 50
|
20
|
+
ADMIN = 60
|
21
21
|
|
22
22
|
|
23
23
|
# https://gitlab.com/gitlab-org/gitlab/-/blob/e97357824bedf007e75f8782259fe07435b64fbb/lib/gitlab/visibility_level.rb#L23-25
|
24
24
|
class Visibility(GitlabEnum):
|
25
|
-
PRIVATE
|
26
|
-
INTERNAL
|
27
|
-
PUBLIC
|
25
|
+
PRIVATE = "private"
|
26
|
+
INTERNAL = "internal"
|
27
|
+
PUBLIC = "public"
|
28
28
|
|
29
29
|
|
30
30
|
class NotificationLevel(GitlabEnum):
|
31
|
-
DISABLED
|
32
|
-
PARTICIPATING
|
33
|
-
WATCH
|
34
|
-
GLOBAL
|
35
|
-
MENTION
|
36
|
-
CUSTOM
|
31
|
+
DISABLED = "disabled"
|
32
|
+
PARTICIPATING = "participating"
|
33
|
+
WATCH = "watch"
|
34
|
+
GLOBAL = "global"
|
35
|
+
MENTION = "mention"
|
36
|
+
CUSTOM = "custom"
|
37
37
|
|
38
38
|
|
39
39
|
# https://gitlab.com/gitlab-org/gitlab/-/blob/e97357824bedf007e75f8782259fe07435b64fbb/app/views/search/_category.html.haml#L10-37
|
40
40
|
class SearchScope(GitlabEnum):
|
41
41
|
# all scopes (global, group and project)
|
42
|
-
PROJECTS
|
43
|
-
ISSUES
|
44
|
-
MERGE_REQUESTS
|
45
|
-
MILESTONES
|
46
|
-
WIKI_BLOBS
|
47
|
-
COMMITS
|
48
|
-
BLOBS
|
49
|
-
USERS
|
42
|
+
PROJECTS = "projects"
|
43
|
+
ISSUES = "issues"
|
44
|
+
MERGE_REQUESTS = "merge_requests"
|
45
|
+
MILESTONES = "milestones"
|
46
|
+
WIKI_BLOBS = "wiki_blobs"
|
47
|
+
COMMITS = "commits"
|
48
|
+
BLOBS = "blobs"
|
49
|
+
USERS = "users"
|
50
50
|
|
51
51
|
# specific global scope
|
52
|
-
GLOBAL_SNIPPET_TITLES
|
52
|
+
GLOBAL_SNIPPET_TITLES = "snippet_titles"
|
53
53
|
|
54
54
|
# specific project scope
|
55
|
-
PROJECT_NOTES
|
55
|
+
PROJECT_NOTES = "notes"
|
56
56
|
|
57
57
|
|
58
58
|
# https://docs.gitlab.com/ee/api/merge_requests.html#merge-status
|
59
59
|
class DetailedMergeStatus(GitlabEnum):
|
60
60
|
# possible values for the detailed_merge_status field of Merge Requests
|
61
|
-
BLOCKED_STATUS
|
62
|
-
BROKEN_STATUS
|
63
|
-
CHECKING
|
64
|
-
UNCHECKED
|
65
|
-
CI_MUST_PASS
|
66
|
-
CI_STILL_RUNNING
|
67
|
-
DISCUSSIONS_NOT_RESOLVED
|
68
|
-
DRAFT_STATUS
|
69
|
-
EXTERNAL_STATUS_CHECKS
|
70
|
-
MERGEABLE
|
71
|
-
NOT_APPROVED
|
72
|
-
NOT_OPEN
|
73
|
-
POLICIES_DENIED
|
61
|
+
BLOCKED_STATUS = "blocked_status"
|
62
|
+
BROKEN_STATUS = "broken_status"
|
63
|
+
CHECKING = "checking"
|
64
|
+
UNCHECKED = "unchecked"
|
65
|
+
CI_MUST_PASS = "ci_must_pass"
|
66
|
+
CI_STILL_RUNNING = "ci_still_running"
|
67
|
+
DISCUSSIONS_NOT_RESOLVED = "discussions_not_resolved"
|
68
|
+
DRAFT_STATUS = "draft_status"
|
69
|
+
EXTERNAL_STATUS_CHECKS = "external_status_checks"
|
70
|
+
MERGEABLE = "mergeable"
|
71
|
+
NOT_APPROVED = "not_approved"
|
72
|
+
NOT_OPEN = "not_open"
|
73
|
+
POLICIES_DENIED = "policies_denied"
|
74
74
|
|
75
75
|
|
76
76
|
# https://docs.gitlab.com/ee/api/pipelines.html
|
77
77
|
class PipelineStatus(GitlabEnum):
|
78
|
-
CREATED
|
79
|
-
WAITING_FOR_RESOURCE
|
80
|
-
PREPARING
|
81
|
-
PENDING
|
82
|
-
RUNNING
|
83
|
-
SUCCESS
|
84
|
-
FAILED
|
85
|
-
CANCELED
|
86
|
-
SKIPPED
|
87
|
-
MANUAL
|
88
|
-
SCHEDULED
|
78
|
+
CREATED = "created"
|
79
|
+
WAITING_FOR_RESOURCE = "waiting_for_resource"
|
80
|
+
PREPARING = "preparing"
|
81
|
+
PENDING = "pending"
|
82
|
+
RUNNING = "running"
|
83
|
+
SUCCESS = "success"
|
84
|
+
FAILED = "failed"
|
85
|
+
CANCELED = "canceled"
|
86
|
+
SKIPPED = "skipped"
|
87
|
+
MANUAL = "manual"
|
88
|
+
SCHEDULED = "scheduled"
|
89
89
|
|
90
90
|
|
91
91
|
DEFAULT_URL: str = "https://gitlab.com"
|
gitlab/mixins.py
CHANGED
@@ -6,7 +6,9 @@ from typing import (
|
|
6
6
|
Dict,
|
7
7
|
Iterator,
|
8
8
|
List,
|
9
|
+
Literal,
|
9
10
|
Optional,
|
11
|
+
overload,
|
10
12
|
Tuple,
|
11
13
|
Type,
|
12
14
|
TYPE_CHECKING,
|
@@ -612,12 +614,45 @@ class DownloadMixin(_RestObjectBase):
|
|
612
614
|
_updated_attrs: Dict[str, Any]
|
613
615
|
manager: base.RESTManager
|
614
616
|
|
617
|
+
@overload
|
618
|
+
def download(
|
619
|
+
self,
|
620
|
+
streamed: Literal[False] = False,
|
621
|
+
action: None = None,
|
622
|
+
chunk_size: int = 1024,
|
623
|
+
*,
|
624
|
+
iterator: Literal[False] = False,
|
625
|
+
**kwargs: Any,
|
626
|
+
) -> bytes: ...
|
627
|
+
|
628
|
+
@overload
|
629
|
+
def download(
|
630
|
+
self,
|
631
|
+
streamed: bool = False,
|
632
|
+
action: None = None,
|
633
|
+
chunk_size: int = 1024,
|
634
|
+
*,
|
635
|
+
iterator: Literal[True] = True,
|
636
|
+
**kwargs: Any,
|
637
|
+
) -> Iterator[Any]: ...
|
638
|
+
|
639
|
+
@overload
|
640
|
+
def download(
|
641
|
+
self,
|
642
|
+
streamed: Literal[True] = True,
|
643
|
+
action: Optional[Callable[[bytes], Any]] = None,
|
644
|
+
chunk_size: int = 1024,
|
645
|
+
*,
|
646
|
+
iterator: Literal[False] = False,
|
647
|
+
**kwargs: Any,
|
648
|
+
) -> None: ...
|
649
|
+
|
615
650
|
@cli.register_custom_action(cls_names=("GroupExport", "ProjectExport"))
|
616
651
|
@exc.on_http_error(exc.GitlabGetError)
|
617
652
|
def download(
|
618
653
|
self,
|
619
654
|
streamed: bool = False,
|
620
|
-
action: Optional[Callable[[bytes],
|
655
|
+
action: Optional[Callable[[bytes], Any]] = None,
|
621
656
|
chunk_size: int = 1024,
|
622
657
|
*,
|
623
658
|
iterator: bool = False,
|
gitlab/utils.py
CHANGED
gitlab/v4/objects/__init__.py
CHANGED
gitlab/v4/objects/artifacts.py
CHANGED
@@ -3,7 +3,16 @@ GitLab API:
|
|
3
3
|
https://docs.gitlab.com/ee/api/job_artifacts.html
|
4
4
|
"""
|
5
5
|
|
6
|
-
from typing import
|
6
|
+
from typing import (
|
7
|
+
Any,
|
8
|
+
Callable,
|
9
|
+
Iterator,
|
10
|
+
Literal,
|
11
|
+
Optional,
|
12
|
+
overload,
|
13
|
+
TYPE_CHECKING,
|
14
|
+
Union,
|
15
|
+
)
|
7
16
|
|
8
17
|
import requests
|
9
18
|
|
@@ -43,6 +52,45 @@ class ProjectArtifactManager(RESTManager):
|
|
43
52
|
assert path is not None
|
44
53
|
self.gitlab.http_delete(path, **kwargs)
|
45
54
|
|
55
|
+
@overload
|
56
|
+
def download(
|
57
|
+
self,
|
58
|
+
ref_name: str,
|
59
|
+
job: str,
|
60
|
+
streamed: Literal[False] = False,
|
61
|
+
action: None = None,
|
62
|
+
chunk_size: int = 1024,
|
63
|
+
*,
|
64
|
+
iterator: Literal[False] = False,
|
65
|
+
**kwargs: Any,
|
66
|
+
) -> bytes: ...
|
67
|
+
|
68
|
+
@overload
|
69
|
+
def download(
|
70
|
+
self,
|
71
|
+
ref_name: str,
|
72
|
+
job: str,
|
73
|
+
streamed: bool = False,
|
74
|
+
action: None = None,
|
75
|
+
chunk_size: int = 1024,
|
76
|
+
*,
|
77
|
+
iterator: Literal[True] = True,
|
78
|
+
**kwargs: Any,
|
79
|
+
) -> Iterator[Any]: ...
|
80
|
+
|
81
|
+
@overload
|
82
|
+
def download(
|
83
|
+
self,
|
84
|
+
ref_name: str,
|
85
|
+
job: str,
|
86
|
+
streamed: Literal[True] = True,
|
87
|
+
action: Optional[Callable[[bytes], Any]] = None,
|
88
|
+
chunk_size: int = 1024,
|
89
|
+
*,
|
90
|
+
iterator: Literal[False] = False,
|
91
|
+
**kwargs: Any,
|
92
|
+
) -> None: ...
|
93
|
+
|
46
94
|
@cli.register_custom_action(
|
47
95
|
cls_names="ProjectArtifactManager",
|
48
96
|
required=("ref_name", "job"),
|
@@ -54,7 +102,7 @@ class ProjectArtifactManager(RESTManager):
|
|
54
102
|
ref_name: str,
|
55
103
|
job: str,
|
56
104
|
streamed: bool = False,
|
57
|
-
action: Optional[Callable[[bytes],
|
105
|
+
action: Optional[Callable[[bytes], Any]] = None,
|
58
106
|
chunk_size: int = 1024,
|
59
107
|
*,
|
60
108
|
iterator: bool = False,
|
@@ -94,6 +142,48 @@ class ProjectArtifactManager(RESTManager):
|
|
94
142
|
result, streamed, action, chunk_size, iterator=iterator
|
95
143
|
)
|
96
144
|
|
145
|
+
@overload
|
146
|
+
def raw(
|
147
|
+
self,
|
148
|
+
ref_name: str,
|
149
|
+
artifact_path: str,
|
150
|
+
job: str,
|
151
|
+
streamed: Literal[False] = False,
|
152
|
+
action: None = None,
|
153
|
+
chunk_size: int = 1024,
|
154
|
+
*,
|
155
|
+
iterator: Literal[False] = False,
|
156
|
+
**kwargs: Any,
|
157
|
+
) -> bytes: ...
|
158
|
+
|
159
|
+
@overload
|
160
|
+
def raw(
|
161
|
+
self,
|
162
|
+
ref_name: str,
|
163
|
+
artifact_path: str,
|
164
|
+
job: str,
|
165
|
+
streamed: bool = False,
|
166
|
+
action: None = None,
|
167
|
+
chunk_size: int = 1024,
|
168
|
+
*,
|
169
|
+
iterator: Literal[True] = True,
|
170
|
+
**kwargs: Any,
|
171
|
+
) -> Iterator[Any]: ...
|
172
|
+
|
173
|
+
@overload
|
174
|
+
def raw(
|
175
|
+
self,
|
176
|
+
ref_name: str,
|
177
|
+
artifact_path: str,
|
178
|
+
job: str,
|
179
|
+
streamed: Literal[True] = True,
|
180
|
+
action: Optional[Callable[[bytes], Any]] = None,
|
181
|
+
chunk_size: int = 1024,
|
182
|
+
*,
|
183
|
+
iterator: Literal[False] = False,
|
184
|
+
**kwargs: Any,
|
185
|
+
) -> None: ...
|
186
|
+
|
97
187
|
@cli.register_custom_action(
|
98
188
|
cls_names="ProjectArtifactManager",
|
99
189
|
required=("ref_name", "artifact_path", "job"),
|
@@ -105,7 +195,7 @@ class ProjectArtifactManager(RESTManager):
|
|
105
195
|
artifact_path: str,
|
106
196
|
job: str,
|
107
197
|
streamed: bool = False,
|
108
|
-
action: Optional[Callable[[bytes],
|
198
|
+
action: Optional[Callable[[bytes], Any]] = None,
|
109
199
|
chunk_size: int = 1024,
|
110
200
|
*,
|
111
201
|
iterator: bool = False,
|
gitlab/v4/objects/commits.py
CHANGED
@@ -48,7 +48,9 @@ class ProjectCommit(RESTObject):
|
|
48
48
|
|
49
49
|
@cli.register_custom_action(cls_names="ProjectCommit", required=("branch",))
|
50
50
|
@exc.on_http_error(exc.GitlabCherryPickError)
|
51
|
-
def cherry_pick(
|
51
|
+
def cherry_pick(
|
52
|
+
self, branch: str, **kwargs: Any
|
53
|
+
) -> Union[Dict[str, Any], requests.Response]:
|
52
54
|
"""Cherry-pick a commit into a branch.
|
53
55
|
|
54
56
|
Args:
|
@@ -58,10 +60,13 @@ class ProjectCommit(RESTObject):
|
|
58
60
|
Raises:
|
59
61
|
GitlabAuthenticationError: If authentication is not correct
|
60
62
|
GitlabCherryPickError: If the cherry-pick could not be performed
|
63
|
+
|
64
|
+
Returns:
|
65
|
+
The new commit data (*not* a RESTObject)
|
61
66
|
"""
|
62
67
|
path = f"{self.manager.path}/{self.encoded_id}/cherry_pick"
|
63
68
|
post_data = {"branch": branch}
|
64
|
-
self.manager.gitlab.http_post(path, post_data=post_data, **kwargs)
|
69
|
+
return self.manager.gitlab.http_post(path, post_data=post_data, **kwargs)
|
65
70
|
|
66
71
|
@cli.register_custom_action(cls_names="ProjectCommit", optional=("type",))
|
67
72
|
@exc.on_http_error(exc.GitlabGetError)
|
gitlab/v4/objects/files.py
CHANGED
@@ -5,7 +5,9 @@ from typing import (
|
|
5
5
|
Dict,
|
6
6
|
Iterator,
|
7
7
|
List,
|
8
|
+
Literal,
|
8
9
|
Optional,
|
10
|
+
overload,
|
9
11
|
Tuple,
|
10
12
|
TYPE_CHECKING,
|
11
13
|
Union,
|
@@ -51,7 +53,7 @@ class ProjectFile(SaveMixin, ObjectDeleteMixin, RESTObject):
|
|
51
53
|
|
52
54
|
# NOTE(jlvillal): Signature doesn't match SaveMixin.save() so ignore
|
53
55
|
# type error
|
54
|
-
def save( # type: ignore
|
56
|
+
def save( # type: ignore[override]
|
55
57
|
self, branch: str, commit_message: str, **kwargs: Any
|
56
58
|
) -> None:
|
57
59
|
"""Save the changes made to the file to the server.
|
@@ -75,7 +77,7 @@ class ProjectFile(SaveMixin, ObjectDeleteMixin, RESTObject):
|
|
75
77
|
@exc.on_http_error(exc.GitlabDeleteError)
|
76
78
|
# NOTE(jlvillal): Signature doesn't match DeleteMixin.delete() so ignore
|
77
79
|
# type error
|
78
|
-
def delete( # type: ignore
|
80
|
+
def delete( # type: ignore[override]
|
79
81
|
self, branch: str, commit_message: str, **kwargs: Any
|
80
82
|
) -> None:
|
81
83
|
"""Delete the file from the server.
|
@@ -219,7 +221,7 @@ class ProjectFileManager(CreateMixin, UpdateMixin, DeleteMixin, RESTManager):
|
|
219
221
|
@exc.on_http_error(exc.GitlabUpdateError)
|
220
222
|
# NOTE(jlvillal): Signature doesn't match UpdateMixin.update() so ignore
|
221
223
|
# type error
|
222
|
-
def update( # type: ignore
|
224
|
+
def update( # type: ignore[override]
|
223
225
|
self, file_path: str, new_data: Optional[Dict[str, Any]] = None, **kwargs: Any
|
224
226
|
) -> Dict[str, Any]:
|
225
227
|
"""Update an object on the server.
|
@@ -254,7 +256,7 @@ class ProjectFileManager(CreateMixin, UpdateMixin, DeleteMixin, RESTManager):
|
|
254
256
|
@exc.on_http_error(exc.GitlabDeleteError)
|
255
257
|
# NOTE(jlvillal): Signature doesn't match DeleteMixin.delete() so ignore
|
256
258
|
# type error
|
257
|
-
def delete( # type: ignore
|
259
|
+
def delete( # type: ignore[override]
|
258
260
|
self, file_path: str, branch: str, commit_message: str, **kwargs: Any
|
259
261
|
) -> None:
|
260
262
|
"""Delete a file on the server.
|
@@ -274,9 +276,49 @@ class ProjectFileManager(CreateMixin, UpdateMixin, DeleteMixin, RESTManager):
|
|
274
276
|
data = {"branch": branch, "commit_message": commit_message}
|
275
277
|
self.gitlab.http_delete(path, query_data=data, **kwargs)
|
276
278
|
|
279
|
+
@overload
|
280
|
+
def raw(
|
281
|
+
self,
|
282
|
+
file_path: str,
|
283
|
+
ref: Optional[str] = None,
|
284
|
+
streamed: Literal[False] = False,
|
285
|
+
action: None = None,
|
286
|
+
chunk_size: int = 1024,
|
287
|
+
*,
|
288
|
+
iterator: Literal[False] = False,
|
289
|
+
**kwargs: Any,
|
290
|
+
) -> bytes: ...
|
291
|
+
|
292
|
+
@overload
|
293
|
+
def raw(
|
294
|
+
self,
|
295
|
+
file_path: str,
|
296
|
+
ref: Optional[str] = None,
|
297
|
+
streamed: bool = False,
|
298
|
+
action: None = None,
|
299
|
+
chunk_size: int = 1024,
|
300
|
+
*,
|
301
|
+
iterator: Literal[True] = True,
|
302
|
+
**kwargs: Any,
|
303
|
+
) -> Iterator[Any]: ...
|
304
|
+
|
305
|
+
@overload
|
306
|
+
def raw(
|
307
|
+
self,
|
308
|
+
file_path: str,
|
309
|
+
ref: Optional[str] = None,
|
310
|
+
streamed: Literal[True] = True,
|
311
|
+
action: Optional[Callable[[bytes], Any]] = None,
|
312
|
+
chunk_size: int = 1024,
|
313
|
+
*,
|
314
|
+
iterator: Literal[False] = False,
|
315
|
+
**kwargs: Any,
|
316
|
+
) -> None: ...
|
317
|
+
|
277
318
|
@cli.register_custom_action(
|
278
319
|
cls_names="ProjectFileManager",
|
279
320
|
required=("file_path",),
|
321
|
+
optional=("ref",),
|
280
322
|
)
|
281
323
|
@exc.on_http_error(exc.GitlabGetError)
|
282
324
|
def raw(
|
gitlab/v4/objects/issues.py
CHANGED
@@ -302,7 +302,7 @@ class ProjectIssueLinkManager(ListMixin, CreateMixin, DeleteMixin, RESTManager):
|
|
302
302
|
@exc.on_http_error(exc.GitlabCreateError)
|
303
303
|
# NOTE(jlvillal): Signature doesn't match CreateMixin.create() so ignore
|
304
304
|
# type error
|
305
|
-
def create( # type: ignore
|
305
|
+
def create( # type: ignore[override]
|
306
306
|
self, data: Dict[str, Any], **kwargs: Any
|
307
307
|
) -> Tuple[RESTObject, RESTObject]:
|
308
308
|
"""Create a new object.
|
gitlab/v4/objects/jobs.py
CHANGED
@@ -1,4 +1,15 @@
|
|
1
|
-
from typing import
|
1
|
+
from typing import (
|
2
|
+
Any,
|
3
|
+
Callable,
|
4
|
+
cast,
|
5
|
+
Dict,
|
6
|
+
Iterator,
|
7
|
+
Literal,
|
8
|
+
Optional,
|
9
|
+
overload,
|
10
|
+
TYPE_CHECKING,
|
11
|
+
Union,
|
12
|
+
)
|
2
13
|
|
3
14
|
import requests
|
4
15
|
|
@@ -115,6 +126,39 @@ class ProjectJob(RefreshMixin, RESTObject):
|
|
115
126
|
path = f"{self.manager.path}/{self.encoded_id}/artifacts"
|
116
127
|
self.manager.gitlab.http_delete(path, **kwargs)
|
117
128
|
|
129
|
+
@overload
|
130
|
+
def artifacts(
|
131
|
+
self,
|
132
|
+
streamed: Literal[False] = False,
|
133
|
+
action: None = None,
|
134
|
+
chunk_size: int = 1024,
|
135
|
+
*,
|
136
|
+
iterator: Literal[False] = False,
|
137
|
+
**kwargs: Any,
|
138
|
+
) -> bytes: ...
|
139
|
+
|
140
|
+
@overload
|
141
|
+
def artifacts(
|
142
|
+
self,
|
143
|
+
streamed: bool = False,
|
144
|
+
action: None = None,
|
145
|
+
chunk_size: int = 1024,
|
146
|
+
*,
|
147
|
+
iterator: Literal[True] = True,
|
148
|
+
**kwargs: Any,
|
149
|
+
) -> Iterator[Any]: ...
|
150
|
+
|
151
|
+
@overload
|
152
|
+
def artifacts(
|
153
|
+
self,
|
154
|
+
streamed: Literal[True] = True,
|
155
|
+
action: Optional[Callable[[bytes], Any]] = None,
|
156
|
+
chunk_size: int = 1024,
|
157
|
+
*,
|
158
|
+
iterator: Literal[False] = False,
|
159
|
+
**kwargs: Any,
|
160
|
+
) -> None: ...
|
161
|
+
|
118
162
|
@cli.register_custom_action(cls_names="ProjectJob")
|
119
163
|
@exc.on_http_error(exc.GitlabGetError)
|
120
164
|
def artifacts(
|
@@ -156,6 +200,42 @@ class ProjectJob(RefreshMixin, RESTObject):
|
|
156
200
|
result, streamed, action, chunk_size, iterator=iterator
|
157
201
|
)
|
158
202
|
|
203
|
+
@overload
|
204
|
+
def artifact(
|
205
|
+
self,
|
206
|
+
path: str,
|
207
|
+
streamed: Literal[False] = False,
|
208
|
+
action: None = None,
|
209
|
+
chunk_size: int = 1024,
|
210
|
+
*,
|
211
|
+
iterator: Literal[False] = False,
|
212
|
+
**kwargs: Any,
|
213
|
+
) -> bytes: ...
|
214
|
+
|
215
|
+
@overload
|
216
|
+
def artifact(
|
217
|
+
self,
|
218
|
+
path: str,
|
219
|
+
streamed: bool = False,
|
220
|
+
action: None = None,
|
221
|
+
chunk_size: int = 1024,
|
222
|
+
*,
|
223
|
+
iterator: Literal[True] = True,
|
224
|
+
**kwargs: Any,
|
225
|
+
) -> Iterator[Any]: ...
|
226
|
+
|
227
|
+
@overload
|
228
|
+
def artifact(
|
229
|
+
self,
|
230
|
+
path: str,
|
231
|
+
streamed: Literal[True] = True,
|
232
|
+
action: Optional[Callable[[bytes], Any]] = None,
|
233
|
+
chunk_size: int = 1024,
|
234
|
+
*,
|
235
|
+
iterator: Literal[False] = False,
|
236
|
+
**kwargs: Any,
|
237
|
+
) -> None: ...
|
238
|
+
|
159
239
|
@cli.register_custom_action(cls_names="ProjectJob")
|
160
240
|
@exc.on_http_error(exc.GitlabGetError)
|
161
241
|
def artifact(
|
@@ -199,6 +279,39 @@ class ProjectJob(RefreshMixin, RESTObject):
|
|
199
279
|
result, streamed, action, chunk_size, iterator=iterator
|
200
280
|
)
|
201
281
|
|
282
|
+
@overload
|
283
|
+
def trace(
|
284
|
+
self,
|
285
|
+
streamed: Literal[False] = False,
|
286
|
+
action: None = None,
|
287
|
+
chunk_size: int = 1024,
|
288
|
+
*,
|
289
|
+
iterator: Literal[False] = False,
|
290
|
+
**kwargs: Any,
|
291
|
+
) -> bytes: ...
|
292
|
+
|
293
|
+
@overload
|
294
|
+
def trace(
|
295
|
+
self,
|
296
|
+
streamed: bool = False,
|
297
|
+
action: None = None,
|
298
|
+
chunk_size: int = 1024,
|
299
|
+
*,
|
300
|
+
iterator: Literal[True] = True,
|
301
|
+
**kwargs: Any,
|
302
|
+
) -> Iterator[Any]: ...
|
303
|
+
|
304
|
+
@overload
|
305
|
+
def trace(
|
306
|
+
self,
|
307
|
+
streamed: Literal[True] = True,
|
308
|
+
action: Optional[Callable[[bytes], Any]] = None,
|
309
|
+
chunk_size: int = 1024,
|
310
|
+
*,
|
311
|
+
iterator: Literal[False] = False,
|
312
|
+
**kwargs: Any,
|
313
|
+
) -> None: ...
|
314
|
+
|
202
315
|
@cli.register_custom_action(cls_names="ProjectJob")
|
203
316
|
@exc.on_http_error(exc.GitlabGetError)
|
204
317
|
def trace(
|
gitlab/v4/objects/labels.py
CHANGED
@@ -66,7 +66,7 @@ class GroupLabelManager(
|
|
66
66
|
# Update without ID.
|
67
67
|
# NOTE(jlvillal): Signature doesn't match UpdateMixin.update() so ignore
|
68
68
|
# type error
|
69
|
-
def update( # type: ignore
|
69
|
+
def update( # type: ignore[override]
|
70
70
|
self,
|
71
71
|
name: Optional[str],
|
72
72
|
new_data: Optional[Dict[str, Any]] = None,
|
@@ -132,7 +132,7 @@ class ProjectLabelManager(
|
|
132
132
|
# Update without ID.
|
133
133
|
# NOTE(jlvillal): Signature doesn't match UpdateMixin.update() so ignore
|
134
134
|
# type error
|
135
|
-
def update( # type: ignore
|
135
|
+
def update( # type: ignore[override]
|
136
136
|
self,
|
137
137
|
name: Optional[str],
|
138
138
|
new_data: Optional[Dict[str, Any]] = None,
|
@@ -44,6 +44,7 @@ from .merge_request_approvals import ( # noqa: F401
|
|
44
44
|
from .notes import ProjectMergeRequestNoteManager # noqa: F401
|
45
45
|
from .pipelines import ProjectMergeRequestPipelineManager # noqa: F401
|
46
46
|
from .reviewers import ProjectMergeRequestReviewerDetailManager
|
47
|
+
from .status_checks import ProjectMergeRequestStatusCheckManager
|
47
48
|
|
48
49
|
__all__ = [
|
49
50
|
"MergeRequest",
|
@@ -167,6 +168,7 @@ class ProjectMergeRequest(
|
|
167
168
|
resourcemilestoneevents: ProjectMergeRequestResourceMilestoneEventManager
|
168
169
|
resourcestateevents: ProjectMergeRequestResourceStateEventManager
|
169
170
|
reviewer_details: ProjectMergeRequestReviewerDetailManager
|
171
|
+
status_checks: ProjectMergeRequestStatusCheckManager
|
170
172
|
|
171
173
|
@cli.register_custom_action(cls_names="ProjectMergeRequest")
|
172
174
|
@exc.on_http_error(exc.GitlabMROnBuildSuccessError)
|