compile_python alias.

This commit is contained in:
Julien Palard 2019-10-17 10:18:37 +02:00
parent 056d7ba0a1
commit d6f0feb696
1 changed files with 14 additions and 0 deletions

14
.bashrc
View File

@ -180,3 +180,17 @@ wyz()
{
curl https://wyz.fr/ -F"${1##*.}=@$1"
}
compile_python()
{
# Inspired from the great https://gitlab.com/python-devs/ci-images/
# Thanks Barry Warsaw.
local PY_VERSION="$1"
cd /tmp
wget -qO- https://www.python.org/ftp/python/$PY_VERSION/Python-$PY_VERSION.tgz | tar -xzf - 2>/dev/null || (
echo "Version not found, try:"
wget -qO- https://www.python.org/ftp/python/ | grep --color $PY_VERSION
)
[ -d Python-$PY_VERSION ] && (cd Python-$PY_VERSION; ./configure --with-pydebug --prefix=$HOME/.local/ && make -j 16 && make altinstall) &&
rm -r Python-$PY_VERSION
}