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

Fix api/sdk setup.cfg to include missing python files #1091

Merged
merged 1 commit into from
Sep 11, 2020

Conversation

aabmass
Copy link
Member

@aabmass aabmass commented Sep 10, 2020

Description

The include line in setup.cfg was causing only packages under opentelemetry.sdk and opentelemetry to be included, missing the opentelemetry.sdk package itself (with version.py and __init__.py files). I don't think we need the include at all, so removed. It is not in any of the other packages' setup files.

Fixes #1078

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Installing the packages (regular install, not editable) before and after into separate venvs and comparing the site-packages

rm -rf venv-before
python3 -m venv venv-before
source venv-before/bin/activate
pip install file:./opentelemetry-api file:./opentelemetry-sdk
tree -I *.pyc -I __pycache__ venv-before/lib/python3.8/site-packages/opentelemetry

Before:

Processing ./opentelemetry-api
Processing ./opentelemetry-sdk
Using legacy setup.py install for opentelemetry-api, since package 'wheel' is not installed.
Using legacy setup.py install for opentelemetry-sdk, since package 'wheel' is not installed.
Installing collected packages: opentelemetry-api, opentelemetry-sdk
    Running setup.py install for opentelemetry-api ... done
    Running setup.py install for opentelemetry-sdk ... done
Successfully installed opentelemetry-api-0.13.dev0 opentelemetry-sdk-0.13.dev0
venv-before/lib/python3.8/site-packages/opentelemetry
├── baggage
│   ├── __init__.py
│   └── propagation
│       └── __init__.py
├── configuration
│   ├── __init__.py
│   └── py.typed
├── context
│   ├── aiocontextvarsfix.py
│   ├── context.py
│   ├── contextvars_context.py
│   ├── __init__.py
│   ├── py.typed
│   └── threadlocal_context.py
├── distributedcontext
│   └── py.typed
├── metrics
│   ├── __init__.py
│   └── py.typed
├── propagators
│   ├── composite.py
│   └── __init__.py
├── sdk
│   ├── metrics
│   │   ├── export
│   │   │   ├── aggregate.py
│   │   │   ├── batcher.py
│   │   │   ├── controller.py
│   │   │   ├── __init__.py
│   │   │   └── in_memory_metrics_exporter.py
│   │   ├── __init__.py
│   │   └── view.py
│   ├── resources
│   │   └── __init__.py
│   ├── trace
│   │   ├── export
│   │   │   ├── __init__.py
│   │   │   └── in_memory_span_exporter.py
│   │   ├── __init__.py
│   │   ├── propagation
│   │   │   ├── b3_format.py
│   │   │   └── __init__.py
│   │   └── sampling.py
│   └── util
│       ├── __init__.py
│       └── instrumentation.py
├── trace
│   ├── __init__.py
│   ├── propagation
│   │   ├── __init__.py
│   │   ├── textmap.py
│   │   └── tracecontext.py
│   ├── py.typed
│   ├── span.py
│   └── status.py
└── util
    ├── __init__.py
    ├── py.typed
    └── types.py

18 directories, 41 files

After:

Processing ./opentelemetry-api
Processing ./opentelemetry-sdk
Using legacy setup.py install for opentelemetry-api, since package 'wheel' is not installed.
Using legacy setup.py install for opentelemetry-sdk, since package 'wheel' is not installed.
Installing collected packages: opentelemetry-api, opentelemetry-sdk
    Running setup.py install for opentelemetry-api ... done
    Running setup.py install for opentelemetry-sdk ... done
Successfully installed opentelemetry-api-0.13.dev0 opentelemetry-sdk-0.13.dev0
venv-after/lib/python3.8/site-packages/opentelemetry
├── baggage
│   ├── __init__.py
│   └── propagation
│       └── __init__.py
├── configuration
│   ├── __init__.py
│   └── py.typed
├── context
│   ├── aiocontextvarsfix.py
│   ├── context.py
│   ├── contextvars_context.py
│   ├── __init__.py
│   ├── py.typed
│   └── threadlocal_context.py
├── distributedcontext
│   └── py.typed
├── __init__.pyi
├── metrics
│   ├── __init__.py
│   └── py.typed
├── propagators
│   ├── composite.py
│   └── __init__.py
├── sdk
│   ├── __init__.py
│   ├── metrics
│   │   ├── export
│   │   │   ├── aggregate.py
│   │   │   ├── batcher.py
│   │   │   ├── controller.py
│   │   │   ├── __init__.py
│   │   │   └── in_memory_metrics_exporter.py
│   │   ├── __init__.py
│   │   └── view.py
│   ├── resources
│   │   └── __init__.py
│   ├── trace
│   │   ├── export
│   │   │   ├── __init__.py
│   │   │   └── in_memory_span_exporter.py
│   │   ├── __init__.py
│   │   ├── propagation
│   │   │   ├── b3_format.py
│   │   │   └── __init__.py
│   │   └── sampling.py
│   ├── util
│   │   ├── __init__.py
│   │   └── instrumentation.py
│   └── version.py
├── trace
│   ├── __init__.py
│   ├── propagation
│   │   ├── __init__.py
│   │   ├── textmap.py
│   │   └── tracecontext.py
│   ├── py.typed
│   ├── span.py
│   └── status.py
├── util
│   ├── __init__.py
│   ├── py.typed
│   └── types.py
└── version.py

18 directories, 45 files

Diff of two venvs with diff --color <(find venv-before/lib/python3.8/site-packages/ -type f -not -name "*.pyc" -printf "%P\n" | sort) <(find venv-after/lib/python3.8/site-packages/ -type f -not -name "*.pyc" -printf "%P\n" | sort)

20a21
> opentelemetry/__init__.pyi
32a34
> opentelemetry/sdk/__init__.py
48a51
> opentelemetry/sdk/version.py
58a62
> opentelemetry/version.py

So those 4 extra files were included after this change.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@aabmass aabmass changed the title Fix sdk/__init__.py not being included Fix api/sdk setup.cfg to include missing python files Sep 10, 2020
@aabmass aabmass marked this pull request as ready for review September 10, 2020 17:57
@aabmass aabmass requested a review from a team as a code owner September 10, 2020 17:57
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@lzchen lzchen merged commit 12f51bc into open-telemetry:master Sep 11, 2020
@aabmass aabmass deleted the sdk-init-1078 branch September 14, 2020 22:23
@aabmass aabmass mentioned this pull request Sep 22, 2020
2 tasks
srikanthccv pushed a commit to srikanthccv/opentelemetry-python that referenced this pull request Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sdk/__init__.py not correctly packaged
4 participants