Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitab4c30c

Browse files
committed
refactor(objects): remove deprecated members.all() method
BREAKING CHANGE: remove deprecated members.all() methodin favor of members_all.list()
1 parent8236281 commitab4c30c

File tree

4 files changed

+0
-53
lines changed

4 files changed

+0
-53
lines changed

‎docs/gl_objects/groups.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,6 @@ List the group members recursively (including inherited members through
272272
ancestor groups)::
273273

274274
members = group.members_all.list(all=True)
275-
# or
276-
members = group.members.all(all=True) # Deprecated
277275

278276
Get only direct group member::
279277

‎docs/gl_objects/projects.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,6 @@ List the project members recursively (including inherited members through
519519
ancestor groups)::
520520

521521
members = project.members_all.list(all=True)
522-
# or
523-
members = project.members.all(all=True) # Deprecated
524522

525523
Search project members matching a query string::
526524

‎gitlab/mixins.py

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# You should have received a copy of the GNU Lesser General Public License
1616
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

18-
importwarnings
1918
fromtypesimportModuleType
2019
fromtypingimport (
2120
Any,
@@ -927,50 +926,3 @@ def render(self, link_url: str, image_url: str, **kwargs: Any) -> Dict[str, Any]
927926
ifTYPE_CHECKING:
928927
assertnotisinstance(result,requests.Response)
929928
returnresult
930-
931-
932-
classMemberAllMixin(_RestManagerBase):
933-
"""This mixin is deprecated."""
934-
935-
_computed_path:Optional[str]
936-
_from_parent_attrs:Dict[str,Any]
937-
_obj_cls:Optional[Type[base.RESTObject]]
938-
_parent:Optional[base.RESTObject]
939-
_parent_attrs:Dict[str,Any]
940-
_path:Optional[str]
941-
gitlab:gitlab.Gitlab
942-
943-
@cli.register_custom_action(("GroupMemberManager","ProjectMemberManager"))
944-
@exc.on_http_error(exc.GitlabListError)
945-
defall(self,**kwargs:Any)->List[base.RESTObject]:
946-
"""List all the members, included inherited ones.
947-
948-
This Method is deprecated.
949-
950-
Args:
951-
all (bool): If True, return all the items, without pagination
952-
per_page (int): Number of items to retrieve per request
953-
page (int): ID of the page to return (starts with page 1)
954-
as_list (bool): If set to False and no pagination option is
955-
defined, return a generator instead of a list
956-
**kwargs: Extra options to send to the server (e.g. sudo)
957-
958-
Raises:
959-
GitlabAuthenticationError: If authentication is not correct
960-
GitlabListError: If the list could not be retrieved
961-
962-
Returns:
963-
RESTObjectList: The list of members
964-
"""
965-
966-
warnings.warn(
967-
"The all() method for this object is deprecated "
968-
"and will be removed in a future version. Use .members_all.list(all=True), instead.",
969-
DeprecationWarning,
970-
)
971-
path="%s/all"%self.path
972-
973-
ifTYPE_CHECKING:
974-
assertself._obj_clsisnotNone
975-
obj=self.gitlab.http_list(path,**kwargs)
976-
return [self._obj_cls(self,item)foriteminobj]

‎tests/functional/api/test_groups.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ def test_groups(gl):
8989

9090
group1.members.delete(user.id)
9191
assertlen(group1.members.list())==2
92-
assertlen(group1.members.all())# Deprecated
9392
assertlen(group1.members_all.list())
9493
member=group1.members.get(user2.id)
9594
member.access_level=gitlab.const.OWNER_ACCESS

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp