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

Don't use pkg_resources.get_distribution(..).version #256

Merged
merged 4 commits into from
Aug 3, 2023

Conversation

DouglasHeriot
Copy link
Contributor

Similar to discussion at googleapis/python-api-core#27 I am using opentelemetry in an environment where modules are vendored without pip. So, pkg_resources can not be used to search for a module at runtime to get its version.

@DouglasHeriot DouglasHeriot marked this pull request as ready for review July 18, 2023 15:16
@DouglasHeriot DouglasHeriot requested a review from a team as a code owner July 18, 2023 15:16
@aabmass
Copy link
Collaborator

aabmass commented Jul 18, 2023

/gcbrun

Copy link
Collaborator

@aabmass aabmass left a comment

Choose a reason for hiding this comment

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

Can you also update here?

pkg_resources.get_distribution("opentelemetry-sdk").version

@DouglasHeriot
Copy link
Contributor Author

Thanks for noticing that. I also found I missed another use in opentelemetry-exporter-gcp-trace/src/opentelemetry/exporter/cloud_trace/__init__.py.

@DouglasHeriot DouglasHeriot force-pushed the version branch 3 times, most recently from 372a1a9 to 8ef25e2 Compare August 3, 2023 10:14
Fix in GoogleCloudPlatform#254 didn't apply to tox environments that run `pip install .`

`test_detects_gce` was failing with opentelemetry-sdk version 1.19.0
instead of 1.18.0
Similar to discussion at googleapis/python-api-core#27 I am using opentelemetry in an environment where modules are vendored without pip. So, pkg_resources can not be used to search for a module at runtime to get its version.
@DouglasHeriot
Copy link
Contributor Author

This won’t be able to pass the tests until #270 (fix pinning to older opentelemetry-sdk version) and/or #269 (update opentelemetry-sdk version) are merged.

@aabmass
Copy link
Collaborator

aabmass commented Aug 3, 2023

/gcbrun

@aabmass aabmass enabled auto-merge (squash) August 3, 2023 20:25
@aabmass
Copy link
Collaborator

aabmass commented Aug 3, 2023

/gcbrun

@aabmass aabmass merged commit c487ff7 into GoogleCloudPlatform:main Aug 3, 2023
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.

2 participants