Skip to content

Commit

Permalink
Update check_lambda_modules for more PEP 420 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tammy-baylis-swi committed Nov 13, 2024
1 parent bcd6fcd commit 9e40c90
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions lambda/check_lambda_modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,23 @@ if [ ! -f "python/opentelemetry/instrumentation/aws_lambda/__init__.py" ]; then
exit 1
fi

expected_otel_files="./python/opentelemetry/exporter/otlp/proto/common/version.py
./python/opentelemetry/exporter/otlp/proto/grpc/version.py
./python/opentelemetry/exporter/otlp/proto/http/version.py
./python/opentelemetry/exporter/otlp/version.py
./python/opentelemetry/instrumentation/botocore/version.py"
found_otel_files=$(find ./python/opentelemetry/exporter ./python/opentelemetry/instrumentation/botocore -regextype sed -regex ".*/version.py" | sort -k1)
expected_otel_files="./python/opentelemetry/instrumentation/botocore/version.py
./python/opentelemetry/instrumentation/logging/version.py"
found_otel_files=$(find ./python/opentelemetry/instrumentation/botocore ./python/opentelemetry/instrumentation/logging -regextype sed -regex ".*/version.py" | sort -k1)
if [[ ! "$found_otel_files" =~ $expected_otel_files ]]; then
echo "FAILED: Missing key opentelemetry dependency version files"
echo "FAILED: Missing key OpenTelemetry instrumentor dependency files"
exit 1
fi

# An additional check for those packages now following PEP 420
expected_otel_files_pep420="./python/opentelemetry/sdk/version/__init__.py"
found_otel_files_pep420=$(find ./python/opentelemetry/sdk -regextype sed -regex ".*/version/__init__.py" | sort -k1)
# These packages also follow PEP 420 better
expected_otel_files_pep420="./python/opentelemetry/exporter/otlp/proto/common/version/__init__.py
./python/opentelemetry/exporter/otlp/proto/grpc/version/__init__.py
./python/opentelemetry/exporter/otlp/proto/http/version/__init__.py
./python/opentelemetry/exporter/otlp/version/__init__.py
./python/opentelemetry/sdk/version/__init__.py"
found_otel_files_pep420=$(find ./python/opentelemetry/exporter ./python/opentelemetry/sdk -regextype sed -regex ".*/version/__init__.py" | sort -k1)
if [[ ! "$found_otel_files_pep420" =~ $expected_otel_files_pep420 ]]; then
echo "FAILED: Missing key opentelemetry dependency version files (PEP 420)"
echo "FAILED: Missing key OpenTelemetry SDK and/or exporter dependency files"
exit 1
fi

Expand Down

0 comments on commit 9e40c90

Please sign in to comment.