python-gitlab 5.0.0__py3-none-any.whl → 5.2.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/__init__.py +2 -1
- gitlab/_backends/graphql.py +21 -1
- gitlab/_version.py +1 -1
- gitlab/client.py +120 -16
- gitlab/const.py +1 -0
- gitlab/mixins.py +15 -1
- gitlab/v4/objects/files.py +22 -3
- gitlab/v4/objects/merge_request_approvals.py +7 -2
- gitlab/v4/objects/projects.py +14 -0
- gitlab/v4/objects/service_accounts.py +3 -3
- gitlab/v4/objects/templates.py +104 -0
- {python_gitlab-5.0.0.dist-info → python_gitlab-5.2.0.dist-info}/METADATA +12 -10
- {python_gitlab-5.0.0.dist-info → python_gitlab-5.2.0.dist-info}/RECORD +18 -18
- {python_gitlab-5.0.0.dist-info → python_gitlab-5.2.0.dist-info}/WHEEL +1 -1
- {python_gitlab-5.0.0.dist-info → python_gitlab-5.2.0.dist-info}/AUTHORS +0 -0
- {python_gitlab-5.0.0.dist-info → python_gitlab-5.2.0.dist-info}/COPYING +0 -0
- {python_gitlab-5.0.0.dist-info → python_gitlab-5.2.0.dist-info}/entry_points.txt +0 -0
- {python_gitlab-5.0.0.dist-info → python_gitlab-5.2.0.dist-info}/top_level.txt +0 -0
gitlab/__init__.py
CHANGED
@@ -27,7 +27,7 @@ from gitlab._version import ( # noqa: F401
|
|
27
27
|
__title__,
|
28
28
|
__version__,
|
29
29
|
)
|
30
|
-
from gitlab.client import Gitlab, GitlabList, GraphQL # noqa: F401
|
30
|
+
from gitlab.client import AsyncGraphQL, Gitlab, GitlabList, GraphQL # noqa: F401
|
31
31
|
from gitlab.exceptions import * # noqa: F401,F403
|
32
32
|
|
33
33
|
warnings.filterwarnings("default", category=DeprecationWarning, module="^gitlab")
|
@@ -42,6 +42,7 @@ __all__ = [
|
|
42
42
|
"__version__",
|
43
43
|
"Gitlab",
|
44
44
|
"GitlabList",
|
45
|
+
"AsyncGraphQL",
|
45
46
|
"GraphQL",
|
46
47
|
]
|
47
48
|
__all__.extend(gitlab.exceptions.__all__)
|
gitlab/_backends/graphql.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
from typing import Any
|
2
2
|
|
3
3
|
import httpx
|
4
|
-
from gql.transport.httpx import HTTPXTransport
|
4
|
+
from gql.transport.httpx import HTTPXAsyncTransport, HTTPXTransport
|
5
5
|
|
6
6
|
|
7
7
|
class GitlabTransport(HTTPXTransport):
|
@@ -22,3 +22,23 @@ class GitlabTransport(HTTPXTransport):
|
|
22
22
|
|
23
23
|
def close(self) -> None:
|
24
24
|
pass
|
25
|
+
|
26
|
+
|
27
|
+
class GitlabAsyncTransport(HTTPXAsyncTransport):
|
28
|
+
"""An async gql httpx transport that reuses an existing httpx.AsyncClient.
|
29
|
+
By default, gql's transports do not have a keep-alive session
|
30
|
+
and do not enable providing your own session that's kept open.
|
31
|
+
This transport lets us provide and close our session on our own
|
32
|
+
and provide additional auth.
|
33
|
+
For details, see https://github.com/graphql-python/gql/issues/91.
|
34
|
+
"""
|
35
|
+
|
36
|
+
def __init__(self, *args: Any, client: httpx.AsyncClient, **kwargs: Any):
|
37
|
+
super().__init__(*args, **kwargs)
|
38
|
+
self.client = client
|
39
|
+
|
40
|
+
async def connect(self) -> None:
|
41
|
+
pass
|
42
|
+
|
43
|
+
async def close(self) -> None:
|
44
|
+
pass
|
gitlab/_version.py
CHANGED
gitlab/client.py
CHANGED
@@ -32,7 +32,7 @@ try:
|
|
32
32
|
import graphql
|
33
33
|
import httpx
|
34
34
|
|
35
|
-
from ._backends.graphql import GitlabTransport
|
35
|
+
from ._backends.graphql import GitlabAsyncTransport, GitlabTransport
|
36
36
|
|
37
37
|
_GQL_INSTALLED = True
|
38
38
|
except ImportError: # pragma: no cover
|
@@ -1278,14 +1278,13 @@ class GitlabList:
|
|
1278
1278
|
raise StopIteration
|
1279
1279
|
|
1280
1280
|
|
1281
|
-
class
|
1281
|
+
class _BaseGraphQL:
|
1282
1282
|
def __init__(
|
1283
1283
|
self,
|
1284
1284
|
url: Optional[str] = None,
|
1285
1285
|
*,
|
1286
1286
|
token: Optional[str] = None,
|
1287
1287
|
ssl_verify: Union[bool, str] = True,
|
1288
|
-
client: Optional[httpx.Client] = None,
|
1289
1288
|
timeout: Optional[float] = None,
|
1290
1289
|
user_agent: str = gitlab.const.USER_AGENT,
|
1291
1290
|
fetch_schema_from_transport: bool = False,
|
@@ -1308,9 +1307,50 @@ class GraphQL:
|
|
1308
1307
|
self._max_retries = max_retries
|
1309
1308
|
self._obey_rate_limit = obey_rate_limit
|
1310
1309
|
self._retry_transient_errors = retry_transient_errors
|
1310
|
+
self._client_opts = self._get_client_opts()
|
1311
|
+
self._fetch_schema_from_transport = fetch_schema_from_transport
|
1312
|
+
|
1313
|
+
def _get_client_opts(self) -> Dict[str, Any]:
|
1314
|
+
headers = {"User-Agent": self._user_agent}
|
1315
|
+
|
1316
|
+
if self._token:
|
1317
|
+
headers["Authorization"] = f"Bearer {self._token}"
|
1318
|
+
|
1319
|
+
return {
|
1320
|
+
"headers": headers,
|
1321
|
+
"timeout": self._timeout,
|
1322
|
+
"verify": self._ssl_verify,
|
1323
|
+
}
|
1324
|
+
|
1311
1325
|
|
1312
|
-
|
1313
|
-
|
1326
|
+
class GraphQL(_BaseGraphQL):
|
1327
|
+
def __init__(
|
1328
|
+
self,
|
1329
|
+
url: Optional[str] = None,
|
1330
|
+
*,
|
1331
|
+
token: Optional[str] = None,
|
1332
|
+
ssl_verify: Union[bool, str] = True,
|
1333
|
+
client: Optional[httpx.Client] = None,
|
1334
|
+
timeout: Optional[float] = None,
|
1335
|
+
user_agent: str = gitlab.const.USER_AGENT,
|
1336
|
+
fetch_schema_from_transport: bool = False,
|
1337
|
+
max_retries: int = 10,
|
1338
|
+
obey_rate_limit: bool = True,
|
1339
|
+
retry_transient_errors: bool = False,
|
1340
|
+
) -> None:
|
1341
|
+
super().__init__(
|
1342
|
+
url=url,
|
1343
|
+
token=token,
|
1344
|
+
ssl_verify=ssl_verify,
|
1345
|
+
timeout=timeout,
|
1346
|
+
user_agent=user_agent,
|
1347
|
+
fetch_schema_from_transport=fetch_schema_from_transport,
|
1348
|
+
max_retries=max_retries,
|
1349
|
+
obey_rate_limit=obey_rate_limit,
|
1350
|
+
retry_transient_errors=retry_transient_errors,
|
1351
|
+
)
|
1352
|
+
|
1353
|
+
self._http_client = client or httpx.Client(**self._client_opts)
|
1314
1354
|
self._transport = GitlabTransport(self._url, client=self._http_client)
|
1315
1355
|
self._client = gql.Client(
|
1316
1356
|
transport=self._transport,
|
@@ -1324,19 +1364,81 @@ class GraphQL:
|
|
1324
1364
|
def __exit__(self, *args: Any) -> None:
|
1325
1365
|
self._http_client.close()
|
1326
1366
|
|
1327
|
-
def
|
1328
|
-
|
1367
|
+
def execute(
|
1368
|
+
self, request: Union[str, graphql.Source], *args: Any, **kwargs: Any
|
1369
|
+
) -> Any:
|
1370
|
+
parsed_document = self._gql(request)
|
1371
|
+
retry = utils.Retry(
|
1372
|
+
max_retries=self._max_retries,
|
1373
|
+
obey_rate_limit=self._obey_rate_limit,
|
1374
|
+
retry_transient_errors=self._retry_transient_errors,
|
1375
|
+
)
|
1329
1376
|
|
1330
|
-
|
1331
|
-
|
1377
|
+
while True:
|
1378
|
+
try:
|
1379
|
+
result = self._client.execute(parsed_document, *args, **kwargs)
|
1380
|
+
except gql.transport.exceptions.TransportServerError as e:
|
1381
|
+
if retry.handle_retry_on_status(
|
1382
|
+
status_code=e.code, headers=self._transport.response_headers
|
1383
|
+
):
|
1384
|
+
continue
|
1332
1385
|
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1386
|
+
if e.code == 401:
|
1387
|
+
raise gitlab.exceptions.GitlabAuthenticationError(
|
1388
|
+
response_code=e.code,
|
1389
|
+
error_message=str(e),
|
1390
|
+
)
|
1338
1391
|
|
1339
|
-
|
1392
|
+
raise gitlab.exceptions.GitlabHttpError(
|
1393
|
+
response_code=e.code,
|
1394
|
+
error_message=str(e),
|
1395
|
+
)
|
1396
|
+
|
1397
|
+
return result
|
1398
|
+
|
1399
|
+
|
1400
|
+
class AsyncGraphQL(_BaseGraphQL):
|
1401
|
+
def __init__(
|
1402
|
+
self,
|
1403
|
+
url: Optional[str] = None,
|
1404
|
+
*,
|
1405
|
+
token: Optional[str] = None,
|
1406
|
+
ssl_verify: Union[bool, str] = True,
|
1407
|
+
client: Optional[httpx.AsyncClient] = None,
|
1408
|
+
timeout: Optional[float] = None,
|
1409
|
+
user_agent: str = gitlab.const.USER_AGENT,
|
1410
|
+
fetch_schema_from_transport: bool = False,
|
1411
|
+
max_retries: int = 10,
|
1412
|
+
obey_rate_limit: bool = True,
|
1413
|
+
retry_transient_errors: bool = False,
|
1414
|
+
) -> None:
|
1415
|
+
super().__init__(
|
1416
|
+
url=url,
|
1417
|
+
token=token,
|
1418
|
+
ssl_verify=ssl_verify,
|
1419
|
+
timeout=timeout,
|
1420
|
+
user_agent=user_agent,
|
1421
|
+
fetch_schema_from_transport=fetch_schema_from_transport,
|
1422
|
+
max_retries=max_retries,
|
1423
|
+
obey_rate_limit=obey_rate_limit,
|
1424
|
+
retry_transient_errors=retry_transient_errors,
|
1425
|
+
)
|
1426
|
+
|
1427
|
+
self._http_client = client or httpx.AsyncClient(**self._client_opts)
|
1428
|
+
self._transport = GitlabAsyncTransport(self._url, client=self._http_client)
|
1429
|
+
self._client = gql.Client(
|
1430
|
+
transport=self._transport,
|
1431
|
+
fetch_schema_from_transport=fetch_schema_from_transport,
|
1432
|
+
)
|
1433
|
+
self._gql = gql.gql
|
1434
|
+
|
1435
|
+
async def __aenter__(self) -> "AsyncGraphQL":
|
1436
|
+
return self
|
1437
|
+
|
1438
|
+
async def __aexit__(self, *args: Any) -> None:
|
1439
|
+
await self._http_client.aclose()
|
1440
|
+
|
1441
|
+
async def execute(
|
1340
1442
|
self, request: Union[str, graphql.Source], *args: Any, **kwargs: Any
|
1341
1443
|
) -> Any:
|
1342
1444
|
parsed_document = self._gql(request)
|
@@ -1348,7 +1450,9 @@ class GraphQL:
|
|
1348
1450
|
|
1349
1451
|
while True:
|
1350
1452
|
try:
|
1351
|
-
result = self._client.
|
1453
|
+
result = await self._client.execute_async(
|
1454
|
+
parsed_document, *args, **kwargs
|
1455
|
+
)
|
1352
1456
|
except gql.transport.exceptions.TransportServerError as e:
|
1353
1457
|
if retry.handle_retry_on_status(
|
1354
1458
|
status_code=e.code, headers=self._transport.response_headers
|
gitlab/const.py
CHANGED
gitlab/mixins.py
CHANGED
@@ -663,6 +663,14 @@ class RotateMixin(_RestManagerBase):
|
|
663
663
|
_path: Optional[str]
|
664
664
|
gitlab: gitlab.Gitlab
|
665
665
|
|
666
|
+
@cli.register_custom_action(
|
667
|
+
cls_names=(
|
668
|
+
"PersonalAccessTokenManager",
|
669
|
+
"GroupAccessTokenManager",
|
670
|
+
"ProjectAccessTokenManager",
|
671
|
+
),
|
672
|
+
optional=("expires_at",),
|
673
|
+
)
|
666
674
|
@exc.on_http_error(exc.GitlabRotateError)
|
667
675
|
def rotate(
|
668
676
|
self, id: Union[str, int], expires_at: Optional[str] = None, **kwargs: Any
|
@@ -696,7 +704,12 @@ class ObjectRotateMixin(_RestObjectBase):
|
|
696
704
|
_updated_attrs: Dict[str, Any]
|
697
705
|
manager: base.RESTManager
|
698
706
|
|
699
|
-
|
707
|
+
@cli.register_custom_action(
|
708
|
+
cls_names=("PersonalAccessToken", "GroupAccessToken", "ProjectAccessToken"),
|
709
|
+
optional=("expires_at",),
|
710
|
+
)
|
711
|
+
@exc.on_http_error(exc.GitlabRotateError)
|
712
|
+
def rotate(self, **kwargs: Any) -> Dict[str, Any]:
|
700
713
|
"""Rotate the current access token object.
|
701
714
|
|
702
715
|
Args:
|
@@ -711,6 +724,7 @@ class ObjectRotateMixin(_RestObjectBase):
|
|
711
724
|
assert self.encoded_id is not None
|
712
725
|
server_data = self.manager.rotate(self.encoded_id, **kwargs)
|
713
726
|
self._update_attrs(server_data)
|
727
|
+
return server_data
|
714
728
|
|
715
729
|
|
716
730
|
class SubscribableMixin(_RestObjectBase):
|
gitlab/v4/objects/files.py
CHANGED
@@ -102,11 +102,24 @@ class ProjectFileManager(CreateMixin, UpdateMixin, DeleteMixin, RESTManager):
|
|
102
102
|
_optional_get_attrs: Tuple[str, ...] = ()
|
103
103
|
_create_attrs = RequiredOptional(
|
104
104
|
required=("file_path", "branch", "content", "commit_message"),
|
105
|
-
optional=(
|
105
|
+
optional=(
|
106
|
+
"encoding",
|
107
|
+
"author_email",
|
108
|
+
"author_name",
|
109
|
+
"execute_filemode",
|
110
|
+
"start_branch",
|
111
|
+
),
|
106
112
|
)
|
107
113
|
_update_attrs = RequiredOptional(
|
108
114
|
required=("file_path", "branch", "content", "commit_message"),
|
109
|
-
optional=(
|
115
|
+
optional=(
|
116
|
+
"encoding",
|
117
|
+
"author_email",
|
118
|
+
"author_name",
|
119
|
+
"execute_filemode",
|
120
|
+
"start_branch",
|
121
|
+
"last_commit_id",
|
122
|
+
),
|
110
123
|
)
|
111
124
|
|
112
125
|
@cli.register_custom_action(
|
@@ -164,7 +177,13 @@ class ProjectFileManager(CreateMixin, UpdateMixin, DeleteMixin, RESTManager):
|
|
164
177
|
@cli.register_custom_action(
|
165
178
|
cls_names="ProjectFileManager",
|
166
179
|
required=("file_path", "branch", "content", "commit_message"),
|
167
|
-
optional=(
|
180
|
+
optional=(
|
181
|
+
"encoding",
|
182
|
+
"author_email",
|
183
|
+
"author_name",
|
184
|
+
"execute_filemode",
|
185
|
+
"start_branch",
|
186
|
+
),
|
168
187
|
)
|
169
188
|
@exc.on_http_error(exc.GitlabCreateError)
|
170
189
|
def create(
|
@@ -7,8 +7,8 @@ from gitlab.mixins import (
|
|
7
7
|
CRUDMixin,
|
8
8
|
DeleteMixin,
|
9
9
|
GetWithoutIdMixin,
|
10
|
-
ListMixin,
|
11
10
|
ObjectDeleteMixin,
|
11
|
+
RetrieveMixin,
|
12
12
|
SaveMixin,
|
13
13
|
UpdateMethod,
|
14
14
|
UpdateMixin,
|
@@ -58,7 +58,7 @@ class ProjectApprovalRule(SaveMixin, ObjectDeleteMixin, RESTObject):
|
|
58
58
|
|
59
59
|
|
60
60
|
class ProjectApprovalRuleManager(
|
61
|
-
|
61
|
+
RetrieveMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTManager
|
62
62
|
):
|
63
63
|
_path = "/projects/{project_id}/approval_rules"
|
64
64
|
_obj_cls = ProjectApprovalRule
|
@@ -68,6 +68,11 @@ class ProjectApprovalRuleManager(
|
|
68
68
|
optional=("user_ids", "group_ids", "protected_branch_ids", "usernames"),
|
69
69
|
)
|
70
70
|
|
71
|
+
def get(
|
72
|
+
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
73
|
+
) -> ProjectApprovalRule:
|
74
|
+
return cast(ProjectApprovalRule, super().get(id=id, lazy=lazy, **kwargs))
|
75
|
+
|
71
76
|
|
72
77
|
class ProjectMergeRequestApproval(SaveMixin, RESTObject):
|
73
78
|
_id_attr = None
|
gitlab/v4/objects/projects.py
CHANGED
@@ -100,6 +100,14 @@ from .statistics import ( # noqa: F401
|
|
100
100
|
ProjectIssuesStatisticsManager,
|
101
101
|
)
|
102
102
|
from .tags import ProjectProtectedTagManager, ProjectTagManager # noqa: F401
|
103
|
+
from .templates import ( # noqa: F401
|
104
|
+
ProjectDockerfileTemplateManager,
|
105
|
+
ProjectGitignoreTemplateManager,
|
106
|
+
ProjectGitlabciymlTemplateManager,
|
107
|
+
ProjectIssueTemplateManager,
|
108
|
+
ProjectLicenseTemplateManager,
|
109
|
+
ProjectMergeRequestTemplateManager,
|
110
|
+
)
|
103
111
|
from .triggers import ProjectTriggerManager # noqa: F401
|
104
112
|
from .users import ProjectUserManager # noqa: F401
|
105
113
|
from .variables import ProjectVariableManager # noqa: F401
|
@@ -189,27 +197,33 @@ class Project(
|
|
189
197
|
customattributes: ProjectCustomAttributeManager
|
190
198
|
deployments: ProjectDeploymentManager
|
191
199
|
deploytokens: ProjectDeployTokenManager
|
200
|
+
dockerfile_templates: ProjectDockerfileTemplateManager
|
192
201
|
environments: ProjectEnvironmentManager
|
193
202
|
events: ProjectEventManager
|
194
203
|
exports: ProjectExportManager
|
195
204
|
files: ProjectFileManager
|
196
205
|
forks: "ProjectForkManager"
|
197
206
|
generic_packages: GenericPackageManager
|
207
|
+
gitignore_templates: ProjectGitignoreTemplateManager
|
208
|
+
gitlabciyml_templates: ProjectGitlabciymlTemplateManager
|
198
209
|
groups: ProjectGroupManager
|
199
210
|
hooks: ProjectHookManager
|
200
211
|
imports: ProjectImportManager
|
201
212
|
integrations: ProjectIntegrationManager
|
202
213
|
invitations: ProjectInvitationManager
|
203
214
|
issues: ProjectIssueManager
|
215
|
+
issue_templates: ProjectIssueTemplateManager
|
204
216
|
issues_statistics: ProjectIssuesStatisticsManager
|
205
217
|
iterations: ProjectIterationManager
|
206
218
|
jobs: ProjectJobManager
|
207
219
|
job_token_scope: ProjectJobTokenScopeManager
|
208
220
|
keys: ProjectKeyManager
|
209
221
|
labels: ProjectLabelManager
|
222
|
+
license_templates: ProjectLicenseTemplateManager
|
210
223
|
members: ProjectMemberManager
|
211
224
|
members_all: ProjectMemberAllManager
|
212
225
|
mergerequests: ProjectMergeRequestManager
|
226
|
+
merge_request_templates: ProjectMergeRequestTemplateManager
|
213
227
|
merge_trains: ProjectMergeTrainManager
|
214
228
|
milestones: ProjectMilestoneManager
|
215
229
|
notes: ProjectNoteManager
|
@@ -1,15 +1,15 @@
|
|
1
1
|
from gitlab.base import RESTManager, RESTObject
|
2
|
-
from gitlab.mixins import CreateMixin
|
2
|
+
from gitlab.mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin
|
3
3
|
from gitlab.types import RequiredOptional
|
4
4
|
|
5
5
|
__all__ = ["GroupServiceAccount", "GroupServiceAccountManager"]
|
6
6
|
|
7
7
|
|
8
|
-
class GroupServiceAccount(RESTObject):
|
8
|
+
class GroupServiceAccount(ObjectDeleteMixin, RESTObject):
|
9
9
|
pass
|
10
10
|
|
11
11
|
|
12
|
-
class GroupServiceAccountManager(CreateMixin, RESTManager):
|
12
|
+
class GroupServiceAccountManager(CreateMixin, DeleteMixin, ListMixin, RESTManager):
|
13
13
|
_path = "/groups/{group_id}/service_accounts"
|
14
14
|
_obj_cls = GroupServiceAccount
|
15
15
|
_from_parent_attrs = {"group_id": "id"}
|
gitlab/v4/objects/templates.py
CHANGED
@@ -12,6 +12,18 @@ __all__ = [
|
|
12
12
|
"GitlabciymlManager",
|
13
13
|
"License",
|
14
14
|
"LicenseManager",
|
15
|
+
"ProjectDockerfileTemplate",
|
16
|
+
"ProjectDockerfileTemplateManager",
|
17
|
+
"ProjectGitignoreTemplate",
|
18
|
+
"ProjectGitignoreTemplateManager",
|
19
|
+
"ProjectGitlabciymlTemplate",
|
20
|
+
"ProjectGitlabciymlTemplateManager",
|
21
|
+
"ProjectIssueTemplate",
|
22
|
+
"ProjectIssueTemplateManager",
|
23
|
+
"ProjectLicenseTemplate",
|
24
|
+
"ProjectLicenseTemplateManager",
|
25
|
+
"ProjectMergeRequestTemplate",
|
26
|
+
"ProjectMergeRequestTemplateManager",
|
15
27
|
]
|
16
28
|
|
17
29
|
|
@@ -65,3 +77,95 @@ class LicenseManager(RetrieveMixin, RESTManager):
|
|
65
77
|
|
66
78
|
def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> License:
|
67
79
|
return cast(License, super().get(id=id, lazy=lazy, **kwargs))
|
80
|
+
|
81
|
+
|
82
|
+
class ProjectDockerfileTemplate(RESTObject):
|
83
|
+
_id_attr = "name"
|
84
|
+
|
85
|
+
|
86
|
+
class ProjectDockerfileTemplateManager(RetrieveMixin, RESTManager):
|
87
|
+
_path = "/projects/{project_id}/templates/dockerfiles"
|
88
|
+
_obj_cls = ProjectDockerfileTemplate
|
89
|
+
_from_parent_attrs = {"project_id": "id"}
|
90
|
+
|
91
|
+
def get(
|
92
|
+
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
93
|
+
) -> ProjectDockerfileTemplate:
|
94
|
+
return cast(ProjectDockerfileTemplate, super().get(id=id, lazy=lazy, **kwargs))
|
95
|
+
|
96
|
+
|
97
|
+
class ProjectGitignoreTemplate(RESTObject):
|
98
|
+
_id_attr = "name"
|
99
|
+
|
100
|
+
|
101
|
+
class ProjectGitignoreTemplateManager(RetrieveMixin, RESTManager):
|
102
|
+
_path = "/projects/{project_id}/templates/gitignores"
|
103
|
+
_obj_cls = ProjectGitignoreTemplate
|
104
|
+
_from_parent_attrs = {"project_id": "id"}
|
105
|
+
|
106
|
+
def get(
|
107
|
+
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
108
|
+
) -> ProjectGitignoreTemplate:
|
109
|
+
return cast(ProjectGitignoreTemplate, super().get(id=id, lazy=lazy, **kwargs))
|
110
|
+
|
111
|
+
|
112
|
+
class ProjectGitlabciymlTemplate(RESTObject):
|
113
|
+
_id_attr = "name"
|
114
|
+
|
115
|
+
|
116
|
+
class ProjectGitlabciymlTemplateManager(RetrieveMixin, RESTManager):
|
117
|
+
_path = "/projects/{project_id}/templates/gitlab_ci_ymls"
|
118
|
+
_obj_cls = ProjectGitlabciymlTemplate
|
119
|
+
_from_parent_attrs = {"project_id": "id"}
|
120
|
+
|
121
|
+
def get(
|
122
|
+
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
123
|
+
) -> ProjectGitlabciymlTemplate:
|
124
|
+
return cast(ProjectGitlabciymlTemplate, super().get(id=id, lazy=lazy, **kwargs))
|
125
|
+
|
126
|
+
|
127
|
+
class ProjectLicenseTemplate(RESTObject):
|
128
|
+
_id_attr = "key"
|
129
|
+
|
130
|
+
|
131
|
+
class ProjectLicenseTemplateManager(RetrieveMixin, RESTManager):
|
132
|
+
_path = "/projects/{project_id}/templates/licenses"
|
133
|
+
_obj_cls = ProjectLicenseTemplate
|
134
|
+
_from_parent_attrs = {"project_id": "id"}
|
135
|
+
|
136
|
+
def get(
|
137
|
+
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
138
|
+
) -> ProjectLicenseTemplate:
|
139
|
+
return cast(ProjectLicenseTemplate, super().get(id=id, lazy=lazy, **kwargs))
|
140
|
+
|
141
|
+
|
142
|
+
class ProjectIssueTemplate(RESTObject):
|
143
|
+
_id_attr = "name"
|
144
|
+
|
145
|
+
|
146
|
+
class ProjectIssueTemplateManager(RetrieveMixin, RESTManager):
|
147
|
+
_path = "/projects/{project_id}/templates/issues"
|
148
|
+
_obj_cls = ProjectIssueTemplate
|
149
|
+
_from_parent_attrs = {"project_id": "id"}
|
150
|
+
|
151
|
+
def get(
|
152
|
+
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
153
|
+
) -> ProjectIssueTemplate:
|
154
|
+
return cast(ProjectIssueTemplate, super().get(id=id, lazy=lazy, **kwargs))
|
155
|
+
|
156
|
+
|
157
|
+
class ProjectMergeRequestTemplate(RESTObject):
|
158
|
+
_id_attr = "name"
|
159
|
+
|
160
|
+
|
161
|
+
class ProjectMergeRequestTemplateManager(RetrieveMixin, RESTManager):
|
162
|
+
_path = "/projects/{project_id}/templates/merge_requests"
|
163
|
+
_obj_cls = ProjectMergeRequestTemplate
|
164
|
+
_from_parent_attrs = {"project_id": "id"}
|
165
|
+
|
166
|
+
def get(
|
167
|
+
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
168
|
+
) -> ProjectMergeRequestTemplate:
|
169
|
+
return cast(
|
170
|
+
ProjectMergeRequestTemplate, super().get(id=id, lazy=lazy, **kwargs)
|
171
|
+
)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: python-gitlab
|
3
|
-
Version: 5.
|
4
|
-
Summary:
|
3
|
+
Version: 5.2.0
|
4
|
+
Summary: The python wrapper for the GitLab REST and GraphQL APIs.
|
5
5
|
Author-email: Gauvain Pocentek <gauvain@pocentek.net>
|
6
6
|
Maintainer-email: John Villalovos <john@sodarock.com>, Max Wittig <max.wittig@siemens.com>, Nejc Habjan <nejc.habjan@siemens.com>, Roger Meier <r.meier@siemens.com>
|
7
7
|
License: LGPL-3.0-or-later
|
@@ -28,14 +28,14 @@ Requires-Python: >=3.9.0
|
|
28
28
|
Description-Content-Type: text/x-rst
|
29
29
|
License-File: COPYING
|
30
30
|
License-File: AUTHORS
|
31
|
-
Requires-Dist: requests
|
32
|
-
Requires-Dist: requests-toolbelt
|
31
|
+
Requires-Dist: requests>=2.32.0
|
32
|
+
Requires-Dist: requests-toolbelt>=1.0.0
|
33
33
|
Provides-Extra: autocompletion
|
34
|
-
Requires-Dist: argcomplete
|
35
|
-
Provides-Extra: graphql
|
36
|
-
Requires-Dist: gql[httpx] <4,>=3.5.0 ; extra == 'graphql'
|
34
|
+
Requires-Dist: argcomplete<3,>=1.10.0; extra == "autocompletion"
|
37
35
|
Provides-Extra: yaml
|
38
|
-
Requires-Dist: PyYaml
|
36
|
+
Requires-Dist: PyYaml>=6.0.1; extra == "yaml"
|
37
|
+
Provides-Extra: graphql
|
38
|
+
Requires-Dist: gql[httpx]<4,>=3.5.0; extra == "graphql"
|
39
39
|
|
40
40
|
python-gitlab
|
41
41
|
=============
|
@@ -64,9 +64,10 @@ python-gitlab
|
|
64
64
|
.. image:: https://img.shields.io/github/license/python-gitlab/python-gitlab
|
65
65
|
:target: https://github.com/python-gitlab/python-gitlab/blob/main/COPYING
|
66
66
|
|
67
|
-
``python-gitlab`` is a Python package providing access to the GitLab
|
67
|
+
``python-gitlab`` is a Python package providing access to the GitLab APIs.
|
68
68
|
|
69
|
-
It
|
69
|
+
It includes a client for GitLab's v4 REST API, synchronous and asynchronous GraphQL API
|
70
|
+
clients, as well as a CLI tool (``gitlab``) wrapping REST API endpoints.
|
70
71
|
|
71
72
|
.. _features:
|
72
73
|
|
@@ -78,6 +79,7 @@ Features
|
|
78
79
|
* write Pythonic code to manage your GitLab resources.
|
79
80
|
* pass arbitrary parameters to the GitLab API. Simply follow GitLab's docs
|
80
81
|
on what parameters are available.
|
82
|
+
* use a synchronous or asynchronous client when using the GraphQL API.
|
81
83
|
* access arbitrary endpoints as soon as they are available on GitLab, by using
|
82
84
|
lower-level API methods.
|
83
85
|
* use persistent requests sessions for authentication, proxy and certificate handling.
|
@@ -1,18 +1,18 @@
|
|
1
|
-
gitlab/__init__.py,sha256=
|
1
|
+
gitlab/__init__.py,sha256=UP73h54550MIXpRt5OCLJJ-oBHIx1iHSdxmGARfhbO4,1440
|
2
2
|
gitlab/__main__.py,sha256=HTesNl0UAU6mPb9EXWkTKMy6Q6pAUxGi3iPnDHTE2uE,68
|
3
|
-
gitlab/_version.py,sha256=
|
3
|
+
gitlab/_version.py,sha256=bHxzVyLUxRjFLURgayK0epTEUF6zJeW-Fn5SA-X5RU0,249
|
4
4
|
gitlab/base.py,sha256=-4DNPEWtOB1sGmETTivrJVyl-DWtbmWTUIDTHpenF9Y,13810
|
5
5
|
gitlab/cli.py,sha256=d3-LtZuA1Fgon5wZWn4c3E70fTIu4mM4Juyhh3F8EBs,12416
|
6
|
-
gitlab/client.py,sha256=
|
6
|
+
gitlab/client.py,sha256=RLJZ7QIyc_bprHYCt0yu81ltImd4dLOHmMB_PP2H9VE,54798
|
7
7
|
gitlab/config.py,sha256=T1DgUXD0-MN2qNszrv-SO5d4uy0FITnNN0vWJgOt2yo,9088
|
8
|
-
gitlab/const.py,sha256=
|
8
|
+
gitlab/const.py,sha256=CD9ahY-Tefhc6OHsmHG0lj5uPdH1DwU1xZmSQfho_ao,5374
|
9
9
|
gitlab/exceptions.py,sha256=VOQftPzEq5mpVj6vke7z6Xe4S7Yf_rDTab0lNHqf3AY,8390
|
10
|
-
gitlab/mixins.py,sha256=
|
10
|
+
gitlab/mixins.py,sha256=SLupFM7GWlVFhUW0OCMM60TKfGtRwY_Y2HpPvM7cmbw,37112
|
11
11
|
gitlab/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
12
|
gitlab/types.py,sha256=lepiiI_YOr94B4koqIHuY70tszZC_X3YW4lDvbadbI8,3312
|
13
13
|
gitlab/utils.py,sha256=3OngV45Gb4UO2GR-6-kXax1Ghdw6bpyRdUC2cHpyCSw,9027
|
14
14
|
gitlab/_backends/__init__.py,sha256=WalQZRIDzw19FuNxraG7fvck6ddg4cdNd3bi53QKvZM,392
|
15
|
-
gitlab/_backends/graphql.py,sha256=
|
15
|
+
gitlab/_backends/graphql.py,sha256=wUEjrtz4KAFIFLc13cTj8D1757yeSeViX-xzoDy90Is,1450
|
16
16
|
gitlab/_backends/protocol.py,sha256=m5qSz1o3i0H4XJCWnqx0wIFilOIU9cKxzFsYxLL6Big,842
|
17
17
|
gitlab/_backends/requests_backend.py,sha256=CrSDTfkvi17dT4kTU8R3qQFBNCPJqEfBJq4gJ2GXleA,5534
|
18
18
|
gitlab/v4/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -45,7 +45,7 @@ gitlab/v4/objects/epics.py,sha256=HKLpEL7_K54M6prGjga3qw5VfI2ZGGxBbfz42Oumvr0,41
|
|
45
45
|
gitlab/v4/objects/events.py,sha256=20yCSlR9XB75AwMzatmAt4VdT9PL2nX0t1p1sAWbrvI,7067
|
46
46
|
gitlab/v4/objects/export_import.py,sha256=XVmrSq_qHwQr3XamFPfISEXnlBd-icJRm2CCa3V2puY,1909
|
47
47
|
gitlab/v4/objects/features.py,sha256=N7T52I2JyNIgD1JejrSr8fNa14ZlAUxrS2VceUekhj0,1973
|
48
|
-
gitlab/v4/objects/files.py,sha256=
|
48
|
+
gitlab/v4/objects/files.py,sha256=SEBrwJR-AnjJUhsFTANe_WP4GBtwTGtoq4ahgoTemTY,12025
|
49
49
|
gitlab/v4/objects/geo_nodes.py,sha256=tD9piU7OIZgbNQRUeLTFPtAJ6PVL_SI6tR_zh6Tm2M8,3686
|
50
50
|
gitlab/v4/objects/group_access_tokens.py,sha256=EijY0sfsp0Gtx_q4JLBeLL3jphx5b_6-nTzKxV272jc,1023
|
51
51
|
gitlab/v4/objects/groups.py,sha256=YxOeaRYUjhu8PicCicVT7Eua04YuyOLAc8J13V7r9Gg,15958
|
@@ -60,7 +60,7 @@ gitlab/v4/objects/keys.py,sha256=IclYGSzcVEZPIhDdIz-p16rvb68FnBTgAf1cWCXWjkY,882
|
|
60
60
|
gitlab/v4/objects/labels.py,sha256=JvOciJ6V76pF9HuJp5OT_Ykq8oqaa6ItxvpKf3hiEzs,4736
|
61
61
|
gitlab/v4/objects/ldap.py,sha256=adpkdfk7VBjshuh8SpCsc77Pax4QgqCx1N12CuzitDE,1662
|
62
62
|
gitlab/v4/objects/members.py,sha256=YJO9MaqlCSUnozHIlI7MfSlcWTju4xRmW8QIlEiBmok,3902
|
63
|
-
gitlab/v4/objects/merge_request_approvals.py,sha256=
|
63
|
+
gitlab/v4/objects/merge_request_approvals.py,sha256=XJWjThmc0dbKpYzMW7XB3iyz7G9qRerUNAyZMVw5it0,6627
|
64
64
|
gitlab/v4/objects/merge_requests.py,sha256=GftA_42h4zyS7LG7-lmf4wG5gJPHkYqQwPXFB-Sywxs,18532
|
65
65
|
gitlab/v4/objects/merge_trains.py,sha256=e0Gp2Ri75elcG_r9w8qxdrcWW_YiebPRwUYIH5od8kc,422
|
66
66
|
gitlab/v4/objects/milestones.py,sha256=LHAGYJlTm2ed3eqv4mTO-QZ7vRbwGXRFpre_G4gHdKY,7073
|
@@ -73,7 +73,7 @@ gitlab/v4/objects/pages.py,sha256=Z9x9Sd21daSLmapkBLoV3bKmxQu-JFtrHgJMBjfNbg8,18
|
|
73
73
|
gitlab/v4/objects/personal_access_tokens.py,sha256=vMsAytE5czai3fpyTCyV1sR3cZDZRhvI06u08L8O7mw,1315
|
74
74
|
gitlab/v4/objects/pipelines.py,sha256=nQrzNW6WCTcDCqz_nl8i7YYGpXfRaEVGGpeRdObjeW0,10664
|
75
75
|
gitlab/v4/objects/project_access_tokens.py,sha256=z_BCaBtXC7wzGVN6Ip0H72VwHID8XEBHDddCw0J8hO0,1043
|
76
|
-
gitlab/v4/objects/projects.py,sha256=
|
76
|
+
gitlab/v4/objects/projects.py,sha256=or1cPn-wMJ97tFe3g6ojMmzOeTcQigBV5u6YhzlxvOU,45482
|
77
77
|
gitlab/v4/objects/push_rules.py,sha256=0dKMWEzF5h1zATh0_j_SvjQ7HKx9_5M7J9hzDGB66Rc,3041
|
78
78
|
gitlab/v4/objects/registry_protection_rules.py,sha256=bZsUAjoxwQEHOfr4Bxz6FQA2MGHZpWOFz00o99hcfI4,1092
|
79
79
|
gitlab/v4/objects/releases.py,sha256=j4_45oOj2yaA2XZ3fwBcKhFJ6li4vQy_zyr013LKfvY,1972
|
@@ -82,23 +82,23 @@ gitlab/v4/objects/resource_groups.py,sha256=fYYnA2YO9CSTzxwImVCVPSiPkIeNpKRrPj7d
|
|
82
82
|
gitlab/v4/objects/reviewers.py,sha256=HTU8hw09fRofvoj5V4kde1PLK3QSe1uY3BVUtxOvJ00,517
|
83
83
|
gitlab/v4/objects/runners.py,sha256=QFYiApMyBWs0rhw1drylutoltI2zdIwDeYP1oFJUGJ4,4917
|
84
84
|
gitlab/v4/objects/secure_files.py,sha256=KC5jGC79Qd_IeHx1EhjobMZrJPPIA-4jUYZny_o3cCE,2521
|
85
|
-
gitlab/v4/objects/service_accounts.py,sha256=
|
85
|
+
gitlab/v4/objects/service_accounts.py,sha256=r2s33LU9LLgzYtCiUwQEiqEB9o7YuzJRw0aaFXEJK6Q,603
|
86
86
|
gitlab/v4/objects/settings.py,sha256=LTkdyhhU2MTA15EJw2lZeqDKfK_Bg65CV1CchPljrqY,4295
|
87
87
|
gitlab/v4/objects/sidekiq.py,sha256=kIMgglIBJkbA_io9MXwkCEUs8mZPte6sFQYoWH1TXI4,2996
|
88
88
|
gitlab/v4/objects/snippets.py,sha256=Tq_-9thqcFWN0AqfYOROxwbXfKqlY0zLqbVcp7nww3w,8176
|
89
89
|
gitlab/v4/objects/statistics.py,sha256=NPN8WpCwFJeWeLcn5zahwAgzpJl-Q6bJyoi5ff8XCRQ,2638
|
90
90
|
gitlab/v4/objects/tags.py,sha256=LCvSzI44a1NlrUVi5A_2eOwFSOJjVBSkWe71QdXH_68,1453
|
91
|
-
gitlab/v4/objects/templates.py,sha256=
|
91
|
+
gitlab/v4/objects/templates.py,sha256=IBu46OdUsYwAvozGwPoFLoQf61jdp3_VGcIPbL3ni6c,5092
|
92
92
|
gitlab/v4/objects/todos.py,sha256=HMqvK9CDyxj2jwSQKjnaTLmMztDhqIL_62CHh6Rh4lk,1846
|
93
93
|
gitlab/v4/objects/topics.py,sha256=rJU4q2gH8caaJXgBV81x9docr5XobZBaI-9vPmgCvXQ,2208
|
94
94
|
gitlab/v4/objects/triggers.py,sha256=UAERq_C-QdPBbBQPHLh5IfhpkdDeIxdnVGPHfu9Qy5Y,824
|
95
95
|
gitlab/v4/objects/users.py,sha256=_gGrTwcE17jeoXIPgfFSv54jtF1_9C1R0Y0hhssTvXY,21381
|
96
96
|
gitlab/v4/objects/variables.py,sha256=S0Vz32jEpUbo4J2js8gMPPTVpcy1ge5FYVHLiPz9c-A,2627
|
97
97
|
gitlab/v4/objects/wikis.py,sha256=JtI1cQqZV1_PRfKVlQRMh4LZjdxEfi9T2VuFYv6PrV8,1775
|
98
|
-
python_gitlab-5.
|
99
|
-
python_gitlab-5.
|
100
|
-
python_gitlab-5.
|
101
|
-
python_gitlab-5.
|
102
|
-
python_gitlab-5.
|
103
|
-
python_gitlab-5.
|
104
|
-
python_gitlab-5.
|
98
|
+
python_gitlab-5.2.0.dist-info/AUTHORS,sha256=Z0P61GJSVnp7iFbRcMezhx3f4zMyPkVmG--TWaRo768,526
|
99
|
+
python_gitlab-5.2.0.dist-info/COPYING,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
|
100
|
+
python_gitlab-5.2.0.dist-info/METADATA,sha256=BSlE5Ha8zS9EbhGf_euK5Rp9DEtwUCNIMSWjBcEOLb0,8478
|
101
|
+
python_gitlab-5.2.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
102
|
+
python_gitlab-5.2.0.dist-info/entry_points.txt,sha256=nhpKLLP_uQPFByn8UtE9zsvQQwa402t52o_Cw9IFXMo,43
|
103
|
+
python_gitlab-5.2.0.dist-info/top_level.txt,sha256=MvIaP8p_Oaf4gO_hXmHkX-5y2deHLp1pe6tJR3ukQ6o,7
|
104
|
+
python_gitlab-5.2.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|