10000 Remove method marked as deprecated 7 months ago · mishin/python-gitlab@438dc2f · GitHub
[go: up one dir, main page]

Skip to content

Commit 438dc2f

Browse files
author
Gauvain Pocentek
committed
Remove method marked as deprecated 7 months ago
1 parent 83cb8c0 commit 438dc2f

File tree

2 files changed

+0
-280
lines changed

2 files changed

+0
-280
lines changed

gitlab/__init__.py

Lines changed: 0 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -703,47 +703,6 @@ def update(self, obj, **kwargs):
703703
raise_error_from_response(r, GitlabUpdateError)
704704
return r.json()
705705

706-
def Hook(self, id=None, **kwargs):
707-
"""Creates/tests/lists system hook(s) known by the GitLab server.
708-
709-
If id is None, returns a list of hooks.
710-
711-
If id is an integer, tests the matching hook.
712-
713-
If id is a dict, creates a new object using attributes provided. The
714-
object is NOT saved on the server. Use the save() method on the object
715-
to write it on the server.
716-
"""
717-
warnings.warn("`Hook` is deprecated, use `hooks` instead",
718-
DeprecationWarning)
719-
return Hook._get_list_or_object(self, id, **kwargs)
720-
721-
def Project(self, id=None, **kwargs):
722-
"""Creates/gets/lists project(s) known by the GitLab server.
723-
724-
If id is None, returns a list of projects.
725-
726-
If id is an integer, returns the matching project (or raises a
727-
GitlabGetError if not found)
728-
729-
If id is a dict, creates a new object using attributes provided. The
730-
object is NOT saved on the server. Use the save() method on the object
731-
to write it on the server.
732-
"""
733-
warnings.warn("`Project` is deprecated, use `projects` instead",
734-
DeprecationWarning)
735-
return Project._get_list_or_object(self, id, **kwargs)
736-
737-
def UserProject(self, id=None, **kwargs):
738-
"""Creates a project for a user.
739-
740-
id must be a dict.
741-
"""
742-
warnings.warn("`UserProject` is deprecated, "
743-
"use `user_projects` instead",
744-
DeprecationWarning)
745-
return UserProject._get_list_or_object(self, id, **kwargs)
746-
747706
def _list_projects(self, url, **kwargs):
748707
r = self._raw_get(url, **kwargs)
749708
raise_error_from_response(r, GitlabListError)
@@ -755,86 +714,3 @@ def _list_projects(self, url, **kwargs):
755714
l.append(p)
756715

757716
return l
758-
759-
def search_projects(self, query, **kwargs):
760-
"""Searches projects by name.
761-
762-
Returns a list of matching projects.
763-
"""
764-
warnings.warn("`search_projects()` is deprecated, "
765-
"use `projects.search()` instead",
766-
DeprecationWarning)
767-
return self._list_projects("/projects/search/" + query, **kwargs)
768-
769-
def all_projects(self, **kwargs):
770-
"""Lists all the projects (need admin rights)."""
771-
warnings.warn("`all_projects()` is deprecated, "
772-
"use `projects.all()` instead",
773-
DeprecationWarning)
774-
return self._list_projects("/projects/all", **kwargs)
775-
776-
def owned_projects(self, **kwargs):
777-
"""Lists owned projects."""
778-
warnings.warn("`owned_projects()` is deprecated, "
779-
"use `projects.owned()` instead",
780-
DeprecationWarning)
781-
return self._list_projects("/projects/owned", **kwargs)
782-
783-
def Group(self, id=None, **kwargs):
784-
"""Creates/gets/lists group(s) known by the GitLab server
785-
786-
Args:
787-
id: If id is None, returns a list of groups.
788-
id: If id is an integer,
789-
returns the matching group (or raises a GitlabGetError if not
790-
found).
791-
id: If id is a dict, creates a new object using attributes
792-
provided. The object is NOT saved on the server. Use the
793-
save() method on the object to write it on the server.
794-
kwargs: Arbitrary keyword arguments
795-
"""
796-
warnings.warn("`Group` is deprecated, use `groups` instead",
797-
DeprecationWarning)
798-
return Group._get_list_or_object(self, id, **kwargs)
799-
800-
def Issue(self, id=None, **kwargs):
801-
"""Lists issues(s) known by the GitLab server.
802-
803-
Does not support creation or getting a single issue unlike other
804-
methods in this class yet.
805-
"""
806-
warnings.warn("`Issue` is deprecated, use `issues` instead",
807-
DeprecationWarning)
808-
return Issue._get_list_or_object(self, id, **kwargs)
809-
810-
def User(self, id=None, **kwargs):
811-
"""Creates/gets/lists users(s) known by the GitLab server.
812-
813-
If id is None, returns a list of users.
814-
815-
If id is an integer, returns the matching user (or raises a
816-
GitlabGetError if not found)
817-
818-
If id is a dict, creates a new object using attributes provided. The
819-
object is NOT saved on the server. Use the save() method on the object
820-
to write it on the server.
821-
"""
822-
warnings.warn("`User` is deprecated, use `users` instead",
823-
DeprecationWarning)
824-
return User._get_list_or_object(self, id, **kwargs)
825-
826-
def Team(self, id=None, **kwargs):
827-
"""Creates/gets/lists team(s) known by the GitLab server.
828-
829-
If id is None, returns a list of teams.
830-
831-
If id is an integer, returns the matching team (or raises a
832-
GitlabGetError if not found)
833-
834-
If id is a dict, create a new object using attributes provided. The
835-
object is NOT saved on the server. Use the save() method on the object
836-
to write it on the server.
837-
"""
838-
warnings.warn("`Team` is deprecated, use `teams` instead",
839-
DeprecationWarning)
840-
return Team._get_list_or_object(self, id, **kwargs)

gitlab/objects.py

Lines changed: 0 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -578,13 +578,6 @@ def _data_for_gitlab(self, extra_parameters={}, update=False):
578578
self.confirm = str(self.confirm).lower()
579579
return super(User, self)._data_for_gitlab(extra_parameters)
580580

581-
def Key(self, id=None, **kwargs):
582-
warnings.warn("`Key` is deprecated, use `keys` instead",
583-
DeprecationWarning)
584-
return UserKey._get_list_or_object(self.gitlab, id,
585-
user_id=self.id,
586-
**kwargs)
587-
588581
def block(self, **kwargs):
589582
"""Blocks the user."""
590583
url = '/users/%s/block' % self.id
@@ -687,11 +680,6 @@ class CurrentUser(GitlabObject):
687680
('keys', CurrentUserKeyManager, [('user_id', 'id')])
688681
]
689682

690-
def Key(self, id=None, **kwargs):
691-
warnings.warn("`Key` is deprecated, use `keys` instead",
692-
DeprecationWarning)
693-
return CurrentUserKey._get_list_or_object(self.gitlab, id, **kwargs)
694-
695683

696684
class ApplicationSettings(GitlabObject):
697685
_url = '/application/settings'
@@ -805,13 +793,6 @@ class Group(GitlabObject):
805793
VISIBILITY_INTERNAL = gitlab.VISIBILITY_INTERNAL
806794
VISIBILITY_PUBLIC = gitlab.VISIBILITY_PUBLIC
807795

808-
def Member(self, id=None, **kwargs):
809-
warnings.warn("`Member` is deprecated, use `members` instead",
810-
DeprecationWarning)
811-
return GroupMember._get_list_or_object(self.gitlab, id,
812-
group_id=self.id,
813-
**kwargs)
814-
815796
def transfer_project(self, id, **kwargs):
816797
"""Transfers a project to this new groups.
817798
@@ -1222,14 +1203,6 @@ def _data_for_gitlab(self, extra_parameters={}, update=False):
12221203
return super(ProjectIssue, self)._data_for_gitlab(extra_parameters,
12231204
update)
12241205

1225-
def Note(self, id=None, **kwargs):
1226-
warnings.warn("`Note` is deprecated, use `notes` instead",
1227-
DeprecationWarning)
1228-
return ProjectIssueNote._get_list_or_object(self.gitlab, id,
1229-
project_id=self.project_id,
1230-
issue_id=self.id,
1231-
**kwargs)
1232-
12331206
def subscribe(self, **kwargs):
12341207
"""Subscribe to an issue.
12351208
@@ -1396,13 +1369,6 @@ class ProjectMergeRequest(GitlabObject):
13961369
managers = [('notes', ProjectMergeRequestNoteManager,
13971370
[('project_id', 'project_id'), ('merge_request_id', 'id')])]
13981371

1399-
def Note(self, id=None, **kwargs):
1400-
warnings.warn("`Note` is deprecated, use `notes` instead",
1401-
DeprecationWarning)
1402-
return ProjectMergeRequestNote._get_list_or_object(
1403-
self.gitlab, id, project_id=self.project_id,
1404-
merge_request_id=self.id, **kwargs)
1405-
14061372
def _data_for_gitlab(self, extra_parameters={}, update=False):
14071373
data = (super(ProjectMergeRequest, self)
14081374
._data_for_gitlab(extra_parameters, update=update))
@@ -1683,15 +1649,6 @@ def Content(self, **kwargs):
16831649
DeprecationWarning)
16841650
return self.content()
16851651

1686-
def Note(self, id=None, **kwargs):
1687-
warnings.warn("`Note` is deprecated, use `notes` instead",
1688-
DeprecationWarning)
1689-
return ProjectSnippetNote._get_list_or_object(
1690-
self.gitlab, id,
1691-
project_id=self.project_id,
1692-
snippet_id=self.id,
1693-
**kwargs)
1694-
16951652
def content(self, streamed=False, action=None, chunk_size=1024, **kwargs):
16961653
"""Return the raw content of a snippet.
16971654
@@ -1791,105 +1748,6 @@ class Project(GitlabObject):
17911748
VISIBILITY_INTERNAL = gitlab.VISIBILITY_INTERNAL
17921749
VISIBILITY_PUBLIC = gitlab.VISIBILITY_PUBLIC
17931750

1794-
def Branch(self, id=None, **kwargs):
1795-
warnings.warn("`Branch` is deprecated, use `branches` instead",
1796-
DeprecationWarning)
1797-
return ProjectBranch._get_list_or_object(self.gitlab, id,
1798-
project_id=self.id,
1799-
**kwargs)
1800-
1801-
def Commit(self, id=None, **kwargs):
1802-
warnings.warn("`Commit` is deprecated, use `commits` instead",
1803-
DeprecationWarning)
1804-
return ProjectCommit._get_list_or_object(self.gitlab, id,
1805-
project_id=self.id,
1806-
**kwargs)
1807-
1808-
def Event(self, id=None, **kwargs):
1809-
warnings.warn("`Event` is deprecated, use `events` instead",
1810-
DeprecationWarning)
1811-
return ProjectEvent._get_list_or_object(self.gitlab, id,
1812-
project_id=self.id,
1813-
**kwargs)
1814-
1815-
def File(self, id=None, **kwargs):
1816-
warnings.warn("`File` is deprecated, use `files` instead",
1817-
DeprecationWarning)
1818-
return ProjectFile._get_list_or_object(self.gitlab, id,
1819-
project_id=self.id,
1820-
**kwargs)
1821-
1822-
def Hook(self, id=None, **kwargs):
1823-
warnings.warn("`Hook` is deprecated, use `hooks` instead",
1824-
DeprecationWarning)
1825-
return ProjectHook._get_list_or_object(self.gitlab, id,
1826-
project_id=self.id,
1827-
**kwargs)
1828-
1829-
def Key(self, id=None, **kwargs):
1830-
warnings.warn("`Key` is deprecated, use `keys` instead",
1831-
DeprecationWarning)
1832-
return ProjectKey._get_list_or_object(self.gitlab, id,
1833-
project_id=self.id,
1834-
**kwargs)
1835-
1836-
def Issue(self, id=None, **kwargs):
1837-
warnings.warn("`Issue` is deprecated, use `issues` instead",
1838-
DeprecationWarning)
1839-
return ProjectIssue._get_list_or_object(self.gitlab, id,
1840-
project_id=self.id,
1841-
**kwargs)
1842-
1843-
def Label(self, id=None, **kwargs):
1844-
warnings.warn("`Label` is deprecated, use `labels` instead",
1845-
DeprecationWarning)
1846-
return ProjectLabel._get_list_or_object(self.gitlab, id,
1847-
project_id=self.id,
1848-
**kwargs)
1849-
1850-
def Member(self, id=None, **kwargs):
1851-
warnings.warn("`Member` is deprecated, use `members` instead",
1852-
DeprecationWarning)
1853-
return ProjectMember._get_list_or_object(self.gitlab, id,
1854-
project_id=self.id,
1855-
**kwargs)
1856-
1857-
def MergeRequest(self, id=None, **kwargs):
1858-
warnings.warn(
1859-
"`MergeRequest` is deprecated, use `mergerequests` instead",
1860-
DeprecationWarning)
1861-
return ProjectMergeRequest._get_list_or_object(self.gitlab, id,
1862-
project_id=self.id,
1863-
**kwargs)
1864-
1865-
def Milestone(self, id=None, **kwargs):
1866-
warnings.warn("`Milestone` is deprecated, use `milestones` instead",
1867-
DeprecationWarning)
1868-
return ProjectMilestone._get_list_or_object(self.gitlab, id,
1869-
project_id=self.id,
1870-
**kwargs)
1871-
1872-
def Note(self, id=None, **kwargs):
1873-
warnings.warn("`Note` is deprecated, use `notes` instead",
1874-
DeprecationWarning)
1875-
return ProjectNote._get_list_or_object(self.gitlab, id,
1876-
project_id=self.id,
1877-
**kwargs)
1878-
1879-
def Snippet(self, id=None, **kwargs):
1880-
warnings.warn("`Snippet` is deprecated, use `snippets` instead",
1881-
DeprecationWarning)
1882-
return ProjectSnippet._get_list_or_object(self.gitlab, id,
1883-
project_id=self.id,
1884-
**kwargs)
1885-
1886-
def Tag(self, id=None, **kwargs):
1887-
warnings.warn("`Tag` is deprecated, use `tags` instead",
1888-
DeprecationWarning)
1889-
return ProjectTag._get_list_or_object(self.gitlab, id,
1890-
project_id=self.id,
1891-
**kwargs)
1892-
18931751
def tree(self, path='', ref_name='', **kwargs):
18941752
warnings.warn("`tree` is deprecated, use `repository_tree` instead",
18951753
DeprecationWarning)
@@ -2366,20 +2224,6 @@ class Team(GitlabObject):
23662224
('projects', TeamProjectManager, [('team_id', 'id')])
23672225
]
23682226

2369-
def Member(self, id=None, **kwargs):
2370-
warnings.warn("`Member` is deprecated, use `members` instead",
2371-
DeprecationWarning)
2372-
return TeamMember._get_list_or_object(self.gitlab, id,
2373-
team_id=self.id,
2374-
**kwargs)
2375-
2376-
def Project(self, id=None, **kwargs):
2377-
warnings.warn("`Project` is deprecated, use `projects` instead",
2378-
DeprecationWarning)
2379-
return TeamProject._get_list_or_object(self.gitlab, id,
2380-
team_id=self.id,
2381-
**kwargs)
2382-
23832227

23842228
class TeamManager(BaseManager):
23852229
obj_cls = Team

0 commit comments

Comments
 (0)
0