diff --git a/docs/deploy.py b/docs/deploy.py index 7514d3a7a..22123d2e1 100644 --- a/docs/deploy.py +++ b/docs/deploy.py @@ -44,8 +44,20 @@ def deploy(): os.system("git fetch") os.system("git checkout gh-pages") + proc = subprocess.Popen( + ["git", "checkout gh-pages"], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + stdin=subprocess.PIPE, + shell=True, + ) + if proc.returncode: + print("Could not checkout gh-pages branch.") + sys.exit(1) + else: + print("Checked out gh-pages branch.") + os.system("pwd") - os.system("ls") names_to_skip = legacy_versions + ["build"] diff --git a/docs/source/Coding/Changelog.md b/docs/source/Coding/Changelog.md index 0ddffe466..830a97766 100644 --- a/docs/source/Coding/Changelog.md +++ b/docs/source/Coding/Changelog.md @@ -2,11 +2,55 @@ ## Main branch +- Security dependency updates: Django >5.2.8 (<5.3), Django RestFramework 3.16 +- [Feat][pull3599]: Make at_pre_cmd +- [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) +- [Fix][pull3806]: EvMore wouldn't pass Session to next cmd when exiting (gas-public-wooden-clean) +- [Fix][pull3809]: Admin page - Repair link to Account button (UserlandAlchemist) +- [Fix][pull3811]: Website login banner shows before login attempt (UserlandAlchemist) +- [Fix][pull3817]: `ingame_reports` i18n fix (peddn) +- [Fix][pull3818]: Update spawn hook to use `new_prototype` (InspectorCaracal) +- [Fix][pull3815]: Performance improvement in large cmdset mergers (blongden) +- [Fix][pull3831]: Performance optimization in ANSIString, performance boost for large colored + strings (count-infinity) +- [Fix][pull3832]: Fix typo in prototype causing homogenized locks to use + fallbacks incorrectly (count-infinity) +- [Fix][pull3834]: Fix so `$obj(#123)` inline function works in prototype spawning (count-infinity) +- [Fix][pull3836]: Correctly handling calling `create_object` with `key=None` (count-infinity) +- [Fix][pull3852]: Django 5.2+ was not properly detected. Fixing distutils being + removed in py3.12 for new installs (count-infinity) +- [Fix][pull3845]: Fix exponential ANSI markup explosions when slicing + ANSIString after reset (speeds up EvForm other string ops, fixes compatibility) (count-infinity) +- [Fix][pull3853]: Properly handle multimatch separations with native dashes, like + 't-shirt-1' (count-infinity) +- [Doc][pull3801]: Move Evennia doc build system to latest Sphinx/myST + (PowershellNinja, also honorary mention to electroglyph) - [Doc][pull3800]: Describe support for Telnet SSH in HAProxy documentation (holl0wstar) +- [Doc][pull3825]: Update Portuguese translation (marado) +- [Doc][pull3826]: Fix broken links in README (marado) +- Docs: marado, Griatch, Hasna878, count-infinity -[pull3799]: https://github.com/evennia/evennia/issues/3799 -[pull3800]: https://github.com/evennia/evennia/issues/3800 +[pull3799]: https://github.com/evennia/evennia/pull/3799 +[pull3800]: https://github.com/evennia/evennia/pull/3800 +[pull3801]: https://github.com/evennia/evennia/pull/3801 +[pull3806]: https://github.com/evennia/evennia/pull/3806 +[pull3809]: https://github.com/evennia/evennia/pull/3809 +[pull3811]: https://github.com/evennia/evennia/pull/3811 +[pull3815]: https://github.com/evennia/evennia/pull/3815 +[pull3817]: https://github.com/evennia/evennia/pull/3817 +[pull3818]: https://github.com/evennia/evennia/pull/3818 +[pull3825]: https://github.com/evennia/evennia/pull/3825 +[pull3826]: https://github.com/evennia/evennia/pull/3826 +[pull3831]: https://github.com/evennia/evennia/pull/3831 +[pull3832]: https://github.com/evennia/evennia/pull/3832 +[pull3834]: https://github.com/evennia/evennia/pull/3834 +[pull3836]: https://github.com/evennia/evennia/pull/3836 +[pull3599]: https://github.com/evennia/evennia/pull/3599 +[pull3852]: https://github.com/evennia/evennia/pull/3852 +[pull3853]: https://github.com/evennia/evennia/pull/3853 +[pull3854]: https://github.com/evennia/evennia/pull/3853 ## Evennia 5.0.1 @@ -31,10 +75,10 @@ This upgrade requires running `evennia migrate` on your existing database - Feat (backwards incompatible): RUN MIGRATIONS (`evennia migrate`): Now requiring Django 5.1 (Griatch) - Feat (backwards incompatible): Drop support and testing for Python 3.10 (Griatch) -- [Feat][pull3719]: Support Python 3.13. (0xDEADFED5) +- [Feat][pull3719]: Support Python 3.13. (electroglyph) - [Feat][pull3633]: Default object's default descs are now taken from a `default_description` class variable instead of the `desc` Attribute always being set (count-infinity) -- [Feat][pull3718]: Remove twistd.bat creation for Windows, should not be needed anymore (0xDEADFED5) +- [Feat][pull3718]: Remove twistd.bat creation for Windows, should not be needed anymore (electroglyph) - [Feat][pull3756]: Updated German translation (JohnFi) - [Feat][pull3757]: Add more i18n strings to `DefaultObject` for easier translation (JohnFi) - [Feat][pull3783]: Support users of `ruff` linter by adding compatible config in `pyproject.toml` (jaborsh) @@ -50,8 +94,8 @@ This upgrade requires running `evennia migrate` on your existing database - [Fix][pull3690]: In searches, allow special 'here' and 'me' keywords only be valid queries unless current location and/or caller is in valid search candidates respectively (InspectorCaracal) - [Fix][pull3694]: Funcparser swallowing rest of line after a `\`-escape (count-infinity) -- [Fix][pull3705]: Properly serialize `IntFlag` enum types (0xDEADFED5) -- [Fix][pull3707]: Correct links in `about` command (0xDEADFED5) +- [Fix][pull3705]: Properly serialize `IntFlag` enum types (electroglyph) +- [Fix][pull3707]: Correct links in `about` command (electroglyph) - [Fix][pull3710]: Clean reduntant session clearin in `at_server_cold_start` (InspectorCaracal) - [Fix][pull3711]: Usability improvements in the Discord integration (InspectorCaracal) - [Fix][pull3721]: Avoid loading cmdsets that don't need to be checked, avoiding @@ -67,7 +111,7 @@ This upgrade requires running `evennia migrate` on your existing database - [Fix][pull3743]: Log full stack trace on failed object creation (aMiss-aWry) - [Fix][pull3747]: TutorialWorld bridge-room didn't correctly randomize weather effects (SpyrosRoum) - [Fix][pull3765]: Storing TickerHandler `store_key` in a db attribute would not - work correctly (0xDEADFED5) + work correctly (electroglyph) - [Fix][pull3753]: Make sure `AttributeProperty`s are initialized with default values also in parent class (JohnFi) - [Fix][pull3751]: The `access` and `inventory` commands would traceback if run on a character without an Account (EliasWatson) - [Fix][pull3768]: Make sure the `CmdCopy` command copies object categories, @@ -82,7 +126,7 @@ This upgrade requires running `evennia migrate` on your existing database it caused an OnDemandHandler save error on reload. Will now clean up on save. (Griatch) used as the task's category (Griatch) - Fix: Correct aws contrib's use of legacy django string utils (Griatch) -- [Docs]: Fixes from InspectorCaracal, Griatch, ChrisLR, JohnFi, 0xDEADFED5, jaborsh, Problematic, BlaneWins +- [Docs]: Fixes from InspectorCaracal, Griatch, ChrisLR, JohnFi, electroglyph, jaborsh, Problematic, BlaneWins [pull3633]: https://github.com/evennia/evennia/pull/3633 [pull3677]: https://github.com/evennia/evennia/pull/3677 @@ -204,7 +248,7 @@ Sep 29, 2024 - Feat: Support `scripts key:typeclass` to create global scripts with dynamic keys (rather than just relying on typeclass' key) (Griatch) -- [Feat][pull3595]: Tweak Sqlite3 PRAGMAs for better performance (0xDEADFED5) +- [Feat][pull3595]: Tweak Sqlite3 PRAGMAs for better performance (electroglyph) - Feat: Make Sqlite3 PRAGMAs configurable via settings (Griatch) - [Feat][pull3592]: Revised German locationlization ('Du' instead of 'Sie', cleanup) (Drakon72) @@ -213,7 +257,7 @@ with dynamic keys (rather than just relying on typeclass' key) (Griatch) - [Feat][pull3588]: New `DefaultObject` hooks: `at_object_post_creation`, called once after first creation but after any prototypes have been applied, and `at_object_post_spawn(prototype)`, called only after creation/update with a prototype (InspectorCaracal) -- [Fix][pull3594]: Update/clean some Evennia dependencies (0xDEADFED5) +- [Fix][pull3594]: Update/clean some Evennia dependencies (electroglyph) - [Fix][issue3556]: Better error if trying to treat ObjectDB as a typeclass (Griatch) - [Fix][issue3590]: Make `examine` command properly show `strattr` type Attribute values (Griatch) @@ -227,7 +271,7 @@ did not add it to the handler's object (Griatch) - [Fix][pull3605]: Correctly pass node kwargs through `@list_node` decorated evmenu nodes (InspectorCaracal) - [Fix][pull3597]: Address timing issue for testing `new_task_waiting_input `on - Windows (0xDEADFED5) + Windows (electroglyph) - [Fix][pull3611]: Fix and update for Reports contrib (InspectorCaracal) - [Fix][pull3625]: Lycanthropy tutorial page had some issues (feyrkh) - [Fix][pull3622]: Fix for examine command tracebacking with strvalue error @@ -273,10 +317,10 @@ Aug 11, 2024 - [Feat][pull3531]: New contrib; `in-game reports` for handling user reports, bugs etc in-game (InspectorCaracal) - [Feat][pull3586]: Add ANSI color support `|U`, `|I`, `|i`, `|s`, `|S` for -underline reset, italic/reset and strikethrough/reset (0xDEADFED5) +underline reset, italic/reset and strikethrough/reset (electroglyph) - Feat: Add `Trait.traithandler` back-reference so custom Traits from the Traits contrib can find and reference other Traits. (Griatch) -- [Feat][pull3582]: Add true-color parsing/fallback for ANSIString (0xDEADFED5) +- [Feat][pull3582]: Add true-color parsing/fallback for ANSIString (electroglyph) - [Fix][pull3571]: Better visual display of partial multimatch search results (InspectorCaracal) - [Fix][issue3378]: Prototype 'alias' key was not properly homogenized to a list @@ -286,8 +330,8 @@ underline reset, italic/reset and strikethrough/reset (0xDEADFED5) - [Fix][pull3585]: `TagCmd.switch_options` was misnamed (erratic-pattern) - [Fix][pull3580]: Fix typo that made `find/loc` show the wrong dbref in result (erratic-pattern) - [Fix][pull3589]: Fix regex escaping in `utils.py` for future Python versions (hhsiao) -- [Docs]: Add True-color description for Colors documentation (0xDEADFED5) -- [Docs]: Doc fixes (Griatch, InspectorCaracal, 0xDEADFED5) +- [Docs]: Add True-color description for Colors documentation (electroglyph) +- [Docs]: Doc fixes (Griatch, InspectorCaracal, electroglyph) [pull3585]: https://github.com/evennia/evennia/pull/3585 [pull3580]: https://github.com/evennia/evennia/pull/3580 diff --git a/docs/source/Setup/Installation.md b/docs/source/Setup/Installation.md index 2bb702cdb..080d548c5 100644 --- a/docs/source/Setup/Installation.md +++ b/docs/source/Setup/Installation.md @@ -1,9 +1,5 @@ # Installation -```{important} -If you are converting an existing game from a previous Evennia version, you will need to upgrade. -``` - The fastest way to install Evennia is to use the `pip` installer that comes with Python (read on). You can also [clone Evennia from github](./Installation-Git.md) or use [docker](./Installation-Docker.md). Some users have also experimented with [installing Evennia on Android](./Installation-Android.md). If you are converting an existing game, please follow the [upgrade instructions](./Installation-Upgrade.md). diff --git a/docs/source/Setup/Settings-Default.md b/docs/source/Setup/Settings-Default.md index f7f0dc29c..353ebcccd 100644 --- a/docs/source/Setup/Settings-Default.md +++ b/docs/source/Setup/Settings-Default.md @@ -376,16 +376,16 @@ WEBCLIENT_OPTIONS = { # The command parser module to use. See the default module for which # functions it must implement COMMAND_PARSER = "evennia.commands.cmdparser.cmdparser" -# On a multi-match when search objects or commands, the user has the +# On a multi-match when searching objects or commands, the user has the # ability to search again with an index marker that differentiates -# the results. If multiple "box" objects -# are found, they can by default be separated as 1-box, 2-box. Below you -# can change the regular expression used. The regex must have one -# have two capturing groups (?P...) and (?P...) - the default -# parser expects this. It should also involve a number starting from 1. -# When changing this you must also update SEARCH_MULTIMATCH_TEMPLATE +# the results. If multiple "box" objects are found, they can by default +# be separated as box-1, box-2. Below you can change the regular expression +# used. The regex must have two capturing groups (?P...) and +# (?P...) - the default parser expects this. It may also have an +# optional (?P...) group. It should also involve a number starting +# from 1. When changing this you must also update SEARCH_MULTIMATCH_TEMPLATE # to properly describe the syntax. -SEARCH_MULTIMATCH_REGEX = r"(?P[^-]*)-(?P[0-9]+)(?P.*)" +SEARCH_MULTIMATCH_REGEX = r"^(?P.*?)-(?P[0-9]+)(?P(?:\s.*)?)$" # To display multimatch errors in various listings we must display # the syntax in a way that matches what SEARCH_MULTIMATCH_REGEX understand. # The template will be populated with data and expects the following markup: diff --git a/docs/source/index.md b/docs/source/index.md index 79c723e1b..66c14767a 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -1,6 +1,6 @@ # Evennia Documentation -This is the manual of [Evennia](https://www.evennia.com), the open source Python `MU*` creation system. Use the Search bar on the left to find or discover interesting articles. This manual was last updated October 26, 2024, see the [Evennia Changelog](Coding/Changelog.md). Latest released Evennia version is 5.0.1. +This is the manual of [Evennia](https://www.evennia.com), the open source Python `MU*` creation system. Use the Search bar on the left to find or discover interesting articles. This manual was last updated January 12, 2026, see the [Evennia Changelog](Coding/Changelog.md). Latest released Evennia version is 5.0.1. - [Introduction](./Evennia-Introduction.md) - what is this Evennia thing? - [Evennia in Pictures](./Evennia-In-Pictures.md) - a visual overview of Evennia diff --git a/evennia/VERSION_REQS.txt b/evennia/VERSION_REQS.txt index c8173e285..39c4c19ae 100644 --- a/evennia/VERSION_REQS.txt +++ b/evennia/VERSION_REQS.txt @@ -4,7 +4,7 @@ # `value = number` and only specific names supported by the handler. PYTHON_MIN = 3.11 -PYTHON_MAX_TESTED = 3.13.100 +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 40f1b6037..88138eb9c 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -4241,23 +4241,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 + + # 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/evennia/commands/default/tests.py b/evennia/commands/default/tests.py index 8ab5fa50b..1ec589470 100644 --- a/evennia/commands/default/tests.py +++ b/evennia/commands/default/tests.py @@ -2264,6 +2264,7 @@ class TestSystemCommands(BaseEvenniaCommandTest): self.call(multimatch, "look", "") + class TestPreCmdOutputTestable(BaseEvenniaCommandTest): def test_pre_cmd(self): class CmdTest(Command): @@ -2275,4 +2276,4 @@ class TestPreCmdOutputTestable(BaseEvenniaCommandTest): self.msg("This should never be executed") return - self.call(CmdTest(), "test", "This should be testable") \ No newline at end of file + self.call(CmdTest(), "test", "This should be testable") diff --git a/evennia/contrib/base_systems/ingame_reports/menu.py b/evennia/contrib/base_systems/ingame_reports/menu.py index fb25e55bb..da661a438 100644 --- a/evennia/contrib/base_systems/ingame_reports/menu.py +++ b/evennia/contrib/base_systems/ingame_reports/menu.py @@ -45,10 +45,7 @@ def menunode_list_reports(caller, raw_string, **kwargs): new_report_list = report_list.filter(db_tags__db_key=kwargs["status"]) # we don't filter reports if there are no reports under that filter if not new_report_list: - text = _( - "(No {status} reports)\n" - "{text}" - ).format(status=status, text=text) + text = _("(No {status} reports)\n" "{text}").format(status=status, text=text) else: report_list = new_report_list text = _("Managing {status} {hub_name}").format(status=status, hub_name=hub_name) @@ -85,10 +82,12 @@ def menunode_list_reports(caller, raw_string, **kwargs): options.append( { "key": ( - _("|uP|nrevious {_REPORTS_PER_PAGE}").format(_REPORTS_PER_PAGE, _REPORTS_PER_PAGE), + _("|uP|nrevious {_REPORTS_PER_PAGE}").format( + _REPORTS_PER_PAGE, _REPORTS_PER_PAGE + ), _("previous"), _("prev"), - _("p") + _("p"), ), "goto": ( "menunode_list_reports", @@ -102,7 +101,7 @@ def menunode_list_reports(caller, raw_string, **kwargs): "key": ( _("|uN|next {_REPORTS_PER_PAGE}").format(_REPORTS_PER_PAGE=_REPORTS_PER_PAGE), _("next"), - _("n") + _("n"), ), "goto": ( "menunode_list_reports", @@ -151,16 +150,12 @@ def menunode_manage_report(caller, raw_string, report, **kwargs): else: about_clause = "" - text = _( - "{message}\n" - "{timestamp} by {senders}{about_clause}\n" - "{tags}" - ).format( + text = _("{message}\n" "{timestamp} by {senders}{about_clause}\n" "{tags}").format( message=message, timestamp=timestamp, senders=senders_str, about_clause=about_clause, - tags=tags_str + tags=tags_str, ) options = [] diff --git a/evennia/prototypes/tests.py b/evennia/prototypes/tests.py index ca46ad9d8..4fe0c7d59 100644 --- a/evennia/prototypes/tests.py +++ b/evennia/prototypes/tests.py @@ -1119,6 +1119,7 @@ class TestIssue3824(BaseEvenniaTest): self.assertIn(self.room1, objlist) self.assertIn(self.room2, objlist) + class TestIssue3101(EvenniaCommandTest): """ Spawning and using create_object should store the same `typeclass_path` if using diff --git a/evennia/server/portal/telnet.py b/evennia/server/portal/telnet.py index e561953f1..3c6830a67 100644 --- a/evennia/server/portal/telnet.py +++ b/evennia/server/portal/telnet.py @@ -45,7 +45,7 @@ _IDLE_COMMAND = str.encode(settings.IDLE_COMMAND + "\n") # identify HTTP indata _HTTP_REGEX = re.compile( - b"(GET|HEAD|POST|PUT|DELETE|TRACE|OPTIONS|CONNECT|PATCH) (.*? HTTP/[0-9]\.[0-9])", re.I + b"(GET|HEAD|POST|PUT|DELETE|TRACE|OPTIONS|CONNECT|PATCH) (.*? HTTP/[0-9]\\.[0-9])", re.I ) _HTTP_WARNING = bytes( diff --git a/evennia/utils/tests/test_batchprocessors.py b/evennia/utils/tests/test_batchprocessors.py index 9bb0812e0..e477c79ac 100644 --- a/evennia/utils/tests/test_batchprocessors.py +++ b/evennia/utils/tests/test_batchprocessors.py @@ -93,6 +93,7 @@ class TestBatchCommandProcessor(TestCase): [mock.call("foopath", file_ending=".ev"), mock.call("x", file_ending=".ev")], ) + class TestReadBatchFile(TestCase): """Test read_batchfile line ending normalization.""" diff --git a/pyproject.toml b/pyproject.toml index 3b8e5d274..fe4eee8c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,7 @@ classifiers = [ "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 +71,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",