mirror of
https://github.com/YunoHost-Apps/synapse_ynh.git
synced 2024-09-03 20:26:38 +02:00
Migrate to python3
This commit is contained in:
parent
cf89f04452
commit
3ff83f5962
4 changed files with 25 additions and 22 deletions
|
@ -0,0 +1 @@
|
|||
dependances="coturn build-essential python3-dev libffi-dev python3-pip python3-setuptools sqlite3 libssl-dev python3-venv libxml2-dev libxslt1-dev python3-lxml libjpeg-dev libpq-dev postgresql acl"
|
|
@ -92,8 +92,8 @@ ynh_app_setting_set $app cli_port $cli_port
|
|||
|
||||
# WARNING : theses command are used in INSTALL, UPGRADE, RESTORE
|
||||
# For any update do it in all files
|
||||
ynh_install_app_dependencies coturn build-essential python2.7-dev libffi-dev python-pip python-setuptools sqlite3 libssl-dev python-virtualenv libxml2-dev libxslt1-dev python-lxml libjpeg-dev libpq-dev postgresql acl
|
||||
pip install --upgrade virtualenv
|
||||
ynh_install_app_dependencies $dependances
|
||||
pip3 install --upgrade virtualenv
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
|
@ -138,7 +138,7 @@ then
|
|||
ynh_setup_source $final_path/ "armv7_$(lsb_release --codename --short)"
|
||||
else
|
||||
# Install virtualenv if it don't exist
|
||||
test -e $final_path/bin || virtualenv -p python2.7 $final_path
|
||||
test -e $final_path/bin/python3 || python3 -m venv $final_path
|
||||
|
||||
# Install synapse in virtualenv
|
||||
PS1=${PS1:-}
|
||||
|
@ -147,17 +147,12 @@ else
|
|||
|
||||
# We set all necessary environement variable to create a python virtualenvironnement.
|
||||
source $final_path/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install --upgrade setuptools
|
||||
pip install --upgrade cffi ndg-httpsclient psycopg2 lxml
|
||||
pip3 install --upgrade pip
|
||||
pip3 install --upgrade setuptools
|
||||
pip3 install --upgrade cffi ndg-httpsclient psycopg2 lxml
|
||||
|
||||
ynh_setup_source "/tmp" "python_source"
|
||||
pip install --upgrade "/tmp/synapse_source.tar.gz"
|
||||
|
||||
# Fix issue with msgpack see https://github.com/YunoHost-Apps/synapse_ynh/issues/29
|
||||
test -e $final_path/lib/python2.7/site-packages/msgpack/__init__.py || (\
|
||||
pip uninstall -y msgpack-python msgpack; \
|
||||
pip install msgpack-python)
|
||||
pip3 install --upgrade "/tmp/synapse_source.tar.gz"
|
||||
|
||||
# This function was defined when we called "source $final_path/bin/activate". With this function we undo what "$final_path/bin/activate" does
|
||||
deactivate
|
||||
|
|
|
@ -59,7 +59,7 @@ ynh_restore
|
|||
|
||||
# WARNING : theses command are used in INSTALL, UPGRADE, RESTORE
|
||||
# For any update do it in all files
|
||||
ynh_install_app_dependencies coturn build-essential python2.7-dev libffi-dev python-pip python-setuptools sqlite3 libssl-dev python-virtualenv libxml2-dev libxslt1-dev python-lxml libjpeg-dev libpq-dev postgresql acl
|
||||
ynh_install_app_dependencies $dependances
|
||||
pip install --upgrade virtualenv
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -74,12 +74,24 @@ fi
|
|||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
|
||||
# WARNING : theses command are used in INSTALL, UPGRADE, RESTORE
|
||||
# For any update do it in all files
|
||||
ynh_install_app_dependencies $dependances
|
||||
pip install --upgrade virtualenv
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
||||
# Install/upgrade synapse in virtualenv
|
||||
|
||||
# Clean venv is it was on python2.7
|
||||
test -e $final_path/bin/python3 || ynh_secure_remove $final_path
|
||||
|
||||
# WARNING : these commands are used in INSTALL, UPGRADE
|
||||
# For any update do it in all files
|
||||
|
||||
|
@ -88,7 +100,7 @@ then
|
|||
ynh_setup_source $final_path/ "armv7_$(lsb_release --codename --short)"
|
||||
else
|
||||
# Install virtualenv if it don't exist
|
||||
test -e $final_path/bin || virtualenv -p python2.7 $final_path
|
||||
test -e $final_path/bin/python3 || python3 -m venv $final_path
|
||||
|
||||
# Install synapse in virtualenv
|
||||
PS1=${PS1:-}
|
||||
|
@ -97,17 +109,12 @@ else
|
|||
|
||||
# We set all necessary environement variable to create a python virtualenvironnement.
|
||||
source $final_path/bin/activate
|
||||
pip install --upgrade setuptools
|
||||
pip install --upgrade cffi ndg-httpsclient psycopg2 lxml
|
||||
pip3 install --upgrade setuptools
|
||||
pip3 install --upgrade cffi ndg-httpsclient psycopg2 lxml
|
||||
|
||||
# Download and check the checksum for the synapse source
|
||||
ynh_setup_source "/tmp" "python_source"
|
||||
pip install --upgrade "/tmp/synapse_source.tar.gz"
|
||||
|
||||
# Fix issue with msgpack see https://github.com/YunoHost-Apps/synapse_ynh/issues/29
|
||||
test -e $final_path/lib/python2.7/site-packages/msgpack/__init__.py || (\
|
||||
pip uninstall -y msgpack-python msgpack; \
|
||||
pip install msgpack-python)
|
||||
pip3 install --upgrade "/tmp/synapse_source.tar.gz"
|
||||
|
||||
# This function was defined when we called "source $final_path/bin/activate". With this function we undo what "$final_path/bin/activate" does
|
||||
deactivate
|
||||
|
|
Loading…
Add table
Reference in a new issue