Merge pull request #131 from mikeroll/requirements

Support upgrades and requirements.txt syntax for default packages
This commit is contained in:
Daniel Perez 2022-05-06 23:22:52 +02:00 committed by GitHub
commit 57ef777023
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,17 +33,10 @@ install_python() {
install_default_python_packages() { install_default_python_packages() {
local packages_file="${ASDF_PYTHON_DEFAULT_PACKAGES_FILE:-$HOME/.default-python-packages}" local packages_file="${ASDF_PYTHON_DEFAULT_PACKAGES_FILE:-$HOME/.default-python-packages}"
if [ ! -f "$packages_file" ]; then return; fi if [ -f "$packages_file" ]; then
echo -ne "\nInstalling default python packages..."
while read -r name; do PATH="$ASDF_INSTALL_PATH/bin:$PATH" pip install -U -r "$packages_file"
echo -ne "\nInstalling \033[33m${name}\033[39m python package... "
PATH="$ASDF_INSTALL_PATH/bin:$PATH" pip install "$name" > /dev/null 2>&1 && rc=$? || rc=$?
if [[ $rc -eq 0 ]]; then
echo -e "\033[32mSUCCESS\033[39m"
else
echo -e "\033[31mFAIL\033[39m"
fi fi
done < "$packages_file"
} }
ensure_python_build_installed ensure_python_build_installed