Skip to content

Commit 8e4b65f

Browse files
author
Gauvain Pocentek
committed
[v4] Remove deprecated objects methods and classes
1 parent 441244b commit 8e4b65f

File tree

2 files changed

+2
-30
lines changed

2 files changed

+2
-30
lines changed

gitlab/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ def __init__(self, url, private_token=None, email=None, password=None,
9696
self._api_version)
9797

9898
self.broadcastmessages = objects.BroadcastMessageManager(self)
99-
self.keys = objects.KeyManager(self)
10099
self.deploykeys = objects.DeployKeyManager(self)
101100
self.gitlabciymls = objects.GitlabciymlManager(self)
102101
self.gitignores = objects.GitignoreManager(self)
@@ -112,9 +111,10 @@ def __init__(self, url, private_token=None, email=None, password=None,
112111
self.sidekiq = objects.SidekiqManager(self)
113112
self.snippets = objects.SnippetManager(self)
114113
self.users = objects.UserManager(self)
114+
self.todos = objects.TodoManager(self)
115115
if self._api_version == '3':
116+
self.keys = objects.KeyManager(self)
116117
self.teams = objects.TeamManager(self)
117-
self.todos = objects.TodoManager(self)
118118

119119
# build the "submanagers"
120120
for parent_cls in six.itervalues(vars(objects)):

gitlab/v4/objects.py

-28
Original file line numberDiff line numberDiff line change
@@ -307,23 +307,6 @@ class BroadcastMessageManager(BaseManager):
307307
obj_cls = BroadcastMessage
308308

309309

310-
class Key(GitlabObject):
311-
_url = '/deploy_keys'
312-
canGet = 'from_list'
313-
canCreate = False
314-
canUpdate = False
315-
canDelete = False
316-
317-
def __init__(self, *args, **kwargs):
318-
warnings.warn("`Key` is deprecated, use `DeployKey` instead",
319-
DeprecationWarning)
320-
super(Key, self).__init__(*args, **kwargs)
321-
322-
323-
class KeyManager(BaseManager):
324-
obj_cls = Key
325-
326-
327310
class DeployKey(GitlabObject):
328311
_url = '/deploy_keys'
329312
canGet = 'from_list'
@@ -2047,11 +2030,6 @@ def archive(self, **kwargs):
20472030
raise_error_from_response(r, GitlabCreateError, 201)
20482031
return Project(self.gitlab, r.json()) if r.status_code == 201 else self
20492032

2050-
def archive_(self, **kwargs):
2051-
warnings.warn("`archive_()` is deprecated, use `archive()` instead",
2052-
DeprecationWarning)
2053-
return self.archive(**kwargs)
2054-
20552033
def unarchive(self, **kwargs):
20562034
"""Unarchive a project.
20572035
@@ -2067,12 +2045,6 @@ def unarchive(self, **kwargs):
20672045
raise_error_from_response(r, GitlabCreateError, 201)
20682046
return Project(self.gitlab, r.json()) if r.status_code == 201 else self
20692047

2070-
def unarchive_(self, **kwargs):
2071-
warnings.warn("`unarchive_()` is deprecated, "
2072-
"use `unarchive()` instead",
2073-
DeprecationWarning)
2074-
return self.unarchive(**kwargs)
2075-
20762048
def share(self, group_id, group_access, **kwargs):
20772049
"""Share the project with a group.
20782050

0 commit comments

Comments
 (0)