Skip to content

Commit

Permalink
Use Python via the python3 command instead of python
Browse files Browse the repository at this point in the history
The `python` command was a transitionary symlink to `python3`, that no
longer exists on Heroku-24.

To fix compatibility with Heroku-24, the buildpack now calls the
`python3` command directly.

Both `python` and `python3` pointed to the same Python installation on
all supported Heroku stacks, so this is a no-op for older stacks.

In addition, the buildpack was already using Python 3 syntax in the
commands it called (eg the function form of `print()`), so calling
Python via the `python3` command is technically more correct
regardless.

Fixes #22.
  • Loading branch information
edmorley authored May 26, 2024
1 parent a74e5eb commit a212cf3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ puts_step "Configuring Dynatrace Oneagent..."
# determine default values for connection parameters
DT_MANIFEST="$BUILD_DIR/dynatrace/oneagent/manifest.json"

MANIFEST_TENANT=$(python -c 'import json,sys; print(json.load(sys.stdin)["tenantUUID"])' <$DT_MANIFEST)
MANIFEST_TOKEN=$(python -c 'import json,sys; print(json.load(sys.stdin)["tenantToken"])' <$DT_MANIFEST)
MANIFEST_ENDPOINTS=$(python -c 'import sys, json; print(";".join(json.load(sys.stdin)["communicationEndpoints"]))' <$DT_MANIFEST)
MANIFEST_TENANT=$(python3 -c 'import json,sys; print(json.load(sys.stdin)["tenantUUID"])' <$DT_MANIFEST)
MANIFEST_TOKEN=$(python3 -c 'import json,sys; print(json.load(sys.stdin)["tenantToken"])' <$DT_MANIFEST)
MANIFEST_ENDPOINTS=$(python3 -c 'import sys, json; print(";".join(json.load(sys.stdin)["communicationEndpoints"]))' <$DT_MANIFEST)

VERSION=$(python -c 'import json,sys; print(json.load(sys.stdin)["version"])' <$DT_MANIFEST)
VERSION=$(python3 -c 'import json,sys; print(json.load(sys.stdin)["version"])' <$DT_MANIFEST)

# support pipelined deployments by overriding default values
set_env "DT_TENANT" "\${DT_TENANT:-$MANIFEST_TENANT}"
Expand Down

0 comments on commit a212cf3

Please sign in to comment.