From 523a5d4cf58eaeae04c2b6ac19a66aaa20d6bef0 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 27 Jan 2023 15:16:03 -0800 Subject: [PATCH] Add support for Python 3.11 (#11407) * Add Python 3.11 to CI * 3.11 in the install scripts * ${{ format('{0}.0-alpha - {0}.X', matrix.python) }} * bump chiavdf and chiabip158 for releases with 3.11 wheels * also bump blspy and clvm-tools-rs * drop the extra .X for the python setup version * chia_rs==0.1.13 * Update install.sh * pyinstaller==5.5 * less mutable defaults * memory_profiler * assert sqlite3.threadsafety >= 1 * create tasks for stopping services (cherry picked from commit 3384714f2e3e0bdc8c3d3741027e9e4fb69a6002) * psutil==5.9.4 * drop memory_profiler transitive dep since it now supports 3.11 * drop redundant pre-release python getting incantation * watchdog==2.2.0 * black for py311 --- .github/workflows/check_wheel_availability.yaml | 2 +- .github/workflows/test-single.yml | 8 ++++++++ Install.ps1 | 2 +- install.sh | 6 +++--- pyproject.toml | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check_wheel_availability.yaml b/.github/workflows/check_wheel_availability.yaml index dbe8d4dbb377..3466caf81386 100644 --- a/.github/workflows/check_wheel_availability.yaml +++ b/.github/workflows/check_wheel_availability.yaml @@ -44,7 +44,7 @@ jobs: matrix: arm - name: Intel matrix: intel - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] exclude: - os: matrix: macos diff --git a/.github/workflows/test-single.yml b/.github/workflows/test-single.yml index 15af4174b528..de32e0713606 100644 --- a/.github/workflows/test-single.yml +++ b/.github/workflows/test-single.yml @@ -85,6 +85,14 @@ jobs: matrix: '3.10' exclude_from: limited: True + - name: '3.11' + file_name: '3.11' + action: '3.11' + apt: '3.11' + install_sh: '3.11' + matrix: '3.11' + exclude_from: + limited: True exclude: - os: matrix: macos diff --git a/Install.ps1 b/Install.ps1 index 20ee61348e71..5fec4e91ae6b 100644 --- a/Install.ps1 +++ b/Install.ps1 @@ -45,7 +45,7 @@ if ($null -eq (Get-Command py -ErrorAction SilentlyContinue)) Exit 1 } -$supportedPythonVersions = "3.10", "3.9", "3.8", "3.7" +$supportedPythonVersions = "3.11", "3.10", "3.9", "3.8", "3.7" if ("$env:INSTALL_PYTHON_VERSION" -ne "") { $pythonVersion = $env:INSTALL_PYTHON_VERSION diff --git a/install.sh b/install.sh index 9e2a6f129c44..2276a59f303b 100755 --- a/install.sh +++ b/install.sh @@ -146,7 +146,7 @@ OPENSSL_VERSION_INT= find_python() { set +e unset BEST_VERSION - for V in 310 3.10 39 3.9 38 3.8 37 3.7 3; do + for V in 311 3.11 310 3.10 39 3.9 38 3.8 37 3.7 3; do if command -v python$V >/dev/null; then if [ "$BEST_VERSION" = "" ]; then BEST_VERSION=$V @@ -284,8 +284,8 @@ if ! command -v "$INSTALL_PYTHON_PATH" >/dev/null; then exit 1 fi -if [ "$PYTHON_MAJOR_VER" -ne "3" ] || [ "$PYTHON_MINOR_VER" -lt "7" ] || [ "$PYTHON_MINOR_VER" -ge "11" ]; then - echo "Chia requires Python version >= 3.7 and < 3.11.0" >&2 +if [ "$PYTHON_MAJOR_VER" -ne "3" ] || [ "$PYTHON_MINOR_VER" -lt "7" ] || [ "$PYTHON_MINOR_VER" -ge "12" ]; then + echo "Chia requires Python version >= 3.7 and < 3.12.0" >&2 echo "Current Python version = $INSTALL_PYTHON_VERSION" >&2 # If Arch, direct to Arch Wiki if type pacman >/dev/null 2>&1 && [ -f "/etc/arch-release" ]; then diff --git a/pyproject.toml b/pyproject.toml index 07d50604111e..92a8988d0b4d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ local_scheme = "no-local-version" [tool.black] line-length = 120 -target-version = ['py37', 'py38', 'py39', 'py310'] +target-version = ['py37', 'py38', 'py39', 'py310', 'py311'] include = ''' ^/( [^/]*.py