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

Lack of typing info #1588

Closed
Closed
Assignees
JohnVillalovos
@dAnjou

Description

@dAnjou

Hi, while using the library I've noticed some lack of typing info.

Given the following code in a file calledgl.py:

fromgitlabimportGitlabfromgitlab.v4.objectsimportCurrentUserdefget_current_user(gl:Gitlab)->CurrentUser:gl.auth()returngl.userdefget_project(gl:Gitlab,name:str)->str:returngl.projects.get(name).pathdefget_user(gl:Gitlab,name:str)->str:returngl.users.list(username=name)[0].usernamedefget_group(gl:Gitlab,name:str)->str:returngl.groups.get(name).pathif__name__=='__main__':gl=Gitlab('https://gitlab.com',private_token='xxx')user=get_current_user(gl)print(user.username)print(get_project(gl,"gitlab-org/gitlab"))print(get_user(gl,"dAnjou"))print(get_group(gl,"gitlab-org"))

The commandmypy --strict gl.py returns a few errors:

gl.py:1: error: Module "gitlab" does not explicitly export attribute "Gitlab"; implicit reexport disabledgl.py:2: error: Module "gitlab.v4.objects" does not explicitly export attribute "CurrentUser"; implicit reexport disabledgl.py:11: error: Returning Any from function declared to return "str"gl.py:15: error: Returning Any from function declared to return "str"gl.py:19: error: Returning Any from function declared to return "str"Found 5 errors in 1 file (checked 1 source file)
  • python-gitlab==2.10.1
  • default API version 4 on gitlab.com

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp