Make some dependency changes, support Python 3.10 and 3.11 (#5611)

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
Jakub Kuczys
2022-12-30 03:21:57 +01:00
committed by GitHub
parent d3308af0e2
commit 519acedf46
59 changed files with 324 additions and 373 deletions

View File

@@ -21,18 +21,3 @@ to keep it in a location which is easy to type out the path to. From now, we'll
``redenv`` and it will be located in your home directory.
Create your virtual environment with the following command:
.. prompt:: bash
python3.9 -m venv ~/redenv
And activate it with the following command:
.. prompt:: bash
source ~/redenv/bin/activate
.. important::
You must activate the virtual environment with the above command every time you open a new
shell to run, install or update Red.

View File

@@ -0,0 +1,10 @@
And activate it with the following command:
.. prompt:: bash
source ~/redenv/bin/activate
.. important::
You must activate the virtual environment with the above command every time you open a new
shell to run, install or update Red.

View File

@@ -0,0 +1,7 @@
.. include:: _includes/_create-env-with-venv-intro.rst
.. prompt:: bash
python3.10 -m venv ~/redenv
.. include:: _includes/_create-env-with-venv-outro.rst

View File

@@ -0,0 +1,7 @@
.. include:: _includes/_create-env-with-venv-intro.rst
.. prompt:: bash
python3.11 -m venv ~/redenv
.. include:: _includes/_create-env-with-venv-outro.rst

View File

@@ -0,0 +1,7 @@
.. include:: _includes/_create-env-with-venv-intro.rst
.. prompt:: bash
python3.9 -m venv ~/redenv
.. include:: _includes/_create-env-with-venv-outro.rst

View File

@@ -13,7 +13,7 @@ Install them with dnf:
sudo dnf -y update
sudo dnf -y group install development
sudo dnf -y install python39 python39-pip python39-devel java-11-openjdk-headless nano git
sudo dnf -y install python39 python39-devel java-11-openjdk-headless nano git
Set ``java`` executable to point to Java 11:
@@ -23,6 +23,6 @@ Set ``java`` executable to point to Java 11:
.. Include common instructions:
.. include:: _includes/create-env-with-venv.rst
.. include:: _includes/create-env-with-venv3.9.rst
.. include:: _includes/install-and-setup-red-unix.rst

View File

@@ -11,10 +11,10 @@ Install them with dnf:
.. prompt:: bash
sudo dnf -y install python39 git java-11-openjdk-headless @development nano
sudo dnf -y install python39 python3-devel git java-11-openjdk-headless @development nano
.. Include common instructions:
.. include:: _includes/create-env-with-venv.rst
.. include:: _includes/create-env-with-venv3.9.rst
.. include:: _includes/install-and-setup-red-unix.rst

View File

@@ -2,7 +2,7 @@
Installing Python with pyenv
----------------------------
On distributions where Python 3.9 needs to be compiled from source, we recommend the use of pyenv.
On distributions where Python 3.11 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.
@@ -10,7 +10,7 @@ virtual environment.
.. prompt:: bash
CONFIGURE_OPTS=--enable-optimizations pyenv install 3.9.9 -v
CONFIGURE_OPTS=--enable-optimizations pyenv install 3.11.1 -v
This may take a long time to complete, depending on your hardware. For some machines (such as
Raspberry Pis and micro-tier VPSes), it may take over an hour; in this case, you may wish to remove
@@ -22,6 +22,6 @@ After that is finished, run:
.. prompt:: bash
pyenv global 3.9.9
pyenv global 3.11.1
Pyenv is now installed and your system should be configured to run Python 3.9.
Pyenv is now installed and your system should be configured to run Python 3.11.

View File

@@ -0,0 +1,27 @@
----------------------------
Installing Python with pyenv
----------------------------
On distributions where Python 3.10 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.
.. include:: _includes/_install-pyenv-and-setup-path.rst
.. prompt:: bash
CONFIGURE_OPTS=--enable-optimizations pyenv install 3.10.9 -v
This may take a long time to complete, depending on your hardware. For some machines (such as
Raspberry Pis and micro-tier VPSes), it may take over an hour; in this case, you may wish to remove
the ``CONFIGURE_OPTS=--enable-optimizations`` part from the front of the command, which will
drastically reduce the install time. However, be aware that this will make Python run about 10%
slower.
After that is finished, run:
.. prompt:: bash
pyenv global 3.10.9
Pyenv is now installed and your system should be configured to run Python 3.10.

View File

@@ -2,7 +2,7 @@
Installing Python with pyenv
----------------------------
On distributions where Python 3.8 needs to be compiled from source, we recommend the use of pyenv.
On distributions where Python 3.9 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.
@@ -10,7 +10,7 @@ virtual environment.
.. prompt:: bash
CONFIGURE_OPTS=--enable-optimizations pyenv install 3.8.12 -v
CONFIGURE_OPTS=--enable-optimizations pyenv install 3.9.16 -v
This may take a long time to complete, depending on your hardware. For some machines (such as
Raspberry Pis and micro-tier VPSes), it may take over an hour; in this case, you may wish to remove
@@ -22,6 +22,6 @@ After that is finished, run:
.. prompt:: bash
pyenv global 3.8.12
pyenv global 3.9.16
Pyenv is now installed and your system should be configured to run Python 3.8.
Pyenv is now installed and your system should be configured to run Python 3.9.

View File

@@ -16,10 +16,22 @@ Install the pre-requirements with pacman:
.. prompt:: bash
sudo pacman -Syu python python-pip git jre11-openjdk-headless base-devel nano
sudo pacman -Syu git jre11-openjdk-headless base-devel nano
On Arch Linux, Python 3.9 can be installed from the Arch User Repository (AUR) from the ``python39`` package.
The manual build process is the Arch-supported install method for AUR packages. You can install ``python39`` package with the following commands:
.. prompt:: bash
git clone https://aur.archlinux.org/python39.git /tmp/python39
cd /tmp/python39
makepkg -sicL
cd -
rm -rf /tmp/python39
.. Include common instructions:
.. include:: _includes/create-env-with-venv.rst
.. include:: _includes/create-env-with-venv3.9.rst
.. include:: _includes/install-and-setup-red-unix.rst

View File

@@ -37,7 +37,9 @@ In order to install Git 2.11 or greater, we recommend adding the IUS repository:
.. Include common instructions:
.. include:: _includes/install-python-pyenv.rst
.. Python 3.10 requires OpenSSL 1.1.1 which CentOS 7 doesn't provide in base repository.
.. include:: _includes/install-python39-pyenv.rst
.. include:: _includes/create-env-with-pyenv-virtualenv.rst

View File

@@ -18,7 +18,7 @@ Debian Buster. This guide will tell you how. First, run the following commands:
.. prompt:: bash
sudo apt update
sudo apt -y install make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev libgdbm-dev uuid-dev python3-openssl git openjdk-11-jre-headless nano
sudo apt -y install make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev libgdbm-dev uuid-dev python3-openssl git openjdk-11-jre-headless nano
CXX=/usr/bin/g++
.. Include common instructions:

View File

@@ -18,10 +18,10 @@ with apt:
.. prompt:: bash
sudo apt update
sudo apt -y install python3 python3-dev python3-venv python3-pip git openjdk-11-jre-headless build-essential nano
sudo apt -y install python3 python3-dev python3-venv git openjdk-11-jre-headless build-essential nano
.. Include common instructions:
.. include:: _includes/create-env-with-venv.rst
.. include:: _includes/create-env-with-venv3.9.rst
.. include:: _includes/install-and-setup-red-unix.rst

View File

@@ -17,10 +17,10 @@ them with dnf:
.. prompt:: bash
sudo dnf -y install python39 git java-11-openjdk-headless @development-tools nano
sudo dnf -y install python3.10 python3.10-devel git java-11-openjdk-headless @development-tools nano
.. Include common instructions:
.. include:: _includes/create-env-with-venv.rst
.. include:: _includes/create-env-with-venv3.10.rst
.. include:: _includes/install-and-setup-red-unix.rst

View File

@@ -23,7 +23,7 @@ one-by-one:
.. prompt:: bash
brew install python@3.9
brew install python@3.11
brew install git
brew tap homebrew/cask-versions
brew install --cask temurin11
@@ -34,11 +34,11 @@ To fix this, you should run these commands:
.. prompt:: bash
profile=$([ -n "$ZSH_VERSION" ] && echo ~/.zprofile || ([ -f ~/.bash_profile ] && echo ~/.bash_profile || echo ~/.profile))
echo 'export PATH="$(brew --prefix)/opt/python@3.9/bin:$PATH"' >> "$profile"
echo 'export PATH="$(brew --prefix)/opt/python@3.11/bin:$PATH"' >> "$profile"
source "$profile"
.. Include common instructions:
.. include:: _includes/create-env-with-venv.rst
.. include:: _includes/create-env-with-venv3.11.rst
.. include:: _includes/install-and-setup-red-unix.rst

View File

@@ -1,7 +1,7 @@
.. _install-opensuse-leap-15:
=====================================
Installing Red on openSUSE Leap 15.3+
Installing Red on openSUSE Leap 15.4+
=====================================
.. include:: _includes/supported-arch-x64+aarch64.rst
@@ -12,16 +12,16 @@ Installing Red on openSUSE Leap 15.3+
Installing the pre-requirements
-------------------------------
openSUSE Leap 15.3+ has all required dependencies available in official repositories. Install them
openSUSE Leap 15.4+ has all required dependencies available in official repositories. Install them
with zypper:
.. prompt:: bash
sudo zypper -n install python39-base python39-pip git-core java-11-openjdk-headless nano
sudo zypper -n install python310 python310-devel git-core java-11-openjdk-headless nano
sudo zypper -n install -t pattern devel_basis
.. Include common instructions:
.. include:: _includes/create-env-with-venv.rst
.. include:: _includes/create-env-with-venv3.10.rst
.. include:: _includes/install-and-setup-red-unix.rst

View File

@@ -17,11 +17,11 @@ with zypper:
.. prompt:: bash
sudo zypper -n install python39-base python39-pip git-core java-11-openjdk-headless nano
sudo zypper -n install python311 python311-devel git-core java-11-openjdk-headless nano
sudo zypper -n install -t pattern devel_basis
.. Include common instructions:
.. include:: _includes/create-env-with-venv.rst
.. include:: _includes/create-env-with-venv3.11.rst
.. include:: _includes/install-and-setup-red-unix.rst

View File

@@ -35,15 +35,20 @@ Installing the pre-requirements
We recommend installing pyenv as a method of installing non-native versions of Python on
Raspberry Pi OS. This guide will tell you how. First, run the following commands:
.. cmake is necessary to be able to successfuly build rapidfuzz.
.. prompt:: bash
sudo apt update
sudo apt -y install make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev libgdbm-dev uuid-dev python3-openssl git openjdk-11-jre-headless nano
sudo apt -y install cmake make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev libgdbm-dev uuid-dev python3-openssl git openjdk-11-jre-headless nano
CXX=/usr/bin/g++
.. Include common instructions:
.. include:: _includes/install-python38-pyenv.rst
.. We should only build and install even versions of Python on Raspberry Pi OS as odd
.. versions are part of piwheels and can cause installs of pip packages that won't work.
.. include:: _includes/install-python310-pyenv.rst
.. include:: _includes/create-env-with-pyenv-virtualenv.rst

View File

@@ -33,10 +33,10 @@ with apt:
.. prompt:: bash
sudo apt update
sudo apt -y install python3 python3-dev python3-venv python3-pip git openjdk-11-jre-headless build-essential nano
sudo apt -y install python3 python3-dev python3-venv git openjdk-11-jre-headless build-essential nano
.. Include common instructions:
.. include:: _includes/create-env-with-venv.rst
.. include:: _includes/create-env-with-venv3.9.rst
.. include:: _includes/install-and-setup-red-unix.rst

View File

@@ -12,6 +12,10 @@ Installing Red on Ubuntu 18.04 LTS
Installing the pre-requirements
-------------------------------
.. Git 2.17.0-2.22.0 have an issue with partial clone which is used in pip for git installs.
.. Not incredibly important perhaps but this ppa is recommended by git-scm.com/download/linux
.. so it should be fine.
We recommend adding the ``git-core`` ppa to install Git 2.11 or greater:
.. prompt:: bash
@@ -20,7 +24,7 @@ We recommend adding the ``git-core`` ppa to install Git 2.11 or greater:
sudo apt -y install software-properties-common
sudo add-apt-repository -y ppa:git-core/ppa
We recommend adding the ``deadsnakes`` ppa to install Python 3.9:
We recommend adding the ``deadsnakes`` ppa to install Python 3.11:
.. prompt:: bash
@@ -30,10 +34,10 @@ Now install the pre-requirements with apt:
.. prompt:: bash
sudo apt -y install python3.9 python3.9-dev python3.9-venv python3-pip git openjdk-11-jre-headless build-essential nano
sudo apt -y install python3.11 python3.11-dev python3.11-venv git openjdk-11-jre-headless build-essential nano
.. Include common instructions:
.. include:: _includes/create-env-with-venv.rst
.. include:: _includes/create-env-with-venv3.11.rst
.. include:: _includes/install-and-setup-red-unix.rst

View File

@@ -12,22 +12,16 @@ Installing Red on Ubuntu 20.04 LTS
Installing the pre-requirements
-------------------------------
We recommend adding the ``git-core`` ppa to install Git 2.11 or greater:
Ubuntu 20.04 LTS has all required packages available in official repositories. Install them
with apt:
.. prompt:: bash
sudo apt update
sudo apt -y install software-properties-common
sudo add-apt-repository -y ppa:git-core/ppa
Now install the pre-requirements with apt:
.. prompt:: bash
sudo apt -y install python3.9 python3.9-dev python3.9-venv python3-pip git openjdk-11-jre-headless build-essential nano
sudo apt -y install python3.9 python3.9-dev python3.9-venv git openjdk-11-jre-headless build-essential nano
.. Include common instructions:
.. include:: _includes/create-env-with-venv.rst
.. include:: _includes/create-env-with-venv3.9.rst
.. include:: _includes/install-and-setup-red-unix.rst

View File

@@ -12,22 +12,16 @@ Installing Red on Ubuntu 22.04 LTS
Installing the pre-requirements
-------------------------------
We recommend adding the ``deadsnakes`` ppa to install Python 3.9:
Ubuntu 22.04 LTS has all required packages available in official repositories. Install them
with apt:
.. prompt:: bash
sudo apt update
sudo apt -y install software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
Now install the pre-requirements with apt:
.. prompt:: bash
sudo apt -y install python3.9 python3.9-dev python3.9-venv python3-pip git openjdk-11-jre-headless build-essential nano
sudo apt -y install python3.10 python3.10-dev python3.10-venv git openjdk-11-jre-headless build-essential nano
.. Include common instructions:
.. include:: _includes/create-env-with-venv.rst
.. include:: _includes/create-env-with-venv3.10.rst
.. include:: _includes/install-and-setup-red-unix.rst

View File

@@ -12,26 +12,15 @@ Installing Red on Ubuntu non-LTS versions
Installing the pre-requirements
-------------------------------
We recommend adding the ``git-core`` ppa to install Git 2.11 or greater:
Now install the pre-requirements with apt:
.. prompt:: bash
sudo apt update
sudo apt -y install software-properties-common
sudo add-apt-repository -yu ppa:git-core/ppa
Now, to install non-native version of python on non-LTS versions of Ubuntu, we recommend
installing pyenv. To do this, first run the following commands:
.. prompt:: bash
sudo apt -y install make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev libgdbm-dev uuid-dev python3-openssl git openjdk-11-jre-headless nano
CXX=/usr/bin/g++
sudo apt -y install python3.11 python3.11-dev python3.11-venv git openjdk-11-jre-headless build-essential nano
.. Include common instructions:
.. include:: _includes/install-python-pyenv.rst
.. include:: _includes/create-env-with-pyenv-virtualenv.rst
.. include:: _includes/create-env-with-venv3.11.rst
.. include:: _includes/install-and-setup-red-unix.rst

View File

@@ -33,7 +33,7 @@ Then run each of the following commands:
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco upgrade git --params "/GitOnlyOnPath /WindowsTerminal" -y
choco upgrade visualstudio2022-workload-vctools -y
choco upgrade python3 -y --version 3.9.9
choco upgrade python311 -y
For Audio support, you should also run the following command before exiting:
@@ -57,7 +57,7 @@ Manually installing dependencies
* `MSVC Build tools <https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2019>`_
* `Python 3.8.1 - 3.9.x <https://www.python.org/downloads/windows/>`_
* `Python 3.8.1 - 3.11.x <https://www.python.org/downloads/windows/>`_
.. attention:: Please make sure that the box to add Python to PATH is CHECKED, otherwise
you may run into issues when trying to run Red.
@@ -104,7 +104,7 @@ Then create your virtual environment with the following command
.. prompt:: batch
py -3.9 -m venv "%userprofile%\redenv"
py -3.11 -m venv "%userprofile%\redenv"
And activate it with the following command