bootstrap_upip.sh 634 B

123456789101112131415161718192021222324252627282930
  1. # This script performs bootstrap installation of upip package manager from PyPI
  2. # All the other packages can be installed using it.
  3. saved="$PWD"
  4. if [ "$1" = "" ]; then
  5. dest=~/.micropython/lib/
  6. else
  7. dest="$1"
  8. fi
  9. if [ -z "$TMPDIR" ]; then
  10. cd /tmp
  11. else
  12. cd $TMPDIR
  13. fi
  14. # Remove any stale old version
  15. rm -rf micropython-upip-*
  16. wget -nd -rH -l1 -D files.pythonhosted.org https://pypi.org/project/micropython-upip/ --reject=html
  17. tar xfz micropython-upip-*.tar.gz
  18. tmpd="$PWD"
  19. cd "$saved"
  20. mkdir -p "$dest"
  21. cp "$tmpd"/micropython-upip-*/upip*.py "$dest"
  22. echo "upip is installed. To use:"
  23. echo "micropython -m upip --help"