Skip to content

Commit fdeb3fb

Browse files
committed
Fix convert argument in recent attrs versions
Starting from 17.4.0, attrs don't support convert. converter was introduced as replacement. This makes sure things can at least get instanciated with recent attrs.
1 parent b7f27f4 commit fdeb3fb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

gogs_client/entities.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class GogsRepo(GogsEntity):
102102
#: The owner of the repository
103103
#:
104104
#: :type: :class:`~GogsUser`
105-
owner = attr.ib(convert=lambda parsed_json: GogsUser.from_json(parsed_json))
105+
owner = attr.ib(converter=lambda parsed_json: GogsUser.from_json(parsed_json))
106106

107107
#: The name of the repository
108108
#:
@@ -145,12 +145,12 @@ def urls(self):
145145
#: Permissions for the repository
146146
#:
147147
#: :type: :class:`~GogsRepo.Permissions`
148-
permissions = attr.ib(convert=lambda data: GogsRepo.Permissions.from_json(data))
148+
permissions = attr.ib(converter=lambda data: GogsRepo.Permissions.from_json(data))
149149

150150
#: Gets the repository's parent, when a fork
151151
#:
152152
#: :type: :class:`~GogsRepo`
153-
parent = attr.ib(convert=lambda data: GogsRepo.from_json(data) if data else None, default=None)
153+
parent = attr.ib(converter=lambda data: GogsRepo.from_json(data) if data else None, default=None)
154154

155155
#: The description of the repository
156156
#:
@@ -299,7 +299,7 @@ class GogsBranch(GogsEntity):
299299
#: The HEAD commit of the branch
300300
#:
301301
#: :type: :class:`~GogsCommit`
302-
commit = attr.ib(convert=lambda parsed_json: GogsCommit.from_json(parsed_json))
302+
commit = attr.ib(converter=lambda parsed_json: GogsCommit.from_json(parsed_json))
303303

304304

305305
@attr.s(frozen=True)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
attrs
1+
attrs>=17.4.0
22
future
33
requests

0 commit comments

Comments
 (0)