#!/usr/bin/env bash# Upgrade pip and the named packages in the active virtualenv.set-e# Exit on errorupgrade(){cd"$(gitrev-parse--show-toplevel)"[[-z"${VIRTUAL_ENV}"]]&&{echo"Error: Not in a Python virtual environment. Please activate your venv first."exit1}python3-c"import sys; raise SystemExit(0 if sys.prefix != sys.base_prefix else 1)"||{echo"Error: Not in a Python virtual environment. Please activate your venv first."exit1}python3-mpipinstall--upgradepippython3-mpipinstall--upgrade"$@"}if[["${BASH_SOURCE[0]}"=="${0}"]];thenupgrade"$@"fi