2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

updating venv generation

This commit is contained in:
Philip Sargent 2022-11-15 23:56:17 +00:00
parent 43bf2620f1
commit 96281c33e8
9 changed files with 58 additions and 93 deletions

View File

@ -36,10 +36,10 @@ sudo apt install git openssh-client tunnelx therion -y
sudo useradd expo sudo useradd expo
sudo usermod -a -G sudo expo # to put expo in sudoers group, re-login required sudo usermod -a -G sudo expo # to put expo in sudoers group, re-login required
# default since 22.04 # default since 22.04
# sudo apt install python3.10 # sudo apt install python3.11
sudo apt install python3.10-venv -y sudo apt install python3.11-venv -y
sudo apt install python3.10-dev -y sudo apt install python3.11-dev -y
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
sudo apt install mariadb-server -y sudo apt install mariadb-server -y
sudo apt install libmariadb-dev -y sudo apt install libmariadb-dev -y

View File

@ -1,10 +0,0 @@
asgiref==3.3.4
confusable-homoglyphs==3.2.0
coverage==5.5
Django==2.2.25
docutils==0.14
gunicorn==20.1.0
pytz==2019.1
sqlparse==0.2.4
typing-extensions==3.7.4.3
Unidecode==1.0.23

View File

@ -1,15 +1,9 @@
asgiref==3.5.2 asgiref==3.5.2
confusable-homoglyphs==3.2.0 coverage==6.5.0
coverage==6.4 Django==3.2.16
Django==3.2 docutils==0.19
docutils==0.18 Pillow==9.3.0
mariadb==1.0.11 pytz==2022.6
mysql-connector-python==8.0.29 sqlparse==0.4.3
mysqlclient==2.1.0 typing_extensions==4.4.0
Pillow==9.2.0
protobuf==4.21.2
pytz==2022.5
reportlab==3.6.0
sqlparse==0.4.0
typing_extensions==4.2.0
Unidecode==1.3.6 Unidecode==1.3.6

9
requirements-p11d5.txt Normal file
View File

@ -0,0 +1,9 @@
asgiref==3.5.2
coverage==6.5.0
Django==3.2.16
docutils==0.19
Pillow==9.3.0
pytz==2022.6
sqlparse==0.4.3
typing_extensions==4.4.0
Unidecode==1.3.6

View File

@ -1,15 +0,0 @@
asgiref==3.5.2
confusable-homoglyphs==3.2.0
coverage==6.4
Django==3.2
docutils==0.18
mariadb==1.0.11
mysql-connector-python==8.0.29
mysqlclient==2.1.0
Pillow==9.2.0
protobuf==4.21.2
pytz==2022.5
reportlab==3.6.0
sqlparse==0.4.0
typing_extensions==4.2.0
Unidecode==1.3.6

View File

@ -1,15 +0,0 @@
asgiref==3.5.2
confusable-homoglyphs==3.2.0
coverage==6.4
Django==3.2
docutils==0.18
mariadb==1.0.11
mysql-connector-python==8.0.29
mysqlclient==2.1.0
Pillow==9.2.0
protobuf==4.21.2
pytz==2022.5
reportlab==3.6.0
sqlparse==0.4.0
typing_extensions==4.2.0
Unidecode==1.3.6

View File

@ -1,12 +0,0 @@
asgiref==3.3.4
confusable-homoglyphs==3.2.0
coverage==5.5
Django==3.2
docutils==0.14
gunicorn==20.1.0
Pillow==9.0.1
pytz==2019.1
reportlab==3.6.8
sqlparse==0.2.4
typing-extensions==3.7.4.3
Unidecode==1.0.23

View File

@ -1,15 +1,8 @@
asgiref==3.5.2 asgiref==3.5.2
confusable-homoglyphs==3.2.0 coverage==6.5
coverage==6.4 Django==3.2.16
Django==3.2 docutils==0.19
docutils==0.18 pytz==2022.6
mariadb==1.0.11 typing_extensions==4.4.0
mysql-connector-python==8.0.29
mysqlclient==2.1.0
Pillow==9.2.0
protobuf==4.21.2
pytz==2022.5
reportlab==3.6.0
sqlparse==0.4.0
typing_extensions==4.2.0
Unidecode==1.3.6 Unidecode==1.3.6
Pillow==9.3

View File

@ -1,14 +1,19 @@
#!/bin/bash #!/bin/bash
# footled lots to make this work with python 3.10 and WSL1 on Ubuntu 22.04 # footled lots to make this work with python 3.10 & 3.11 and WSL1 and WSL2 on Ubuntu 22.04
# Run this in a terminal in the troggle directory: 'bash venv-trog.sh' # Run this in a terminal in the troggle directory: 'bash venv-trog.sh'
echo '-- Run this in a terminal in the troggle directory: "bash venv-trog.sh"' echo '-- Run this in a terminal in the real troggle directory: "bash venv-trog.sh"'
# Expects an Ubuntu 22.04 relatively clean install. # Expects an Ubuntu 22.04 relatively clean install.
# If you have not already installed these on your clean Ubuntu install DO THIS FIRST # If you have not already installed these on your clean Ubuntu install DO THIS FIRST
# 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 Ubuntu, then it is easy to use a later version of python, e.g. 3.10 or 3.11
# NOW we set up troggle # NOW we set up troggle
VENAME=p10d5 # python3.10 and django 3.2 PYTHON=python3.10
VENAME=p10d5 # python3.x and django 3.2
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/"
@ -19,8 +24,15 @@ if [ -d requirements.txt ]; then
echo "-- No requirements.txt found. Copy it from your most recent installation." echo "-- No requirements.txt found. Copy it from your most recent installation."
exit 1 exit 1
fi fi
echo ## Using requirements.txt :
cat requirements.txt
echo ##
python --version
$PYTHON --version
# NOTE that when using a later or earlier verison of python, you MUST also
# use the allowed version of Pillow, see https://pillow.readthedocs.io/en/latest/installation.html
# NOW set up link from expo user folder # NOW set up link from expo user folder
# needed for WSL2 # needed for WSL2
@ -29,8 +41,8 @@ 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 use a Ubuntu window)" 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)"
python -m venv $VENAME $PYTHON -m venv $VENAME
else else
echo "## /$VENAME/ already exists ! Delete it first." echo "## /$VENAME/ already exists ! Delete it first."
exit 1 exit 1
@ -49,8 +61,8 @@ echo "### Activated."
# update local version of setuptools, more recent than OS version, needed for packages without wheels # update local version of setuptools, more recent than OS version, needed for packages without wheels
echo "### installing later version of pip inside $VENAME" echo "### installing later version of pip inside $VENAME"
python -m pip install --upgrade pip $PYTHON -m pip install --upgrade pip
python -m pip install --upgrade setuptools $PYTHON -m pip install --upgrade setuptools
PIP=pip PIP=pip
@ -62,9 +74,17 @@ ln -s ${TROGDIR} troggle
ln -s ${TROGDIR}/../expoweb expoweb ln -s ${TROGDIR}/../expoweb expoweb
ln -s ${TROGDIR}/../loser loser ln -s ${TROGDIR}/../loser loser
ln -s ${TROGDIR}/../drawings drawings ln -s ${TROGDIR}/../drawings drawings
ln -s ${TROGDIR}/../expofiles expofiles
echo "### links to expoweb, troggle etc. complete" # fudge for philip's machine
if [ -d ${TROGDIR}/../expofiles ]; then
ln -s ${TROGDIR}/../expofiles expofiles
else
ln -s /mnt/f/expofiles expofiles
fi
echo "### links to expoweb, troggle etc. complete:"
ls -tla
echo "###" echo "###"
echo "### now installing ${TROGDIR}/requirements.txt" echo "### now installing ${TROGDIR}/requirements.txt"
echo "###" echo "###"
@ -101,6 +121,7 @@ mv fresh-requirements.txt $REQ
cp troggle/`basename "$0"` $REQ cp troggle/`basename "$0"` $REQ
$PYTHON --version
python --version python --version
echo "Django version:`django-admin --version`" echo "Django version:`django-admin --version`"
@ -111,7 +132,7 @@ echo "### Now do
'cd ~/$VENAME' 'cd ~/$VENAME'
'source bin/activate' 'source bin/activate'
'cd troggle' 'cd troggle'
'django-admin check' 'django-admin'
'python manage.py check' 'python manage.py check'
'python manage.py test -v 2' 'python manage.py test -v 2'
'./pre-run.sh' './pre-run.sh'