Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove references to Ubuntu 18.04 and installation of Python 3.10 #6260

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions control/activate_venv.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#! /bin/bash
CCHQ_VIRTUALENV=${CCHQ_VIRTUALENV:-cchq}
VENV=~/.virtualenvs/$CCHQ_VIRTUALENV
BIONIC_USE_SYSTEM_PYTHON=${BIONIC_USE_SYSTEM_PYTHON:-false}
fail_on_error='false' # if true, prints error message and returns exit code 1

while test $# -gt 0; do
Expand All @@ -16,22 +15,6 @@ while test $# -gt 0; do
esac
done

if [ "$BIONIC_USE_SYSTEM_PYTHON" == "true" ]; then
echo "The variable BIONIC_USE_SYSTEM_PYTHON is set in your environment."
echo "This variable should only be used temporarily when it is absolutely necessary to use Python 3.6 on 18.04."
echo "Please remove this variable from your environment when you are able to use Python 3.10 again."
fi

# if on 18.04 with 3.10 installed, use cchq-3.10 unless $BIONIC_USE_SYSTEM_PYTHON is true
if [ "$BIONIC_USE_SYSTEM_PYTHON" == "false" ] && hash python3.10 2>/dev/null && [ $( source /etc/os-release; echo "$VERSION_ID" ) == "18.04" ]; then
# only append 3.10 if it is not already in the name
if [[ "$CCHQ_VIRTUALENV" != *"3.10"* ]]; then
# save for reference by callers
CCHQ_VENV_PATH_OLD="$VENV"
CCHQ_VIRTUALENV=$CCHQ_VIRTUALENV-3.10
fi
VENV=~/.virtualenvs/$CCHQ_VIRTUALENV
fi

# activate virtualenv if it exists, otherwise exit with error
if [ -f "$VENV/bin/activate" ]; then
Expand Down
25 changes: 3 additions & 22 deletions control/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
CCHQ_VIRTUALENV=${CCHQ_VIRTUALENV:-cchq}
VENV=~/.virtualenvs/$CCHQ_VIRTUALENV
NO_INPUT=0
BIONIC_USE_SYSTEM_PYTHON=${BIONIC_USE_SYSTEM_PYTHON:-false}

if [[ $_ == $0 ]]
then
Expand Down Expand Up @@ -40,32 +39,14 @@ if [ -z ${CI_TEST} ]; then
if [ "$VIRTUALENV_NOT_FOUND" == "true" ]; then
# check if a virtualenv at $VENV exists yet, and create if not
if [[ ! -f $VENV/bin/activate ]]; then
if [[ $BIONIC_USE_SYSTEM_PYTHON == false ]] && hash python3.10 2>/dev/null; then
echo "Creating a python3.10 virtual environment named ${CCHQ_VIRTUALENV}"
if [ -n "$CCHQ_VENV_PATH_OLD" ]; then
echo "Your old virtual environment will remain at ${CCHQ_VENV_PATH_OLD}"
echo "If you wish to delete it, run 'rm -rf ${CCHQ_VENV_PATH_OLD}'"
fi
# use venv because 3.10 setup includes installing python3.10-venv
python3.10 -m venv "$VENV"
else
# use virtualenv because `python3 -m venv` requires python3-venv
python3 -m pip install --user --upgrade virtualenv
python3 -m virtualenv "$VENV"
fi
# use virtualenv because `python3 -m venv` requires python3-venv
python3 -m pip install --user --upgrade virtualenv
python3 -m virtualenv "$VENV"
fi
source "$VENV/bin/activate"
fi
fi

# check for unsupported python version after virtual env is activated
python_version=`python --version 2>&1 | awk '{print $2}'`
if [[ $python_version = 3.6* ]]; then
echo "commcare-cloud no longer supports Python 3.6."
echo "To upgrade, follow the instructions in:"
echo " https://commcare-cloud.readthedocs.io/en/latest/installation/2-manual-install.html#upgrade-to-python-3-10"
fi

if [ -d ~/commcarehq-ansible ]; then
echo "Moving repo to ~/commcare-cloud"
mv ~/commcarehq-ansible ~/commcare-cloud
Expand Down
5 changes: 1 addition & 4 deletions docs/source/reference/1-commcare-cloud/1-installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ If you get to this point, congratulations! ``commcare-cloud`` is installed.
Manual Installation
-------------------

You will need python 3.10 installed to follow these instructions. See
:ref:`installation/2-manual-install:Upgrade to Python 3.10` for instructions on
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did the target of this link get removed earlier? I could not find it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I think it was removed here

getting it installed on Ubuntu 22.04. Steps for other operating systems may
differ.
You will need python 3.10 installed to follow these instructions.


Setup
Expand Down
6 changes: 0 additions & 6 deletions quick_monolith_install/cchq-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ sudo apt --assume-yes -qq update
sudo apt --assume-yes -qq install python3-pip sshpass
sudo -H pip3 -q install --upgrade pip
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
# install python 3.10 if on ubuntu 18.04 and not installed yet
if ! hash python3.10 2>/dev/null && [[ $( source /etc/os-release; echo $VERSION_ID ) == 18.04 ]]; then
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt update
sudo apt-get --assume-yes -q install python3.10 python3.10-dev python3.10-distutils python3.10-venv libffi-dev
fi

printf "\n"
printf "#################################################"
Expand Down
2 changes: 1 addition & 1 deletion tests/cloud/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM ubuntu:22.04
RUN apt update && \
apt upgrade -y && \
apt install sudo -y && \
Expand Down
Loading