From 73701292b599c658b5d2f728230cd20743759181 Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Mon, 2 Sep 2024 10:08:16 +0200 Subject: [PATCH] Core, CI: Add Python 3.12 support (#3290) * Core, CI: add py3.12 compat * Stardew Valley: Fix tests for Py3.12 * ModuleUpdate: always install pkg_resources * Docs: update supported python versions * WebHost: update pony to upstream 0.7.18 * CI: test hosting update to py3.12 * Update docs/running from source.md --- .github/workflows/unittests.yml | 7 ++++--- ModuleUpdate.py | 6 +++--- WebHostLib/requirements.txt | 2 +- docs/running from source.md | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 3ad29b007772..9a3a6d11217f 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -37,12 +37,13 @@ jobs: - {version: '3.9'} - {version: '3.10'} - {version: '3.11'} + - {version: '3.12'} include: - python: {version: '3.8'} # win7 compat os: windows-latest - - python: {version: '3.11'} # current + - python: {version: '3.12'} # current os: windows-latest - - python: {version: '3.11'} # current + - python: {version: '3.12'} # current os: macos-latest steps: @@ -70,7 +71,7 @@ jobs: os: - ubuntu-latest python: - - {version: '3.11'} # current + - {version: '3.12'} # current steps: - uses: actions/checkout@v4 diff --git a/ModuleUpdate.py b/ModuleUpdate.py index ed041bef4604..f49182bb7863 100644 --- a/ModuleUpdate.py +++ b/ModuleUpdate.py @@ -75,13 +75,13 @@ def update(yes: bool = False, force: bool = False) -> None: if not update_ran: update_ran = True + install_pkg_resources(yes=yes) + import pkg_resources + if force: update_command() return - install_pkg_resources(yes=yes) - import pkg_resources - prev = "" # if a line ends in \ we store here and merge later for req_file in requirements_files: path = os.path.join(os.path.dirname(sys.argv[0]), req_file) diff --git a/WebHostLib/requirements.txt b/WebHostLib/requirements.txt index 3452c9d416db..c61a153d24e0 100644 --- a/WebHostLib/requirements.txt +++ b/WebHostLib/requirements.txt @@ -1,6 +1,6 @@ flask>=3.0.3 werkzeug>=3.0.3 -pony>=0.7.17 +pony>=0.7.18 waitress>=3.0.0 Flask-Caching>=2.3.0 Flask-Compress>=1.15 diff --git a/docs/running from source.md b/docs/running from source.md index 34083a603d1b..4bd335648d66 100644 --- a/docs/running from source.md +++ b/docs/running from source.md @@ -8,7 +8,7 @@ use that version. These steps are for developers or platforms without compiled r What you'll need: * [Python 3.8.7 or newer](https://www.python.org/downloads/), not the Windows Store version - * **Python 3.12 is currently unsupported** + * Python 3.12.x is currently the newest supported version * pip: included in downloads from python.org, separate in many Linux distributions * Matching C compiler * possibly optional, read operating system specific sections @@ -31,7 +31,7 @@ After this, you should be able to run the programs. Recommended steps * Download and install a "Windows installer (64-bit)" from the [Python download page](https://www.python.org/downloads) - * **Python 3.12 is currently unsupported** + * [read above](#General) which versions are supported * **Optional**: Download and install Visual Studio Build Tools from [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/).