diff options
| author | Gauvain Pocentek <gauvain@pocentek.net> | 2017-11-10 08:07:18 +0100 |
|---|---|---|
| committer | Gauvain Pocentek <gauvain@pocentek.net> | 2017-11-10 09:08:59 +0100 |
| commit | ba6e09ec804bf5cea39282590bb4cb829a836873 (patch) | |
| tree | 38a909afb83f2da467152cd69e1cacdc9f1ef632 /gitlab | |
| parent | c30121b07b1997cc11e2011fc26d45ec53372b5a (diff) | |
| download | gitlab-ba6e09ec804bf5cea39282590bb4cb829a836873.tar.gz | |
Remove deprecated objects/methods
Diffstat (limited to 'gitlab')
| -rw-r--r-- | gitlab/__init__.py | 48 | ||||
| -rw-r--r-- | gitlab/v3/objects.py | 29 |
2 files changed, 0 insertions, 77 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py index f4a33c2..905c4cd 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -118,7 +118,6 @@ class Gitlab(object): self.users = objects.UserManager(self) self.todos = objects.TodoManager(self) if self._api_version == '3': - self.keys = objects.KeyManager(self) self.teams = objects.TeamManager(self) else: self.dockerfiles = objects.DockerfileManager(self) @@ -198,12 +197,6 @@ class Gitlab(object): else: self._credentials_auth() - def credentials_auth(self): - """Performs an authentication using email/password.""" - warnings.warn('credentials_auth() is deprecated and will be removed.', - DeprecationWarning) - self._credentials_auth() - def _credentials_auth(self): if not self.email or not self.password: raise GitlabAuthenticationError("Missing email/password") @@ -221,12 +214,6 @@ class Gitlab(object): self._set_token(self.user.private_token) - def token_auth(self): - """Performs an authentication using the private token.""" - warnings.warn('token_auth() is deprecated and will be removed.', - DeprecationWarning) - self._token_auth() - def _token_auth(self): if self.api_version == '3': self.user = self._objects.CurrentUser(self) @@ -256,17 +243,6 @@ class Gitlab(object): return self._server_version, self._server_revision - def set_url(self, url): - """Updates the GitLab URL. - - Args: - url (str): Base URL of the GitLab server. - """ - warnings.warn('set_url() is deprecated, create a new Gitlab instance ' - 'if you need an updated URL.', - DeprecationWarning) - self._url = '%s/api/v%s' % (url, self._api_version) - def _construct_url(self, id_, obj, parameters, action=None): if 'next_url' in parameters: return parameters['next_url'] @@ -291,17 +267,6 @@ class Gitlab(object): else: return url - def set_token(self, token): - """Sets the private token for authentication. - - Args: - token (str): The private token. - """ - warnings.warn('set_token() is deprecated, use the private_token ' - 'argument of the Gitlab constructor.', - DeprecationWarning) - self._set_token(token) - def _set_token(self, private_token, oauth_token=None): self.private_token = private_token if private_token else None self.oauth_token = oauth_token if oauth_token else None @@ -315,19 +280,6 @@ class Gitlab(object): if "PRIVATE-TOKEN" in self.headers: del self.headers["PRIVATE-TOKEN"] - def set_credentials(self, email, password): - """Sets the email/login and password for authentication. - - Args: - email (str): The user email or login. - password (str): The user password. - """ - warnings.warn('set_credentials() is deprecated, use the email and ' - 'password arguments of the Gitlab constructor.', - DeprecationWarning) - self.email = email - self.password = password - def enable_debug(self): import logging try: diff --git a/gitlab/v3/objects.py b/gitlab/v3/objects.py index ebe0785..ab81521 100644 --- a/gitlab/v3/objects.py +++ b/gitlab/v3/objects.py @@ -19,7 +19,6 @@ from __future__ import print_function from __future__ import absolute_import import base64 import json -import warnings import six from six.moves import urllib @@ -295,23 +294,6 @@ class BroadcastMessageManager(BaseManager): obj_cls = BroadcastMessage -class Key(GitlabObject): - _url = '/deploy_keys' - canGet = 'from_list' - canCreate = False - canUpdate = False - canDelete = False - - def __init__(self, *args, **kwargs): - warnings.warn("`Key` is deprecated, use `DeployKey` instead", - DeprecationWarning) - super(Key, self).__init__(*args, **kwargs) - - -class KeyManager(BaseManager): - obj_cls = Key - - class DeployKey(GitlabObject): _url = '/deploy_keys' canGet = 'from_list' @@ -2043,11 +2025,6 @@ class Project(GitlabObject): raise_error_from_response(r, GitlabCreateError, 201) return Project(self.gitlab, r.json()) if r.status_code == 201 else self - def archive_(self, **kwargs): - warnings.warn("`archive_()` is deprecated, use `archive()` instead", - DeprecationWarning) - return self.archive(**kwargs) - def unarchive(self, **kwargs): """Unarchive a project. @@ -2063,12 +2040,6 @@ class Project(GitlabObject): raise_error_from_response(r, GitlabCreateError, 201) return Project(self.gitlab, r.json()) if r.status_code == 201 else self - def unarchive_(self, **kwargs): - warnings.warn("`unarchive_()` is deprecated, " - "use `unarchive()` instead", - DeprecationWarning) - return self.unarchive(**kwargs) - def share(self, group_id, group_access, **kwargs): """Share the project with a group. |
