Skip to content

Commit 3438919

Browse files
author
Marvin Zhang
committed
fix: update Python installation script to require version specification
- Modified the Python installation script to remove the default version assignment and enforce version specification during installation. - Updated usage instructions to reflect the change from a default version to requiring a user-defined version, improving clarity and preventing installation errors. - This change enhances the robustness of the installation process by ensuring users explicitly define the Python version they wish to install.
1 parent 9bdb0c9 commit 3438919

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docker/base-image/install/python/python.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -e
77
print_usage() {
88
echo "Usage: $0 <command> [version] [requirements]"
99
echo "Commands:"
10-
echo " install <version> - Install Python version (default: 3.12)"
10+
echo " install <version> - Install Python version (default: latest)"
1111
echo " uninstall <version> - Uninstall Python version"
1212
echo " switch <version> - Switch to a different Python version"
1313
echo " list - List installed Python versions"
@@ -104,15 +104,19 @@ handle_requirements() {
104104
}
105105

106106
# Main logic
107-
command="${1:-install}"
108-
version="${2:-3.12.8}"
107+
command="${1:-}"
108+
version="${2:-}"
109109
requirements="${3:-}"
110110

111111
case $command in
112112
"setup")
113113
setup_pyenv
114114
;;
115115
"install")
116+
if [ -z "$version" ]; then
117+
echo "Please specify a version to install"
118+
exit 1
119+
fi
116120
setup_pyenv
117121
# Check if version is already installed
118122
if pyenv versions | grep -q $version; then

0 commit comments

Comments
 (0)