Skip to content

Commit

Permalink
Display Python SDK version (#1035)
Browse files Browse the repository at this point in the history
* Fix display of opentelemetry-sdk for Python

Fixes #1034

* Address comments
  • Loading branch information
ocelotl authored Dec 11, 2023
1 parent 1dd336e commit 54dec65
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/release-layer-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,38 @@ jobs:
build-layer:
runs-on: ubuntu-latest
outputs:
PYTHON_SDK_VERSION: ${{ steps.save-python-sdk-version.outputs.PYTHON_SDK_VERSION}}
PYTHON_OPENTELEMETRY_SDK_VERSION: ${{ steps.save-python-opentelemetry-sdk-version.outputs.PYTHON_OPENTELEMETRY_SDK_VERSION}}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Save PYTHON_OPENTELEMETRY_SDK_VERSION
id: save-python-opentelemetry-sdk-version
run: |
cd python/src
echo "PYTHON_OPENTELEMETRY_SDK_VERSION=$(cat otel/otel_sdk/requirements.txt | grep opentelemetry-sdk | sed 's/.*==\([^ ]*\).*/\1/')" >> $GITHUB_ENV
echo "PYTHON_OPENTELEMETRY_SDK_VERSION=$PYTHON_OPENTELEMETRY_SDK_VERSION" >> $GITHUB_OUTPUT
shell: bash

- name: Display PYTHON_OPENTELEMETRY_SDK_VERSION
run: |
echo "PYTHON_OPENTELEMETRY_SDK_VERSION=${{ env.PYTHON_OPENTELEMETRY_SDK_VERSION }}"
shell: bash

- name: Build
run: |
cd python/src
PYTHON_SDK_VERSION=$(./build.sh 2>&1 > /dev/null | sed -n "s/opentelemetry-sdk==\(.*\)/\1/p")
./build.sh
shell: bash

- name: Show directory contents
run: |
ls -al
working-directory: python/src/build

- name: Save Python SDK Version
id: save-python-sdk-version
run: |
echo "PYTHON_SDK_VERSION=$PYTHON_SDK_VERSION" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
name: Save assembled layer to build
with:
Expand Down Expand Up @@ -69,8 +77,7 @@ jobs:
with:
artifact-name: opentelemetry-python-layer.zip
layer-name: opentelemetry-python
component-version: ${{needs.build-layer.outputs.PYTHON_SDK_VERSION}}
# architecture:
component-version: ${{needs.build-layer.outputs.PYTHON_OPENTELEMETRY_SDK_VERSION}}
release-group: prod
aws_region: ${{ matrix.aws_region }}
secrets: inherit
1 change: 0 additions & 1 deletion python/src/otel/otel_sdk/requirements-nodeps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ opentelemetry-instrumentation-sqlite3==0.42b0
opentelemetry-instrumentation-starlette==0.42b0
opentelemetry-instrumentation-tornado==0.42b0
opentelemetry-instrumentation-wsgi==0.42b0

1 change: 1 addition & 0 deletions python/src/otel/otel_sdk/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
opentelemetry-sdk==1.21.0
opentelemetry-exporter-otlp-proto-http==1.21.0
opentelemetry-distro==0.42b0
opentelemetry-instrumentation-aws-lambda==0.42b0

0 comments on commit 54dec65

Please sign in to comment.