python-gitlab 4.13.0__py3-none-any.whl → 5.1.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/base.py +2 -2
- gitlab/const.py +1 -0
- gitlab/mixins.py +15 -1
- gitlab/v4/objects/files.py +22 -3
- gitlab/v4/objects/merge_request_approvals.py +8 -2
- gitlab/v4/objects/service_accounts.py +3 -3
- {python_gitlab-4.13.0.dist-info → python_gitlab-5.1.0.dist-info}/METADATA +10 -10
- {python_gitlab-4.13.0.dist-info → python_gitlab-5.1.0.dist-info}/RECORD +14 -14
- {python_gitlab-4.13.0.dist-info → python_gitlab-5.1.0.dist-info}/WHEEL +1 -1
- {python_gitlab-4.13.0.dist-info → python_gitlab-5.1.0.dist-info}/AUTHORS +0 -0
- {python_gitlab-4.13.0.dist-info → python_gitlab-5.1.0.dist-info}/COPYING +0 -0
- {python_gitlab-4.13.0.dist-info → python_gitlab-5.1.0.dist-info}/entry_points.txt +0 -0
- {python_gitlab-4.13.0.dist-info → python_gitlab-5.1.0.dist-info}/top_level.txt +0 -0
gitlab/_version.py
CHANGED
gitlab/base.py
CHANGED
@@ -201,12 +201,12 @@ class RESTObject:
|
|
201
201
|
# NOTE(jlvillal): We are creating our managers by looking at the class
|
202
202
|
# annotations. If an attribute is annotated as being a *Manager type
|
203
203
|
# then we create the manager and assign it to the attribute.
|
204
|
-
for attr, annotation in sorted(self.__annotations__.items()):
|
204
|
+
for attr, annotation in sorted(self.__class__.__annotations__.items()):
|
205
205
|
# We ignore creating a manager for the 'manager' attribute as that
|
206
206
|
# is done in the self.__init__() method
|
207
207
|
if attr in ("manager",):
|
208
208
|
continue
|
209
|
-
if not isinstance(annotation, (type, str)):
|
209
|
+
if not isinstance(annotation, (type, str)): # pragma: no cover
|
210
210
|
continue
|
211
211
|
if isinstance(annotation, type):
|
212
212
|
cls_name = annotation.__name__
|
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,
|
@@ -54,10 +54,11 @@ class ProjectApprovalManager(GetWithoutIdMixin, UpdateMixin, RESTManager):
|
|
54
54
|
|
55
55
|
class ProjectApprovalRule(SaveMixin, ObjectDeleteMixin, RESTObject):
|
56
56
|
_id_attr = "id"
|
57
|
+
_repr_attr = "name"
|
57
58
|
|
58
59
|
|
59
60
|
class ProjectApprovalRuleManager(
|
60
|
-
|
61
|
+
RetrieveMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTManager
|
61
62
|
):
|
62
63
|
_path = "/projects/{project_id}/approval_rules"
|
63
64
|
_obj_cls = ProjectApprovalRule
|
@@ -67,6 +68,11 @@ class ProjectApprovalRuleManager(
|
|
67
68
|
optional=("user_ids", "group_ids", "protected_branch_ids", "usernames"),
|
68
69
|
)
|
69
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
|
+
|
70
76
|
|
71
77
|
class ProjectMergeRequestApproval(SaveMixin, RESTObject):
|
72
78
|
_id_attr = None
|
@@ -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"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: python-gitlab
|
3
|
-
Version:
|
3
|
+
Version: 5.1.0
|
4
4
|
Summary: A python wrapper for the GitLab API
|
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>
|
@@ -19,23 +19,23 @@ Classifier: Operating System :: POSIX
|
|
19
19
|
Classifier: Operating System :: Microsoft :: Windows
|
20
20
|
Classifier: Programming Language :: Python
|
21
21
|
Classifier: Programming Language :: Python :: 3
|
22
|
-
Classifier: Programming Language :: Python :: 3.8
|
23
22
|
Classifier: Programming Language :: Python :: 3.9
|
24
23
|
Classifier: Programming Language :: Python :: 3.10
|
25
24
|
Classifier: Programming Language :: Python :: 3.11
|
26
25
|
Classifier: Programming Language :: Python :: 3.12
|
27
|
-
|
26
|
+
Classifier: Programming Language :: Python :: 3.13
|
27
|
+
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
|
=============
|
@@ -90,7 +90,7 @@ Features
|
|
90
90
|
Installation
|
91
91
|
------------
|
92
92
|
|
93
|
-
As of
|
93
|
+
As of 5.0.0, ``python-gitlab`` is compatible with Python 3.9+.
|
94
94
|
|
95
95
|
Use ``pip`` to install the latest stable version of ``python-gitlab``:
|
96
96
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
gitlab/__init__.py,sha256=DlY_IEbIbeTJnMfkcl4866XbJ_50UiaE4yI0PwOq36E,1406
|
2
2
|
gitlab/__main__.py,sha256=HTesNl0UAU6mPb9EXWkTKMy6Q6pAUxGi3iPnDHTE2uE,68
|
3
|
-
gitlab/_version.py,sha256=
|
4
|
-
gitlab/base.py,sha256
|
3
|
+
gitlab/_version.py,sha256=osB1qo8DaTLz3a_YOntOKnRnXGSvaSiLHs0uLacUOyA,249
|
4
|
+
gitlab/base.py,sha256=-4DNPEWtOB1sGmETTivrJVyl-DWtbmWTUIDTHpenF9Y,13810
|
5
5
|
gitlab/cli.py,sha256=d3-LtZuA1Fgon5wZWn4c3E70fTIu4mM4Juyhh3F8EBs,12416
|
6
6
|
gitlab/client.py,sha256=WK13AV69dJg-5dWIcYV51_ylExuZolrCGXSLHT1vDkU,51217
|
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
|
@@ -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
|
@@ -82,7 +82,7 @@ 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
|
@@ -95,10 +95,10 @@ gitlab/v4/objects/triggers.py,sha256=UAERq_C-QdPBbBQPHLh5IfhpkdDeIxdnVGPHfu9Qy5Y
|
|
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-
|
99
|
-
python_gitlab-
|
100
|
-
python_gitlab-
|
101
|
-
python_gitlab-
|
102
|
-
python_gitlab-
|
103
|
-
python_gitlab-
|
104
|
-
python_gitlab-
|
98
|
+
python_gitlab-5.1.0.dist-info/AUTHORS,sha256=Z0P61GJSVnp7iFbRcMezhx3f4zMyPkVmG--TWaRo768,526
|
99
|
+
python_gitlab-5.1.0.dist-info/COPYING,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
|
100
|
+
python_gitlab-5.1.0.dist-info/METADATA,sha256=AW1oMv0TkuOFy-H25vBudfuOVK0t1rszKqrsB53BLqU,8303
|
101
|
+
python_gitlab-5.1.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
102
|
+
python_gitlab-5.1.0.dist-info/entry_points.txt,sha256=nhpKLLP_uQPFByn8UtE9zsvQQwa402t52o_Cw9IFXMo,43
|
103
|
+
python_gitlab-5.1.0.dist-info/top_level.txt,sha256=MvIaP8p_Oaf4gO_hXmHkX-5y2deHLp1pe6tJR3ukQ6o,7
|
104
|
+
python_gitlab-5.1.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|