From aa82f2f692ec1ae7f0a5a88323d2a5c7adaca375 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 14 Feb 2026 16:31:05 +0100 Subject: [PATCH] Add Python3.14 support, Increase minimum to Python3.12 --- CHANGELOG.md | 3 ++- evennia/VERSION_REQS.txt | 4 +-- evennia/commands/default/building.py | 37 ++++++++++++++-------------- pyproject.toml | 10 ++++---- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53ddf0767f..527819e853 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,9 @@ ## Main branch +- Dependency updates: Python 3.12, 3.13, 3.14 (dropping support for Python 3.11) - Security dependency updates: Django >5.2.8 (<5.3), Django RestFramework 3.16 -- [Feat][pull3599]: Make at_pre_cmd +- [Feat][pull3599]: Make `at_pre_cmd` testable in unit tests (blongden) - [Fix]: API /openapi/setattribute endpoints were both POST and PUT, causing schema errors; now changed to PUT only. (Griatch) - [Fix][pull3799]: Fix typo in `basic_tc.py` contrib for beginner tutorial (Tharic99) diff --git a/evennia/VERSION_REQS.txt b/evennia/VERSION_REQS.txt index c8173e2853..21844575c1 100644 --- a/evennia/VERSION_REQS.txt +++ b/evennia/VERSION_REQS.txt @@ -3,8 +3,8 @@ # when people upgrade outside regular channels). This file only supports lines of # `value = number` and only specific names supported by the handler. -PYTHON_MIN = 3.11 -PYTHON_MAX_TESTED = 3.13.100 +PYTHON_MIN = 3.12 +PYTHON_MAX_TESTED = 3.14.100 TWISTED_MIN = 24.11 DJANGO_MIN = 5.2.8 DJANGO_MAX_TESTED = 5.2.100 diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py index 0692bca1ac..041661ec87 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -5,11 +5,10 @@ Building and world design commands import re import typing +import evennia from django.conf import settings from django.core.paginator import Paginator from django.db.models import Max, Min, Q - -import evennia from evennia import InterruptCommand from evennia.commands.cmdhandler import generate_cmdset_providers, get_and_merge_cmdsets from evennia.locks.lockhandler import LockException @@ -4250,23 +4249,23 @@ class CmdSpawn(COMMAND_DEFAULT_CLASS): # treat as string eval_err = err prototype = utils.to_str(inp) - finally: - # it's possible that the input was a prototype-key, in which case - # it's okay for the LITERAL_EVAL to fail. Only if the result does not - # match the expected type do we have a problem. - if not isinstance(prototype, expect): - if eval_err: - string = ( - f"{inp}\n{eval_err}\n|RCritical Python syntax error in argument. Only" - " primitive Python structures are allowed. \nMake sure to use correct" - " Python syntax. Remember especially to put quotes around all strings" - " inside lists and dicts.|n For more advanced uses, embed funcparser" - " callables ($funcs) in the strings." - ) - else: - string = f"Expected {expect}, got {type(prototype)}." - self.msg(string) - return + + # validation - it's possible that the input was a prototype-key, in which case + # it's okay for the LITERAL_EVAL to fail. Only if the result does not + # match the expected type do we have a problem. + if not isinstance(prototype, expect): + if eval_err: + string = ( + f"{inp}\n{eval_err}\n|RCritical Python syntax error in argument. Only" + " primitive Python structures are allowed. \nMake sure to use correct" + " Python syntax. Remember especially to put quotes around all strings" + " inside lists and dicts.|n For more advanced uses, embed funcparser" + " callables ($funcs) in the strings." + ) + else: + string = f"Expected {expect}, got {type(prototype)}." + self.msg(string) + return if expect == dict: # an actual prototype. We need to make sure it's safe, diff --git a/pyproject.toml b/pyproject.toml index 3b8e5d2748..77ce607e30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "evennia" version = "5.0.1" maintainers = [{ name = "Griatch", email = "griatch@gmail.com" }] description = "A full-featured toolkit and server for text-based multiplayer games (MUDs, MU*, etc)." -requires-python = ">=3.11" +requires-python = ">=3.12" readme = { file = "README.md", content-type = "text/markdown" } license = { text = "BSD" } keywords = [ @@ -38,9 +38,9 @@ keywords = [ ] classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: JavaScript", "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: BSD License", @@ -70,12 +70,12 @@ dependencies = [ "pytz >= 2022.6", "djangorestframework >= 3.16, < 3.17", "pyyaml >= 6.0", - "django-filter == 2.4", + "django-filter == 25.2", "django-sekizai == 2.0.0", "inflect >= 5.2.0", "autobahn >= 20.7.1, < 21.0.0", "lunr == 0.7.0.post1", - "simpleeval <= 1.0", + "simpleeval == 1.0.3", "uritemplate == 4.1.1", "tzdata >= 2022.6", "inflection == 0.5.1", @@ -113,7 +113,7 @@ extra = [ "django-extensions >= 3.1.0", # xyzroom contrib - "scipy == 1.15.1", + "scipy == 1.17.0", # Git contrib "gitpython >= 3.1.27",