-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
Python: fix module mappings for opentelemetry libs. #20705
Conversation
"opentelemetry-exporter-otlp": ("opentelemetry.exporter",), | ||
"opentelemetry-exporter-otlp-proto-grpc": ("opentelemetry.exporter.otlp.proto.grpc",), | ||
"opentelemetry-exporter-otlp-proto-http": ("opentelemetry.exporter.otlp.proto.http",), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed these 3, as they map 1:1 with a simple s/-/./g
(the first one was incorrect.. missing the final .otlp
part)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw - the default replacement is s/-/_/g
, so these break now. We should add these back.
pants.backend.python.dependency_inference.rules.UnownedDependencyError: Pants cannot infer owners for the following imports in the target <redacted>:
* opentelemetry.exporter.otlp.proto.http.trace_exporter.OTLPSpanExporter (line: 6)
* opentelemetry.sdk.resources.Resource (line: 11)
* opentelemetry.sdk.resources.SERVICE_NAME (line: 11)
* opentelemetry.sdk.trace.TracerProvider (line: 12)
* opentelemetry.sdk.trace.export.BatchSpanProcessor (line: 14)
* opentelemetry.sdk.trace.export.ConsoleSpanExporter (line: 15)
* opentelemetry.sdk.trace.export.SpanExporter (line: 16)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good catch. Hopefully fixes in #20749
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doh 🤦🏽
@@ -158,22 +158,18 @@ def two_groups_hyphens_two_replacements_with_suffix( | |||
"opencv-python-headless": ("cv2",), | |||
"opensearch-py": ("opensearchpy",), | |||
# opentelemetry | |||
"opentelemetry-api": ("opentelemetry",), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is bogus. opentelemetry
is a namespace. The list of modules attributed to opentelemetry-sdk
actually belongs to opentelemetry-api
, according to the docs linked to from #20551 (so was a mistake to begin with.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, messed that up
"opentelemetry-exporter-otlp-proto-grpc": ("opentelemetry.exporter.otlp.proto.grpc",), | ||
"opentelemetry-exporter-otlp-proto-http": ("opentelemetry.exporter.otlp.proto.http",), | ||
"opentelemetry-instrumentation-kafka-python": ("opentelemetry.instrumentation.kafka",), | ||
"opentelemetry-sdk": ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also 1:1, so no need for a module mapping for it..
Given that these where introduced in 2.20.0a0, I think we'd like to pick them so the correct mappings can be included in the stable release.. |
I tried to automatically cherry-pick this change back to each relevant milestone, so that it is available in those older releases of Pants. ✔️ 2.20.xSuccessfully opened #20713. Thanks again for your contributions! |
…20705) (#20713) Co-authored-by: Andreas Stenius <[email protected]>
Several of mappings for opentelemetry packages were added/adjusted in #20551 and then adjusted more in #20705, but the second adjustment was based on the default fallback mapping replacing `-` with `.`, but it actually replaces them with `_`. This restores explicit mappings for the following (where I've downloaded the wheels and verified their contents): - `opentelemetry-exporter-otlp` - `opentelemetry-exporter-otlp-proto-grpc` - `opentelemetry-exporter-otlp-proto-http` - `opentelemetry-sdk` These were originally added in #16337, released in 2.14.0, so this would be a notable regression if we released 2.20.0 without them. Noticed in #20705 (comment)
Several of mappings for opentelemetry packages were added/adjusted in #20551 and then adjusted more in #20705, but the second adjustment was based on the default fallback mapping replacing `-` with `.`, but it actually replaces them with `_`. This restores explicit mappings for the following (where I've downloaded the wheels and verified their contents): - `opentelemetry-exporter-otlp` - `opentelemetry-exporter-otlp-proto-grpc` - `opentelemetry-exporter-otlp-proto-http` - `opentelemetry-sdk` These were originally added in #16337, released in 2.14.0, so this would be a notable regression if we released 2.20.0 without them. Noticed in #20705 (comment)
…20753) Several of mappings for opentelemetry packages were added/adjusted in #20551 and then adjusted more in #20705, but the second adjustment was based on the default fallback mapping replacing `-` with `.`, but it actually replaces them with `_`. This restores explicit mappings for the following (where I've downloaded the wheels and verified their contents): - `opentelemetry-exporter-otlp` - `opentelemetry-exporter-otlp-proto-grpc` - `opentelemetry-exporter-otlp-proto-http` - `opentelemetry-sdk` These were originally added in #16337, released in 2.14.0, so this would be a notable regression if we released 2.20.0 without them. Noticed in #20705 (comment) Co-authored-by: Huon Wilson <[email protected]>
No description provided.