Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
NathanielRN opened this issue Oct 6, 2020 · 0 comments · Fixed by #1205
Closed
Labels
bug Something isn't working

Comments

@NathanielRN
Copy link
Contributor

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.

@NathanielRN NathanielRN added the bug Something isn't working label Oct 6, 2020
srikanthccv pushed a commit to srikanthccv/opentelemetry-python that referenced this issue Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant