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

Commitf734c58

Browse files
JohnVillalovosnejch
authored andcommitted
chore: update to mypy 1.16.0 and resolve issues found
There was an error in the type-hints that was detected when updatingto mypy 1.16.0The error was: $ mypy gitlab/v4/cli.py:411: error: Argument 1 to "cls_to_gitlab_resource" has incompatible type "type[Any]"; expected "RESTObject" [arg-type] Found 1 error in 1 file (checked 246 source files)
1 parent378a836 commitf734c58

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

‎gitlab/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def gitlab_resource_to_cls(
107107
returnclass_type
108108

109109

110-
defcls_to_gitlab_resource(cls:RESTObject)->str:
110+
defcls_to_gitlab_resource(cls:type[RESTObject])->str:
111111
dasherized_uppercase=camel_upperlower_regex.sub(r"\1-\2",cls.__name__)
112112
dasherized_lowercase=camel_lowerupper_regex.sub(r"\1-\2",dasherized_uppercase)
113113
returndasherized_lowercase.lower()

‎gitlab/v4/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def extend_parser(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
394394
subparsers.required=True
395395

396396
# populate argparse for all Gitlab Object
397-
classes=set()
397+
classes:set[type[gitlab.base.RESTObject]]=set()
398398
forclsingitlab.v4.objects.__dict__.values():
399399
ifnotisinstance(cls,type):
400400
continue

‎requirements-lint.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ black==25.1.0
44
commitizen==4.8.2
55
flake8==7.2.0
66
isort==6.0.1
7-
mypy==1.15.0
7+
mypy==1.16.0
88
pylint==3.3.7
99
pytest==8.3.5
1010
responses==0.25.7

‎tests/unit/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def error(self, message):
161161
"Raise error instead of exiting on invalid arguments, to make testing easier"
162162
raiseValueError(message)
163163

164-
classFake:
164+
classFake(gitlab.base.RESTObject):
165165
_id_attr=None
166166

167167
classFakeManager(CreateMixin,UpdateMixin,gitlab.base.RESTManager):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp