ReadTheDocs and pkg_resources fix#1145
Conversation
codeboten
left a comment
There was a problem hiding this comment.
This approach seems fine to me. Thanks for the fix!
| TELEMETRY_SDK_NAME = "telemetry.sdk.name" | ||
| TELEMETRY_SDK_VERSION = "telemetry.sdk.version" | ||
|
|
||
| OPENTELEMETRY_SDK_VERSION = pkg_resources.get_distribution( |
There was a problem hiding this comment.
I believe it would if the autodoc directive included that util.py file, but it just includes it doesn't: https://github.com/open-telemetry/opentelemetry-python/blob/master/docs/exporter/opencensus/opencensus.rst
So all you see in the docs here is the docstring here:
There was a problem hiding this comment.
I could fix that one up to do this as well though in case it's added in the future. Another option is to update the docs-requirements.txt file to actually install the opentelemetry-sdk/opentelemetry-api in the virtualenv so that pkg_resources.get_distrubution() works correctly.
There was a problem hiding this comment.
Gonna go with this second approach instead 👍
b95def6 to
83c5d15
Compare
* chore: creating new metric kind * chore: adding todo to remove observer kind later
Description
ReadTheDocs builds do not currently install the OTel packages in a virtualenv, but just update
sys.pathto include the modules. Autodoc imports the modules, which runs this code, but since the package isn't installed,pkg_resources.get_distribution()fails.This change has
opentelemetry-apiandopentelemetry-sdkinstalled in the virtualenv to fix this.Fixes #1144
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Ran the commands from https://readthedocs.org/projects/opentelemetry-python/builds/11937984/ and the issue is resolved.
Checklist: