Skip to content

Type hinting using gitlab library does not work (or is not properly documented) #2213

@tuergeist

Description

@tuergeist

Description of the problem, including code/CLI snippet

Using the gitlab objects for type hinting is not possible or not documented how to use them

e.g. I have a method finding a project and returning the object.
The following definition fails due to

.venv/lib/python3.10/site-packages/gitlab/__init__.py:53: in __getattr__
    raise AttributeError(f"module {__name__} has no attribute {name}")
E   AttributeError: module gitlab has no attribute v4
def get_project() -> gitlab.v4.objects.projects.Project:

Expected Behavior

Defined objects can be used for type hinting in code using this library.

Actual Behavior

Cannot access (internal) objects for type hinting.

Specifications

  • python-gitlab version: 3.7.0
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com):

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions