-
Notifications
You must be signed in to change notification settings - Fork 98
Conversation
apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev | ||
apt-get install libtcmalloc-minimal4 | ||
export LD_PRELOAD="/usr/lib/libtcmalloc_minimal.so.4" | ||
cd /tmp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
cd /tmp | ||
wget https://www.python.org/ftp/python/"$PYTHONVERSION"/Python-"$PYTHONVERSION".tar.xz | ||
tar xf Python-"$PYTHONVERSION".tar.xz | ||
cd Python-"$PYTHONVERSION" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
EOF | ||
|
||
echo "Creating new virutal environment using Python $PYTHONVERSION" | ||
python${PYTHONVERSION:: -2} -m venv /srv/homeassistant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double quote to prevent globbing and word splitting.
I'm unsure about this, it can help many users with the upgrade, but it's also a big change. if [ "$FORCE" == "" ]; then
echo "This script will change a lot on your pi."
echo "DO NOT run this if you absolutely have to."
echo "You can force run the upgrade script like this:"
echo "sudo hassbian-config upgrade python --force"
return 0
fi |
I'm unsure about this script. What's your reason for wanting it in? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor cosmetic tweaks and discussion about why this should be added should probably be had.
docs/python.md
Outdated
## Description | ||
This script will upgrade Python to the latest stable version. | ||
It will also create a new virtual environment to be used for Home Assistant. | ||
_This upgrade takes loong time to finish._ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling of long.
docs/python.md
Outdated
This script will upgrade Python to the latest stable version. | ||
It will also create a new virtual environment to be used for Home Assistant. | ||
_This upgrade takes loong time to finish._ | ||
_This prosess takes about a hour on an RPi 3_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change RPI 3 to Rapsberry Pi 3.
@@ -0,0 +1,17 @@ | |||
## Description |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add information that this is not recommended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better now? :)
The main reason is to supply an easy way of upgrading the venv that Home Assistant runs in to a least be supported on jessie (older Hassbian devices), but this will install the latest stable version of Python to comply with future compability issues, and give the benefits that Python 3.6.x have over 3.5.x. @Landrash Since both you and I is unsure about including this, I suggest we closed it for now and revisit it later if we want :) |
I'm actually for this but it would be nice if you make this not run without the --force command and make it print out a warning if you try to install it anyway. |
Description:
This script will upgrade Python to the latest stable version.
It will also create a new virtual environment to be used for Home Assistant.
If it fails, it will revert back to the original virtual environment.
Checklist:
Both tested with current dev branch of
hassbian-scripts
If pertinent:
/docs