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
16
16
Code Generation
17
17
---------------
18
18
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 `` .
21
21
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.
22
26
23
- .. _ here : https://github.com/open-telemetry/opentelemetry-proto
27
+ .. _ opentelemetry-proto : https://github.com/open-telemetry/opentelemetry-proto
24
28
25
29
26
30
References
27
31
----------
28
32
29
33
* `OpenTelemetry Project <https://opentelemetry.io/ >`_
30
34
* `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"
16
16
17
17
set -e
18
18
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
-
24
19
PROTO_REPO_DIR=${PROTO_REPO_DIR:- " /tmp/opentelemetry-proto" }
25
20
# root of opentelemetry-python repo
26
21
repo_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
27
30
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
29
37
30
38
# Clone the proto repo if it doesn't exist
31
39
if [ ! -d " $PROTO_REPO_DIR " ]; then
You can’t perform that action at this time.
0 commit comments