2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-21 23:01:52 +00:00

venv updates

This commit is contained in:
Philip Sargent 2023-11-23 18:03:57 +00:00
parent 857b4c5809
commit 3158bfb746
3 changed files with 43 additions and 36 deletions

View File

@ -66,6 +66,7 @@ sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt update sudo apt update
sudo apt install python3.12-full -y sudo apt install python3.12-full -y
sudo apt install python3.12-distutils -y sudo apt install python3.12-distutils -y
sudo apt install python3.12-venv -y
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.12 7 sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.12 7
sudo update-alternatives --config python sudo update-alternatives --config python
@ -73,6 +74,15 @@ sudo rm /usr/bin/python3
sudo ln -s /etc/alternatives/python /usr/bin/python3 sudo ln -s /etc/alternatives/python /usr/bin/python3
sudo apt dist-upgrade sudo apt dist-upgrade
# install VS code
sudo apt install software-properties-common apt-transport-https wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt update
sudo apt install code
#this next crashes, why? #this next crashes, why?
#sudo python -m pip install --upgrade pip #sudo python -m pip install --upgrade pip

View File

@ -1,23 +1,20 @@
Pillow==10.1.0
Unidecode==1.3.7
asgiref==3.7.2 asgiref==3.7.2
setuptools==69.0.2 beautifulsoup4==4.12
sqlparse==0.4.4 black==23.11
asgiref==3.6.0 chardet==5.2
BeautifulSoup4==4.12.0 click==8.1
black==23.1.0
chardet==5.1.0
click==8.1.0
coverage==7.1.0 coverage==7.1.0
deptry==0.12.0 deptry==0.12.0
docutils==0.19 docutils==0.20
isort==5.12.0 isort==5.12.0
mypy-extensions==1.0.0 mypy-extensions==1.0.0
packaging==23.0 packaging==23
pathspec==0.11.0 pathspec==0.11
piexif==1.1.3 platformdirs==4.0
Pillow==9.4.0 pytz==2023.3
platformdirs==3.0.0 ruff==0.1
pytz==2022.7
ruff==0.0.245
soupsieve==2.5 soupsieve==2.5
sqlparse==0.4.0 sqlparse==0.4
Unidecode==1.3.0 piexif==1.1

View File

@ -8,17 +8,23 @@ echo '-- Run this in a terminal in the real troggle directory: "bash venv-trog.s
# use the script os-trog.sh # use the script os-trog.sh
# If you are using Debian, then stick with the default version of python # If you are using Debian, then stick with the default version of python
# If you are using Ubuntu, then it is easy to use a later version of python, e.g. 3.11 # If you are using Ubuntu, then it is easy to use a later version of python, e.g. 3.12
# NOW we set up troggle # NOW we set up troggle
PYTHON=python3.12 PYTHON=python3.12
VENAME=p12d5 # python3.x and django 4.2 VENAME=p12d5 # python3.x and django version
echo "** You are logged in as `id -u -n`" echo "** You are logged in as `id -u -n`"
echo "The 50MB pip cache will be in /home/`id -u -n`/.cache/" echo "The 50MB pip cache will be in /home/`id -u -n`/.cache/"
echo "The 150MB venv will created in /home/`id -u -n`/$VENAME/" echo "The 150MB venv will created in /home/`id -u -n`/$VENAME/"
TROGDIR=$(cd $(dirname $0) && pwd) TROGDIR=$(cd $(dirname $0) && pwd)
echo "-- Troggle folder (this script location): ${TROGDIR}" echo "-- Troggle folder (this script location): ${TROGDIR}"
if [[ "${VENAME:(-1)}" == 5 ]]; then
echo "The variable '$VENAME' ends in 5."
else
echo "The variable '$VENAME' does not end in 5."
fi
REQUIRE=requirements-$VENAME.txt REQUIRE=requirements-$VENAME.txt
if [ -d $REQUIRE ]; then if [ -d $REQUIRE ]; then
@ -42,7 +48,7 @@ echo Creating links from Linux filesystem user
cd ~ cd ~
if [ ! -d $VENAME ]; then if [ ! -d $VENAME ]; then
echo "## Creating venv $VENAME. (If this fails with a pip error, you need to ensure you have python3.11-venv installed and/or use a Ubuntu window)" echo "## Creating venv $VENAME. (If this fails with a pip error, you need to ensure you have python3.12-venv installed and/or use a Ubuntu window)"
$PYTHON -m venv $VENAME $PYTHON -m venv $VENAME
else else
echo "## /$VENAME/ already exists ! Delete it first." echo "## /$VENAME/ already exists ! Delete it first."
@ -106,11 +112,7 @@ echo "###"
echo "### now installing ${TROGDIR}/${REQUIRE}" echo "### now installing ${TROGDIR}/${REQUIRE}"
echo "###" echo "###"
cat ${TROGDIR}/${REQUIRE} cat ${TROGDIR}/${REQUIRE}
cp -f ${TROGDIR}/${REQUIRE} ${TROGDIR}/${REQUIRE}.orig
# NOW THERE IS A PERMISSIONS FAILURE THAT DIDN'T HAPPEN BEFORE
# seen on wsl2 as well as wsl1
# which ALSO ruins EXISTING permissions !
# Guessing it is to do with pip not liking non-standard py 3.11 installation on Ubuntu 22.04
read -p "Press any key to resume ..." read -p "Press any key to resume ..."
$PIP install -r ${TROGDIR}/${REQUIRE} $PIP install -r ${TROGDIR}/${REQUIRE}
@ -118,14 +120,17 @@ echo "### install from ${TROGDIR}/${REQUIRE} completed."
echo '### ' echo '### '
# this installs pre-release django 5.0 # this installs pre-release django 5.0
$PIP install --pre django if [[ "${VENAME:(-1)}" == 5 ]]; then
echo "### Installing pre-release version of Django"
$PIP install --pre django
fi
$PIP freeze > $REQUIRE $PIP freeze > $REQUIRE.freeze
# so that we can track requirements more easily with git # so that we can track requirements more easily with git
# because we do not install these with pip, but they are listed by the freeze command # because we do not install these with pip, but they are listed by the freeze command
# Now find out what we actually installed by subtracting the stuff venv installed anyway # Now find out what we actually installed by subtracting the stuff venv installed anyway
sort original.txt > 1 sort original.txt > 1
sort $REQUIRE >2 sort $REQUIRE.freeze >2
comm -3 1 2 --check-order | awk '{ print $1}'>fresh-$REQUIRE comm -3 1 2 --check-order | awk '{ print $1}'>fresh-$REQUIRE
rm 1 rm 1
rm 2 rm 2
@ -139,22 +144,17 @@ $PIP list -o > installed-pip-o.list
REQ=installation-record REQ=installation-record
mkdir $REQ mkdir $REQ
mv $REQUIRE.freeze $REQ
mv original.txt $REQ mv original.txt $REQ
mv $REQUIRE $REQ mv $REQUIRE $REQ
mv original-pip.list $REQ mv original-pip.list $REQ
mv installed-pip.list $REQ mv installed-pip.list $REQ
mv installed-pip-o.list $REQ mv installed-pip-o.list $REQ
cp fresh-$REQUIRE ../$REQUIRE # cp fresh-$REQUIRE ../$REQUIRE
mv fresh-$REQUIRE $REQ mv fresh-$REQUIRE $REQ
cp troggle/`basename "$0"` $REQ cp troggle/`basename "$0"` $REQ
# install VS code
sudo apt install software-properties-common apt-transport-https wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt update
sudo apt install code
$PYTHON --version $PYTHON --version
python --version python --version