File tree Expand file tree Collapse file tree 2 files changed +22
-9
lines changed
Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,20 @@ Installation
1616Code Generation
1717---------------
1818
19- These files were generated automatically. More details on how to generate them
20- are available here _ .
19+ These files were generated automatically from code in opentelemetry-proto _.
20+ To regenerate the code, run `` ../scripts/proto_codegen.sh `` .
2121
22+ To build against a new release or specific commit of opentelemetry-proto _,
23+ update the ``PROTO_REPO_BRANCH_OR_COMMIT `` variable in
24+ ``../scripts/proto_codegen.sh ``. Then run the script and commit the changes
25+ as well as any fixes needed in the OTLP exporter.
2226
23- .. _ here : https://github.com/open-telemetry/opentelemetry-proto
27+ .. _ opentelemetry-proto : https://github.com/open-telemetry/opentelemetry-proto
2428
2529
2630References
2731----------
2832
2933* `OpenTelemetry Project <https://opentelemetry.io/ >`_
3034* `OpenTelemetry Proto <https://github.com/open-telemetry/opentelemetry-proto >`_
35+ * `proto_codegen.sh script <https://github.com/open-telemetry/opentelemetry-python/blob/master/scripts/proto_codegen.sh >`_
Original file line number Diff line number Diff line change @@ -16,16 +16,24 @@ PROTO_REPO_BRANCH_OR_COMMIT="v0.4.0"
1616
1717set -e
1818
19- if [ -z " $VIRTUAL_ENV " ]; then
20- echo ' $VIRTUAL_ENV is not set, you probably forgot to source it. Exiting...'
21- exit 1
22- fi
23-
2419PROTO_REPO_DIR=${PROTO_REPO_DIR:- " /tmp/opentelemetry-proto" }
2520# root of opentelemetry-python repo
2621repo_root=" $( git rev-parse --show-toplevel) "
22+ venv_dir=" /tmp/proto_codegen_venv"
23+
24+ # run on exit even if crash
25+ cleanup () {
26+ echo " Deleting $venv_dir "
27+ rm -rf $venv_dir
28+ }
29+ trap cleanup EXIT
2730
28- python -m pip install -r $repo_root /dev-requirements.txt
31+ echo " Creating temporary virtualenv at $venv_dir using $( python3 --version) "
32+ python3 -m venv $venv_dir
33+ source $venv_dir /bin/activate
34+ python -m pip install \
35+ -c $repo_root /dev-requirements.txt \
36+ grpcio-tools mypy-protobuf
2937
3038# Clone the proto repo if it doesn't exist
3139if [ ! -d " $PROTO_REPO_DIR " ]; then
You can’t perform that action at this time.
0 commit comments