Skip to content

Commit 3c4e90f

Browse files
committed
chore(common): add comments to release
1 parent 68865df commit 3c4e90f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

bin/release

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
set -euo pipefail
55

6+
# Prefer the Python interpreter staged by `bin/compile`, but fall back to a
7+
# system interpreter so local development and unit tests can still run.
68
if [ -x ".python/bin/python3" ]; then
79
PYTHON_BIN=".python/bin/python3"
810
elif [ -x ".python/bin/python" ]; then
@@ -47,19 +49,23 @@ build_python_entrypoint() {
4749

4850
DEFAULT_WEB_PROCESS=""
4951

50-
# If the app provides its own Procfile, let Cloud Foundry use that.
52+
# Procfile wins. When it exists, Cloud Foundry will read it directly and the
53+
# buildpack should not emit a generated default process type.
5154
if [ -f "Procfile" ]; then
5255
exit 0
5356
fi
5457

55-
# Prefer a script named after `project.name`, then fall back to `start`.
58+
# Without a Procfile, try to synthesize a Python command from pyproject.toml.
59+
# We prefer a console script that matches `project.name`, then fall back to
60+
# a generic `start` script if one exists.
5661
if [ -f "pyproject.toml" ]; then
5762
SCRIPT_TARGET="$(resolve_script_target)"
5863
if [ -n "$SCRIPT_TARGET" ]; then
5964
DEFAULT_WEB_PROCESS="$(build_python_entrypoint "$SCRIPT_TARGET")"
6065
fi
6166
fi
6267

68+
# If there are no console scripts, fall back to common single-file app layouts.
6369
if [ -z "$DEFAULT_WEB_PROCESS" ] && [ -f "main.py" ]; then
6470
DEFAULT_WEB_PROCESS="${PYTHON_BIN} main.py"
6571
fi

0 commit comments

Comments
 (0)