Skip to content

SDK package is setup as a Regular Package when it should be a Namespace Package #1204

@NathanielRN

Description

@NathanielRN

As a follow up to @aabmass 's comment on #769, the __init__.py file in the SDK package causes it to be interpreted as a Regular Package instead of a Namespace Package. See the two types of Python packages. Namespace Packages should not have an __init__.py file.

Namespace packages are meant to contribute sub-packages (e.g. sdk.metrics, sdk.traces, sdk.resources) to some parent package (i.e. opentelemtry.sdk).

Having this __init__.py file makes it so that we cannot extend the opentelmetry.sdk package to have additional sub-packges (e.g. opentelemetry.sdk.extension).

The solution should be the same as in #769 , where we change the file to be called __init__.pyi instead. This should allow mypy to know this is a namespace package without preventing future sub-packages from being added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions