diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index 44705ee4c..2d6a05cc9 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -4,6 +4,19 @@ Release notes This page describes important changes between python-gitlab releases. +Changes from 1.1 to 1.2 +======================= + +* The following deprecated methods and objects have been removed: + + * gitlab.v3.object ``Key`` and ``KeyManager`` objects: use ``DeployKey`` and + ``DeployKeyManager`` instead + * gitlab.v3.objects.Project ``archive_`` and ``unarchive_`` methods + * gitlab.Gitlab ``credentials_auth``, ``token_auth``, ``set_url``, + ``set_token`` and ``set_credentials`` methods. Once a Gitlab object has been + created its URL and authentication information cannot be updated: create a + new Gitlab object if you need to use new information + Changes from 1.0.2 to 1.1 ========================= diff --git a/docs/gl_objects/deploy_keys.rst b/docs/gl_objects/deploy_keys.rst index 059b01f2c..a293d2717 100644 --- a/docs/gl_objects/deploy_keys.rst +++ b/docs/gl_objects/deploy_keys.rst @@ -16,8 +16,8 @@ Reference * v3 API: - + :class:`gitlab.v3.objects.Key` - + :class:`gitlab.v3.objects.KeyManager` + + :class:`gitlab.v3.objects.DeployKey` + + :class:`gitlab.v3.objects.DeployKeyManager` + :attr:`gitlab.Gitlab.deploykeys` * GitLab API: https://docs.gitlab.com/ce/api/deploy_keys.html diff --git a/gitlab/__init__.py b/gitlab/__init__.py index f4a33c27c..905c4cd1d 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -118,7 +118,6 @@ def __init__(self, url, private_token=None, oauth_token=None, email=None, 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 @@ def auth(self): 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 @@ def _credentials_auth(self): 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 @@ def version(self): 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 @@ def _construct_url(self, id_, obj, parameters, action=None): 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 @@ def _set_token(self, private_token, oauth_token=None): 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 ebe0785a5..ab815215f 100644 --- a/gitlab/v3/objects.py +++ b/gitlab/v3/objects.py @@ -19,7 +19,6 @@ 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 @@ def archive(self, **kwargs): 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 @@ def unarchive(self, **kwargs): 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.