Skip to content

Add __all__ or redundant alias to top level kubernetes #1970

@smackesey

Description

@smackesey

What is the feature and why do you need it:

Currently pyright/pylance (popular Python language server/type-checker) give an error for e.g. this:

import kubernetes
kubernetes.config  # error!

# ... "config" is not a known member of module (reportGeneralTypeIssues)

The reason for this is the lack of __all__ and/or rendundant aliasing in kubernetes/__init__.py-- effectively kubernetes has no public interface recognized by pyright/pylance.

Describe the solution you'd like to see:

This is easily fixable by defining __all__ or with redundant aliasing:

import kubernetes.client as client
import kubernetes.config as config
import kubernetes.dynamic as dynamic
import kubernetes.watch as watch
import kubernetes.stream as stream
import kubernetes.utils as utils
import kubernetes.leaderelection as leaderelection

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions