Bump minimum python version to 3.7.0 (#2394)

This is in anticipation of #2246, although I've written that PR to not break on 3.6, the feature itself is not usable on 3.6. So I think the best way forward is to simply require python 3.7. This also allows devs and cog creators to utilise all of the new features in 3.7, and it also updates the docs so all operating systems will have 3.7 installed.

Signed-off-by: Toby <tobyharradine@gmail.com>
This commit is contained in:
Toby Harradine
2019-01-30 14:07:53 +11:00
committed by GitHub
parent c7d98f88e8
commit 016a6d3aa6
13 changed files with 99 additions and 82 deletions

View File

@@ -16,11 +16,13 @@ Installing the pre-requirements
Please install the pre-requirements using the commands listed for your operating system.
The pre-requirements are:
- Python 3.6.2 or greater
- Python 3.7.0 or greater
- pip 9.0 or greater
- git
- Java Runtime Environment 8 or later (for audio support)
.. _install-arch:
~~~~~~~~~~
Arch Linux
~~~~~~~~~~
@@ -29,15 +31,25 @@ Arch Linux
sudo pacman -Syu python-pip git base-devel jre8-openjdk
~~~~~~~~
CentOS 7
~~~~~~~~
.. _install-centos:
.. _install-fedora:
.. _install-rhel:
~~~~~~~~~~~~~~~~~~~~~~~~~~
CentOS 7, Fedora, and RHEL
~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: none
yum -y groupinstall development
yum -y install https://centos7.iuscommunity.org/ius-release.rpm
yum -y install yum-utils wget which python36u python36u-pip python36u-devel openssl-devel libffi-devel git2u java-1.8.0-openjdk
sudo yum install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel \
openssl-devel xz xz-devel libffi-devel git2u java-1.8.0-openjdk
Complete the rest of the installation by `installing Python 3.7 with pyenv <install-python-pyenv>`.
.. _install-debian:
.. _install-raspbian:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Debian and Raspbian Stretch
@@ -53,27 +65,14 @@ Debian/Raspbian Stretch. This guide will tell you how. First, run the following
.. code-block:: none
sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev git unzip default-jre
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl python3-openssl git unzip \
default-jre
After that last command, you may see a warning about 'pyenv' not being in the load path. Follow the
instructions given to fix that, then close and reopen your shell.
Complete the rest of the installation by `installing Python 3.7 with pyenv <install-python-pyenv>`.
Then run the following command:
.. code-block:: none
CONFIGURE_OPTS=--enable-optimizations pyenv install 3.7.0 -v
This may take a long time to complete.
After that is finished, run:
.. code-block:: none
pyenv global 3.7.0
Pyenv is now installed and your system should be configured to run Python 3.7.
.. _install-mac:
~~~
Mac
@@ -91,24 +90,31 @@ one-by-one:
.. code-block:: none
brew install python3 --with-brewed-openssl
brew install python --with-brewed-openssl
brew install git
brew tap caskroom/versions
brew cask install java8
~~~~~~~~~~~~~~~~~~~~~~~~~~
Ubuntu 18.04 Bionic Beaver
~~~~~~~~~~~~~~~~~~~~~~~~~~
.. _install-ubuntu:
.. _install-ubuntu-bionic:
.. _install-ubuntu-cosmic:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ubuntu 18.04 Bionic Beaver and 18.10 Cosmic Cuttlefish
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: none
sudo apt install python3.6-dev python3-pip build-essential libssl-dev libffi-dev git unzip default-jre -y
sudo apt install python3.7 python3.7-dev python3.7-venv python3-pip build-essential \
libssl-dev libffi-dev git unzip default-jre -y
.. _install-ubuntu-xenial:
~~~~~~~~~~~~~~~~~~~~~~~~~
Ubuntu 16.04 Xenial Xerus
~~~~~~~~~~~~~~~~~~~~~~~~~
We recommend adding the ``deadsnakes`` apt repository to install Python 3.6.2 or greater:
We recommend adding the ``deadsnakes`` apt repository to install Python 3.7 or greater:
.. code-block:: none
@@ -120,9 +126,43 @@ Now, install python, pip, git and java with the following commands:
.. code-block:: none
sudo apt install python3.6-dev build-essential libssl-dev libffi-dev git unzip default-jre wget -y
sudo apt install python3.7 python3.7-dev build-essential libssl-dev libffi-dev git \
unzip default-jre wget -y
wget https://bootstrap.pypa.io/get-pip.py
sudo python3.6 get-pip.py
sudo python3.7 get-pip.py
.. _install-python-pyenv:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Installing Python with pyenv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On distributions where Python 3.7 needs to be compiled from source, we recommend the use of pyenv.
This simplifies the compilation process and has the added bonus of simplifying setting up Red in a
virtual environment.
.. code-block:: none
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
After this command, you may see a warning about 'pyenv' not being in the load path. Follow the
instructions given to fix that, then close and reopen your shell.
Then run the following command:
.. code-block:: none
CONFIGURE_OPTS=--enable-optimizations pyenv install 3.7.2 -v
This may take a long time to complete.
After that is finished, run:
.. code-block:: none
pyenv global 3.7.2
Pyenv is now installed and your system should be configured to run Python 3.7.
------------------------------
Creating a Virtual Environment
@@ -142,25 +182,25 @@ Choose one of the following commands to install Red.
.. note::
If you're not inside an activated virtual environment, include the ``--user`` flag with all
``pip3`` commands.
``python3.7 -m pip`` commands.
To install without audio support:
.. code-block:: none
pip3 install -U Red-DiscordBot
python3.7 -m pip install -U Red-DiscordBot
Or, to install with audio support:
.. code-block:: none
pip3 install -U Red-DiscordBot[voice]
python3.7 -m pip install -U Red-DiscordBot[voice]
Or, install with audio and MongoDB support:
.. code-block:: none
pip3 install -U Red-DiscordBot[voice,mongo]
python3.7 -m pip install -U Red-DiscordBot[voice,mongo]
.. note::