feat: own the injector bootstrap sitecustomize script#33
Open
ocelotl wants to merge 1 commit into
Open
Conversation
Move the OpenTelemetry injector bootstrap script (sitecustomize.py) and its unit tests into the distribution under bootstrap/, so the distribution owns the script that triggers loading it instead of each consumer maintaining a copy. The script is kept as a standalone, valid-Python-2.7+ file that is never imported by the 3.10+ distribution package, so it can detect and bail out gracefully on legacy interpreters. bootstrap/ is excluded from ruff (its pyupgrade rules would rewrite the 2.7-compatible syntax) and its tests run across the existing Python matrix in CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Moves the OpenTelemetry injector bootstrap script (
sitecustomize.py) and its unit tests into this repository underbootstrap/, so the distribution owns the script that triggers loading it, instead of each consumer maintaining its own copy.Why
Follow-up to the discussion on dash0hq/dash0-operator#1248: now that the operator's Python auto-instrumentation payload is the Dash0 distribution, the bootstrap script that loads it belongs with the distribution rather than in the operator repo.
Notes
dash0-opentelemetry-distropackage. It must be able to run under a legacy interpreter and bail out gracefully (version check) rather than crash with aSyntaxError, so it is not baked into the wheel.bootstrap/is excluded from ruff — theUP/pyupgrade rules would rewrite its 2.7-compatible constructs (from __future__,.format()) into 3.x-only syntax. This mirrors how the vendored pyproto packages are excluded.testCI job.all-dependencies.txtfrom its own directory for the double-instrumentation conflict check; that file is generated by the consumer when it assembles the injected package tree and is not part of this repo.Consumer follow-up
The Dash0 operator will copy
bootstrap/sitecustomize.pyout of the pinned distribution tarball instead of shipping its own copy (folded into dash0-operator#1248).