Skip to content

Commit

Permalink
fix: update Python installation script to require version specification
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Marvin Zhang committed Dec 30, 2024
1 parent 9bdb0c9 commit 3438919
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docker/base-image/install/python/python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -e
print_usage() {
echo "Usage: $0 <command> [version] [requirements]"
echo "Commands:"
echo " install <version> - Install Python version (default: 3.12)"
echo " install <version> - Install Python version (default: latest)"
echo " uninstall <version> - Uninstall Python version"
echo " switch <version> - Switch to a different Python version"
echo " list - List installed Python versions"
Expand Down Expand Up @@ -104,15 +104,19 @@ handle_requirements() {
}

# Main logic
command="${1:-install}"
version="${2:-3.12.8}"
command="${1:-}"
version="${2:-}"
requirements="${3:-}"

case $command in
"setup")
setup_pyenv
;;
"install")
if [ -z "$version" ]; then
echo "Please specify a version to install"
exit 1
fi
setup_pyenv
# Check if version is already installed
if pyenv versions | grep -q $version; then
Expand Down

0 comments on commit 3438919

Please sign in to comment.