8000 Deprecate the assign method · shalevy1/github3.py@8e226d7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8e226d7

Browse files
committed
Deprecate the assign method
This method leveraged the deprecated `assignee` argument of the `edit` method. It is deprecated in favor of the `add_assignees` method, which uses the `assignees` argument instead.
1 parent acc328a commit 8e226d7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/github3/issues/issue.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"""Module containing the Issue logic."""
33
from __future__ import unicode_literals
44

5+
import warnings
56
from json import dumps
67

78
from uritemplate import URITemplate
@@ -107,6 +108,10 @@ def add_labels(self, *args):
107108
def assign(self, username):
108109
"""Assign user ``username`` to this issue.
109110
111+
.. deprecated:: 1.2.0
112+
113+
Use :meth:`github3.issues.issue.Issue.add_assignees` instead.
114+
110115
This is a short cut for :meth:`~github3.issues.issue.Issue.edit`.
111116
112117
:param str username:
@@ -116,6 +121,9 @@ def assign(self, username):
116121
:rtype:
117122
bool
118123
"""
124+
warnings.warn(
125+
'This method is deprecated. Please use ``add_assignees`` '
126+
'instead.', DeprecationWarning, stacklevel=2)
119127
if not username:
120128
return False
121129
number = self.milestone.number if self.milestone else None

0 commit comments

Comments
 (0)
0