From 003865cf612d96f638e75f2f8f8264231eade4d2 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 3 Dec 2022 14:29:15 +0100 Subject: [PATCH 01/49] Update to release notes --- docs/source/Coding/Release-Notes-1.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/Coding/Release-Notes-1.0.md b/docs/source/Coding/Release-Notes-1.0.md index 3b3265f93e..f2451da379 100644 --- a/docs/source/Coding/Release-Notes-1.0.md +++ b/docs/source/Coding/Release-Notes-1.0.md @@ -7,6 +7,7 @@ This summarizes the changes. See the [Changelog](./Changelog.md) for the full li - Python 3.10 is now required minimum. Ubuntu LTS now installs with 3.10. Evennia 1.0 is also tested with Python 3.11 - this is the recommended version for Linux/Mac. Windows users may want to stay on Python 3.10 unless they are okay with installing a C++ compiler. - Twisted 22.10+ - Django 4.1+ +- Main development now on `main` branch. `master` branch remains, but will not be updated anymore. ## Major new features From 0c33efd54c2de390b62589688f8ad4490ccdd18f Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 3 Dec 2022 15:02:40 +0100 Subject: [PATCH 02/49] Changelog header change --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73051f6d75..ade0a481ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,10 @@ ### Evennia 1.0 -2019-2022 develop branch +2019-2022 -Changed to using `main` branch to follow github standard. Old `master` branch remains -for now but will not be used anymore, so as to not break installs during transition. +_Changed to using `main` branch to follow github standard. Old `master` branch remains +for now but will not be used anymore, so as to not break installs during transition._ Increase requirements: Django 4.1+, Twisted 22.10+ Python 3.10, 3.11. PostgreSQL 11+. From 6b82d04a8cff5fc3cdf5fd162792667371ef6442 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 3 Dec 2022 15:26:01 +0100 Subject: [PATCH 03/49] Correctly route twisted logs at startup for new game folder --- evennia/server/evennia_launcher.py | 12 ++++++++++-- evennia/server/server.py | 1 - 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/evennia/server/evennia_launcher.py b/evennia/server/evennia_launcher.py index c78b7c651d..48aa7f9321 100644 --- a/evennia/server/evennia_launcher.py +++ b/evennia/server/evennia_launcher.py @@ -538,8 +538,16 @@ def _get_twistd_cmdline(pprofiler, sprofiler): Compile the command line for starting a Twisted application using the 'twistd' executable. """ - portal_cmd = [TWISTED_BINARY, "--python={}".format(PORTAL_PY_FILE)] - server_cmd = [TWISTED_BINARY, "--python={}".format(SERVER_PY_FILE)] + portal_cmd = [ + TWISTED_BINARY, + f"--python={PORTAL_PY_FILE}", + "--logger=evennia.utils.logger.GetPortalLogObserver", + ] + server_cmd = [ + TWISTED_BINARY, + f"--python={SERVER_PY_FILE}", + "--logger=evennia.utils.logger.GetServerLogObserver", + ] if os.name != "nt": # PID files only for UNIX diff --git a/evennia/server/server.py b/evennia/server/server.py index db2548e8f9..745dfeb480 100644 --- a/evennia/server/server.py +++ b/evennia/server/server.py @@ -31,7 +31,6 @@ from django.conf import settings from django.db import connection from django.db.utils import OperationalError from django.utils.translation import gettext as _ - from evennia.accounts.models import AccountDB from evennia.scripts.models import ScriptDB from evennia.server.models import ServerConfig From d882d6ad226cb8c7a674cbb6e66a9fca7f2c1893 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 3 Dec 2022 15:33:42 +0100 Subject: [PATCH 04/49] Change to release notes on main --- docs/source/Coding/Release-Notes-1.0.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/Coding/Release-Notes-1.0.md b/docs/source/Coding/Release-Notes-1.0.md index f2451da379..2f35334f0c 100644 --- a/docs/source/Coding/Release-Notes-1.0.md +++ b/docs/source/Coding/Release-Notes-1.0.md @@ -2,12 +2,13 @@ This summarizes the changes. See the [Changelog](./Changelog.md) for the full list. +- Main development now on `main` branch. `master` branch remains, but will not be updated anymore. + ## Minimum requirements - Python 3.10 is now required minimum. Ubuntu LTS now installs with 3.10. Evennia 1.0 is also tested with Python 3.11 - this is the recommended version for Linux/Mac. Windows users may want to stay on Python 3.10 unless they are okay with installing a C++ compiler. - Twisted 22.10+ - Django 4.1+ -- Main development now on `main` branch. `master` branch remains, but will not be updated anymore. ## Major new features From 5259d4bc3db6cd6198514da9f0e3e03baac06246 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 3 Dec 2022 15:38:04 +0100 Subject: [PATCH 05/49] Make sure main branch builds docs too --- .github/workflows/github_action_build_docs.yml | 8 ++++---- docs/source/Evennia-Introduction.md | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/github_action_build_docs.yml b/.github/workflows/github_action_build_docs.yml index 1c0bc38604..8b31597007 100644 --- a/.github/workflows/github_action_build_docs.yml +++ b/.github/workflows/github_action_build_docs.yml @@ -4,12 +4,12 @@ name: documentation on: push: - branches: [ master, develop ] + branches: [ main, develop ] paths: - 'docs/**' - 'evennia/contrib/**' pull_request: - branches: [ master, develop ] + branches: [ main, develop ] paths: - 'docs/**' - 'evennia/contrib/**' @@ -48,8 +48,8 @@ jobs: cd gamedir evennia migrate - - name: Build and deploy docs (only from master/develop branch) - if: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'}} + - name: Build and deploy docs (only from main/develop branch) + if: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'}} run: | git config --global user.email "docbuilder@evennia.com" git config --global user.name "Evennia docbuilder action" diff --git a/docs/source/Evennia-Introduction.md b/docs/source/Evennia-Introduction.md index c04414c05b..3e781375b9 100644 --- a/docs/source/Evennia-Introduction.md +++ b/docs/source/Evennia-Introduction.md @@ -64,6 +64,7 @@ Start small. Evennia's [Beginner tutorial](Howtos/Beginner-Tutorial/Beginner-Tut ```{sidebar} See also our [link page](./Links.md) for some reading suggestions. ``` + While Python is considered a very easy programming language to get into, you do have a learning curve to climb if you are new to programming. The beginner-tutorial has a [basic introduction to Python](Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Python-basic-introduction.md), but if you are completely new, you should probably also sit down with a full Python beginner's tutorial at some point. There are plenty of them on the web if you look around. To code your dream game in Evennia you don't need to be a Python guru, but you do need to be able to read example code containing at least these basic Python features: From 8164b75c93e2d9490dda0a741947c0d21ebebf27 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 3 Dec 2022 16:24:21 +0100 Subject: [PATCH 06/49] Update the example file-help entries --- evennia/game_template/world/help_entries.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/evennia/game_template/world/help_entries.py b/evennia/game_template/world/help_entries.py index 58c3af442f..368ed0e999 100644 --- a/evennia/game_template/world/help_entries.py +++ b/evennia/game_template/world/help_entries.py @@ -31,25 +31,27 @@ HELP_ENTRY_DICTS = [ "category": "General", "locks": "read:perm(Developer)", "text": """ - Evennia is a MUD game server in Python. + Evennia is a MU-game server and frameworkdin Python. You can read more + on https://www.evennia.com. # subtopics ## Installation - You'll find installation instructions on https:evennia.com + You'll find installation instructions on https://www.evennia.com. ## Community There are many ways to get help and communicate with other devs! - ### IRC + ### Discussions - The irc channel is #evennia on irc.freenode.net + The Discussions forum is found at https://github.com/evennia/evennia/discussions. ### Discord - There is also a discord channel you can find from the sidebard on evennia.com. + There is also a discord channel for chatting - connect using the + following link: https://discord.gg/AJJpcRUhtF """, }, @@ -58,7 +60,7 @@ HELP_ENTRY_DICTS = [ "category": "building", "text": """ Evennia comes with a bunch of default building commands. You can - find a building tutorial in the evennia documentation. + find a beginner tutorial in the evennia documentation. """, }, From bef46e99835a345ebf76e7182226c938da10d0d5 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 3 Dec 2022 16:35:46 +0100 Subject: [PATCH 07/49] Evennia 1.0 release --- docs/source/Coding/Changelog.md | 6 +++--- docs/source/Setup/Online-Setup.md | 4 ++-- evennia/VERSION.txt | 2 +- pyproject.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/source/Coding/Changelog.md b/docs/source/Coding/Changelog.md index 73051f6d75..ade0a481ea 100644 --- a/docs/source/Coding/Changelog.md +++ b/docs/source/Coding/Changelog.md @@ -2,10 +2,10 @@ ### Evennia 1.0 -2019-2022 develop branch +2019-2022 -Changed to using `main` branch to follow github standard. Old `master` branch remains -for now but will not be used anymore, so as to not break installs during transition. +_Changed to using `main` branch to follow github standard. Old `master` branch remains +for now but will not be used anymore, so as to not break installs during transition._ Increase requirements: Django 4.1+, Twisted 22.10+ Python 3.10, 3.11. PostgreSQL 11+. diff --git a/docs/source/Setup/Online-Setup.md b/docs/source/Setup/Online-Setup.md index 3788c64314..46c563200b 100644 --- a/docs/source/Setup/Online-Setup.md +++ b/docs/source/Setup/Online-Setup.md @@ -328,7 +328,7 @@ Evennia users: | [Amazon Lightsail][9] | Cloud | $5/month | Free first month. AWS's "fixed cost" offering.| | [Azure App Services][12] | Cloud | Free | Free tier with limited regions for hobbyists. | | [Huawei Cloud][13] | Cloud | on demand | Similar to Amazon. Free 12-month tier with limited regions. | -| [Host1Plus][5] | VPS & Cloud | $4/month | $4-$8/month depending on length of sign-up period. +| [Heficed][5] | VPS & Cloud | $6/month | $6/month for a 1GB ram server. | | [Scaleway][6] | Cloud | €3/month / on-demand | EU based (Paris, Amsterdam). Smallest option provides 2GB RAM. | | [Prgmr][10] | VPS | $5/month | 1 month free with a year prepay. You likely want some experience with servers with this option as they don't have a lot of support.| | [Linode][11] | Cloud | $5/month / on-demand | Multiple regions. Smallest option provides 1GB RAM| @@ -340,7 +340,7 @@ Evennia users: [2]: https://www.digitalocean.com/pricing [3]: https://aws.amazon.com/pricing/ [4]: https://www.genesismuds.com/ -[5]: https://www.host1plus.com/ +[5]: https://www.heficed.com/ [6]: https://www.scaleway.com/ [7]: https://lowendbox.com/ [8]: https://www.lowendtalk.com diff --git a/evennia/VERSION.txt b/evennia/VERSION.txt index 15ba4a5203..d3827e75a5 100644 --- a/evennia/VERSION.txt +++ b/evennia/VERSION.txt @@ -1 +1 @@ -1.0-dev +1.0 diff --git a/pyproject.toml b/pyproject.toml index 674609f536..028e42c0ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "evennia" -version = "1.0rc11" +version = "1.0" maintainers = [ { name="Griatch", email="griatch@gmail.com" }, ] From 08e80f2739311e9f519df606e458626e014d3f3f Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 3 Dec 2022 16:58:29 +0100 Subject: [PATCH 08/49] launcher unit test fix --- evennia/server/tests/test_launcher.py | 35 +++++++++++++-------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/evennia/server/tests/test_launcher.py b/evennia/server/tests/test_launcher.py index 5ce86fcd4e..2b894a0720 100644 --- a/evennia/server/tests/test_launcher.py +++ b/evennia/server/tests/test_launcher.py @@ -7,14 +7,13 @@ import os import pickle from anything import Something +from evennia.server import evennia_launcher +from evennia.server.portal import amp from mock import MagicMock, create_autospec, patch from twisted.internet import reactor from twisted.internet.base import DelayedCall from twisted.trial.unittest import TestCase as TwistedTestCase -from evennia.server import evennia_launcher -from evennia.server.portal import amp - DelayedCall.debug = True @@ -68,27 +67,27 @@ class TestLauncher(TwistedTestCase): @patch("evennia.server.evennia_launcher.os.name", new="posix") def test_get_twisted_cmdline(self): pcmd, scmd = evennia_launcher._get_twistd_cmdline(False, False) - self.assertTrue("portal.py" in pcmd[1]) - self.assertTrue("--pidfile" in pcmd[2]) - self.assertTrue("server.py" in scmd[1]) - self.assertTrue("--pidfile" in scmd[2]) + self.assertIn("portal.py", pcmd[1]) + self.assertIn("--pidfile", pcmd[3]) + self.assertIn("server.py", scmd[1]) + self.assertIn("--pidfile", scmd[3]) pcmd, scmd = evennia_launcher._get_twistd_cmdline(True, True) - self.assertTrue("portal.py" in pcmd[1]) - self.assertTrue("--pidfile" in pcmd[2]) - self.assertTrue("--profiler=cprofile" in pcmd[4], "actual: {}".format(pcmd)) - self.assertTrue("--profile=" in pcmd[5]) - self.assertTrue("server.py" in scmd[1]) - self.assertTrue("--pidfile" in scmd[2]) - self.assertTrue("--pidfile" in scmd[2]) - self.assertTrue("--profiler=cprofile" in scmd[4], "actual: {}".format(scmd)) - self.assertTrue("--profile=" in scmd[5]) + self.assertIn("portal.py", pcmd[1]) + self.assertIn("--pidfile", pcmd[3]) + self.assertIn("--profiler=cprofile", pcmd[5], pcmd) + self.assertIn("--profile=", pcmd[6]) + self.assertIn("server.py", scmd[1]) + self.assertIn("--pidfile", scmd[3]) + self.assertIn("--pidfile", scmd[3]) + self.assertIn("--profiler=cprofile", scmd[5], "actual: {}".format(scmd)) + self.assertIn("--profile=", scmd[6]) @patch("evennia.server.evennia_launcher.os.name", new="nt") def test_get_twisted_cmdline_nt(self): pcmd, scmd = evennia_launcher._get_twistd_cmdline(False, False) - self.assertTrue(len(pcmd) == 2, "actual: {}".format(pcmd)) - self.assertTrue(len(scmd) == 2, "actual: {}".format(scmd)) + self.assertTrue(len(pcmd) == 3, pcmd) + self.assertTrue(len(scmd) == 3, scmd) @patch("evennia.server.evennia_launcher.reactor.stop") def test_reactor_stop(self, mockstop): From 250c47c84cafd3e485a156c83ce9898117b84d03 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 3 Dec 2022 18:24:44 +0100 Subject: [PATCH 09/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e2e543f2f..6c0454b1df 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Evennia MUD/MU\* Creation System ![][logo] -[![Build Status][unittestciimg]][unittestcilink] [![Coverage Status][coverimg]][coverlink] [![Pypi Version][pypibadge]][pypilink] +[![Coverage Status][coverimg]][coverlink] [![Pypi Version][pypibadge]][pypilink] [Evennia][homepage] is a modern library for creating [online multiplayer text From eabfede7ecd4b5a608befd724b106b9f3feb5b40 Mon Sep 17 00:00:00 2001 From: InspectorCaracal <51038201+InspectorCaracal@users.noreply.github.com> Date: Sat, 3 Dec 2022 10:35:16 -0700 Subject: [PATCH 10/49] fix excessive Discord reconnects --- evennia/server/portal/discord.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evennia/server/portal/discord.py b/evennia/server/portal/discord.py index d1cb6c34c7..eab9ca1a92 100644 --- a/evennia/server/portal/discord.py +++ b/evennia/server/portal/discord.py @@ -201,7 +201,7 @@ class DiscordWebsocketServerFactory(WebSocketClientFactory, protocol.Reconnectin reason (str): The reason for the failure. """ - if self.do_retry or not self.bot: + if self.do_retry and self.bot: self.retry(connector) def reconnect(self): From 24fe2455269a936d32d5117480e1662bf9e60624 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 3 Dec 2022 19:28:05 +0100 Subject: [PATCH 11/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c0454b1df..4c139fdfce 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Evennia MUD/MU\* Creation System ![][logo] -[![Coverage Status][coverimg]][coverlink] [![Pypi Version][pypibadge]][pypilink] +[![unittestciimg]][unittestcilink] [![Coverage Status][coverimg]][coverlink] [![Pypi Version][pypibadge]][pypilink] [Evennia][homepage] is a modern library for creating [online multiplayer text From 0660e5d10b6ef37984393a57a75ab0edb5b47fdc Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 3 Dec 2022 19:29:04 +0100 Subject: [PATCH 12/49] Make docker images build off main branch --- .github/workflows/github_action_test_suite.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/github_action_test_suite.yml b/.github/workflows/github_action_test_suite.yml index b8305cfd74..685b242e91 100644 --- a/.github/workflows/github_action_test_suite.yml +++ b/.github/workflows/github_action_test_suite.yml @@ -107,7 +107,7 @@ jobs: name: Deploy Docker Image needs: test runs-on: ubuntu-latest - if: ${{ github.repository == 'evennia/evennia' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') }} + if: ${{ github.repository == 'evennia/evennia' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') }} steps: - uses: actions/checkout@v3 @@ -123,9 +123,9 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push for master - if: ${{ github.ref == 'refs/heads/master' }} - id: docker_build_master + - name: Build and push for main + if: ${{ github.ref == 'refs/heads/main' }} + id: docker_build_main uses: docker/build-push-action@v3 with: push: true From 702d0e57033ee63eb82ec3da29e0cfb8abcc9b39 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 3 Dec 2022 20:39:33 +0100 Subject: [PATCH 13/49] Fix typo in upgrade doc --- docs/source/Setup/Installation-Upgrade.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/Setup/Installation-Upgrade.md b/docs/source/Setup/Installation-Upgrade.md index e16310875b..4ebca58d73 100644 --- a/docs/source/Setup/Installation-Upgrade.md +++ b/docs/source/Setup/Installation-Upgrade.md @@ -16,7 +16,7 @@ Prior to 1.0, all Evennia installs were [Git-installs](./Installation-Git.md). T - Make a _new_ `evenv` virtualenv (see the [virtualenv instructions](./Installation-Git.md#virtualenv) for help) and make sure it's active - `cd` into your `evennia/` root folder (you want to be where you see the `docs/` and `bin/` directories as well as a nested `evennia/` folder) - `git pull` -- `git checkout main` (the `master`) +- `git checkout main` (instead of `master` which was used for `0.9.5`) - `pip install -e --upgrade .` - If you want the optional extra libs (needed by some contribs), do `pip install -e --upgrade .[extra]` - Test that you can run the `evennia` command. From 20e7a7fed8e2726d268bf33f4400df95aa26d3dc Mon Sep 17 00:00:00 2001 From: dvoraen <42825596+dvoraen@users.noreply.github.com> Date: Sun, 4 Dec 2022 04:05:55 -0800 Subject: [PATCH 14/49] add: coverage to toml; workflow timeout --- .../workflows/github_action_test_suite.yml | 22 +-- pyproject.toml | 182 +++++++++++------- 2 files changed, 118 insertions(+), 86 deletions(-) diff --git a/.github/workflows/github_action_test_suite.yml b/.github/workflows/github_action_test_suite.yml index 685b242e91..cab529dcf6 100644 --- a/.github/workflows/github_action_test_suite.yml +++ b/.github/workflows/github_action_test_suite.yml @@ -26,6 +26,12 @@ jobs: TESTING_DB: "sqlite3" coverage-test: true + timeout-minutes: 35 + + env: + UNIT_TEST_SETTINGS: "--settings=settings --keepdb --parallel 4 --timing" + COVERAGE_TEST_SETTINGS: "--settings=settings --timing" + steps: - uses: actions/checkout@v3 @@ -67,12 +73,7 @@ jobs: if: ${{ ! matrix.coverage-test }} working-directory: testing_mygame run: | - evennia test \ - --settings=settings \ - --keepdb \ - --parallel 4 \ - --timing \ - evennia + evennia test ${{ env.UNIT_TEST_SETTINGS }} evennia # OBS - it's important to not run the coverage tests with --parallel, it messes up the coverage # calculation! @@ -80,13 +81,8 @@ jobs: if: ${{ matrix.coverage-test }} working-directory: testing_mygame run: | - coverage run \ - --source=evennia \ - --omit=*/migrations/*,*/urls.py,*/test*.py,*.sh,*.txt,*.md,*.pyc,*.service \ - ../bin/unix/evennia test \ - --settings=settings \ - --timing \ - evennia + coverage run --rcfile=../pyproject.toml ../bin/unix/evennia test ${{ env.COVERAGE_TEST_SETTINGS }} evennia + coverage combine coverage xml coverage --version coverage report | grep TOTAL diff --git a/pyproject.toml b/pyproject.toml index 028e42c0ca..1a1e53abaa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,97 +5,116 @@ build-backend = "setuptools.build_meta" [project] name = "evennia" version = "1.0" -maintainers = [ - { name="Griatch", email="griatch@gmail.com" }, -] +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.10" -readme = { file="README.md", content-type="text/markdown" } -license = { text="BSD" } +readme = { file = "README.md", content-type = "text/markdown" } +license = { text = "BSD" } keywords = [ - "MUD", "MUSH", "MUX", "MMO", "text-only", "multiplayer", "online", "rpg", "game", "engine", - "framework", "text", "adventure", "telnet", "websocket", "blind", "accessible", "ascii", - "utf-8", "terminal", "online", "server", "beginner", "tutorials" + "MUD", + "MUSH", + "MUX", + "MMO", + "text-only", + "multiplayer", + "online", + "rpg", + "game", + "engine", + "framework", + "text", + "adventure", + "telnet", + "websocket", + "blind", + "accessible", + "ascii", + "utf-8", + "terminal", + "online", + "server", + "beginner", + "tutorials", ] classifiers = [ - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: JavaScript", - "Development Status :: 5 - Production/Stable", - "License :: OSI Approved :: BSD License", - "Environment :: Console", - "Environment :: Web Environment", - "Framework :: Django", - "Framework :: Twisted", - "Intended Audience :: Developers", - "Intended Audience :: Education", - "Operating System :: MacOS", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX :: Linux", - "Topic :: Database", - "Topic :: Education", - "Topic :: Games/Entertainment :: Multi-User Dungeons (MUD)", - "Topic :: Games/Entertainment :: Puzzle Games", - "Topic :: Games/Entertainment :: Role-Playing", - "Topic :: Games/Entertainment :: Simulation", - "Topic :: Software Development :: Libraries :: Application Frameworks", - "Topic :: Internet :: WWW/HTTP :: WSGI :: Server" + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: JavaScript", + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: BSD License", + "Environment :: Console", + "Environment :: Web Environment", + "Framework :: Django", + "Framework :: Twisted", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Topic :: Database", + "Topic :: Education", + "Topic :: Games/Entertainment :: Multi-User Dungeons (MUD)", + "Topic :: Games/Entertainment :: Puzzle Games", + "Topic :: Games/Entertainment :: Role-Playing", + "Topic :: Games/Entertainment :: Simulation", + "Topic :: Software Development :: Libraries :: Application Frameworks", + "Topic :: Internet :: WWW/HTTP :: WSGI :: Server", ] dependencies = [ - # core dependencies - "django >= 4.1.3, < 4.2", - "twisted >= 22.10, < 23", - "pytz >= 2022.6", - "djangorestframework >= 3.14, < 3.15", - "pyyaml >= 6.0", - "django-filter == 2.4", - "django-sekizai == 2.0.0", - "inflect >= 5.2.0", - "autobahn >= 20.7.1, < 21.0.0", - "lunr == 0.6.0", - "simpleeval <= 1.0", - "uritemplate == 4.1.1", - "Jinja2 < 3.1", - "tzdata >= 2022.6", - # for unit tests and code formatting - "mock >= 4.0.3", - "model_mommy >= 2.0", - "anything ==0.2.1", - "black >= 22.6", - "isort >= 5.10", - "parameterized ==0.8.1", + # core dependencies + "django >= 4.1.3, < 4.2", + "twisted >= 22.10, < 23", + "pytz >= 2022.6", + "djangorestframework >= 3.14, < 3.15", + "pyyaml >= 6.0", + "django-filter == 2.4", + "django-sekizai == 2.0.0", + "inflect >= 5.2.0", + "autobahn >= 20.7.1, < 21.0.0", + "lunr == 0.6.0", + "simpleeval <= 1.0", + "uritemplate == 4.1.1", + "Jinja2 < 3.1", + "tzdata >= 2022.6", + # for unit tests and code formatting + "mock >= 4.0.3", + "model_mommy >= 2.0", + "anything ==0.2.1", + "black >= 22.6", + "isort >= 5.10", + "parameterized ==0.8.1", ] [project.optional-dependencies] extra = [ - # contrib optional dependencies - # install with 'pip install evennia[extra]` + # contrib optional dependencies + # install with 'pip install evennia[extra]` - # crypto libraries for ssh support - "cryptography >= 2.8", - "pyasn1 >= 0.4.8", - "bcrypt >= 3.1.7", + # crypto libraries for ssh support + "cryptography >= 2.8", + "pyasn1 >= 0.4.8", + "bcrypt >= 3.1.7", - # Telnet-SSL support - "pyopenssl >= 19.1", - "service_identity >= 18.1.0", + # Telnet-SSL support + "pyopenssl >= 19.1", + "service_identity >= 18.1.0", - # AWS storage contrib - "boto3 >= 1.4.4", - "botocore >= 1.15", + # AWS storage contrib + "boto3 >= 1.4.4", + "botocore >= 1.15", - # Jupyter Notebook support - "jupyter >= 1.0.0", - "ipython >= 7.19.0", - "django-extensions >= 3.1.0", + # Jupyter Notebook support + "jupyter >= 1.0.0", + "ipython >= 7.19.0", + "django-extensions >= 3.1.0", - # xyzroom contrib - "scipy == 1.9.3", + # xyzroom contrib + "scipy == 1.9.3", - # Git contrib - "gitpython >= 3.1.27" + # Git contrib + "gitpython >= 3.1.27", ] [project.urls] @@ -133,3 +152,20 @@ exclude = ''' ) ''' + +[tool.coverage] + +[tool.coverage.run] +concurrency = ["multiprocessing"] +parallel = true +source = ["evennia"] +omit = [ + "*/migrations/*", + "*/urls.py", + "*/test*.py", + "*.sh", + "*.txt", + "*.md", + "*.pyc", + "*.service", +] From e339cf1083db18e811135894da288739b8f71b1d Mon Sep 17 00:00:00 2001 From: Griatch Date: Mon, 5 Dec 2022 19:54:33 +0100 Subject: [PATCH 15/49] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4c139fdfce..92e91fb246 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,8 @@ Welcome! [logo]: https://github.com/evennia/evennia/blob/master/evennia/web/website/static/website/images/evennia_logo.png [unittestciimg]: https://github.com/evennia/evennia/workflows/test-suite/badge.svg [unittestcilink]: https://github.com/evennia/evennia/actions?query=workflow%3Atest-suite -[coverimg]: https://coveralls.io/repos/github/evennia/evennia/badge.svg?branch=master -[coverlink]: https://coveralls.io/github/evennia/evennia?branch=master +[coverimg]: https://coveralls.io/repos/github/evennia/evennia/badge.svg?branch=main +[coverlink]: https://coveralls.io/github/evennia/evennia?branch=main [pypibadge]: https://img.shields.io/pypi/v/evennia?color=blue [pypilink]: https://pypi.org/project/evennia/ [introduction]: https://www.evennia.com/docs/latest/Evennia-Introduction.html From b969f91d669289b35b4334332d79ba0731804135 Mon Sep 17 00:00:00 2001 From: Griatch Date: Tue, 6 Dec 2022 15:35:49 +0100 Subject: [PATCH 16/49] Fix typo in upgrade instruction --- docs/source/Setup/Installation-Upgrade.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/Setup/Installation-Upgrade.md b/docs/source/Setup/Installation-Upgrade.md index 4ebca58d73..6f343aa3d8 100644 --- a/docs/source/Setup/Installation-Upgrade.md +++ b/docs/source/Setup/Installation-Upgrade.md @@ -17,7 +17,7 @@ Prior to 1.0, all Evennia installs were [Git-installs](./Installation-Git.md). T - `cd` into your `evennia/` root folder (you want to be where you see the `docs/` and `bin/` directories as well as a nested `evennia/` folder) - `git pull` - `git checkout main` (instead of `master` which was used for `0.9.5`) -- `pip install -e --upgrade .` +- `pip install --upgrade -e .` - If you want the optional extra libs (needed by some contribs), do `pip install -e --upgrade .[extra]` - Test that you can run the `evennia` command. From 4c59a243dc6ae7b002696db38ec30dfe16c973f3 Mon Sep 17 00:00:00 2001 From: Griatch Date: Tue, 6 Dec 2022 15:56:56 +0100 Subject: [PATCH 17/49] Fix typo in version-control docs --- docs/source/Coding/Version-Control.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/Coding/Version-Control.md b/docs/source/Coding/Version-Control.md index 9f66014a7b..f8af7a380e 100644 --- a/docs/source/Coding/Version-Control.md +++ b/docs/source/Coding/Version-Control.md @@ -295,7 +295,7 @@ You can't do `git push upstream` unless you have write-access to the upstream Ev This should be done in your fork of Evennia. You should _always_ do this in a _separate git branch_ based off the Evennia branch you want to improve. git checkout main (or develop) - git branch - b myfixbranch + git branch -b myfixbranch Now fix whatever needs fixing. Abide by the [Evennia code style](./Evennia-Code-Style.md). You can `git commit` commit your changes along the way as normal. From 045a83c6cc1ec6e588e954678bb2e17461ce1ba6 Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 7 Dec 2022 19:34:27 +0100 Subject: [PATCH 18/49] Fix justify m_len call. Fixes #3019 --- Makefile | 2 +- evennia/utils/evmenu.py | 13 ++----------- evennia/utils/evtable.py | 1 - evennia/utils/utils.py | 9 ++++----- 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 373c253269..5d707a6e04 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ default: @echo " make test - run evennia test suite with all default values." @echo " make tests=evennia.path test - run only specific test or tests." @echo " make testp - run test suite using multiple cores." - @echo " make publish - publish evennia to pypi (requires pypi credentials) + @echo " make release - publish evennia to pypi (requires pypi credentials) install: pip install -e . diff --git a/evennia/utils/evmenu.py b/evennia/utils/evmenu.py index 163494f933..1430bc31d4 100644 --- a/evennia/utils/evmenu.py +++ b/evennia/utils/evmenu.py @@ -273,22 +273,12 @@ from django.conf import settings # i18n from django.utils.translation import gettext as _ - from evennia import CmdSet, Command from evennia.commands import cmdhandler from evennia.utils import logger from evennia.utils.ansi import strip_ansi from evennia.utils.evtable import EvColumn, EvTable -from evennia.utils.utils import ( - crop, - dedent, - is_iter, - m_len, - make_iter, - mod_import, - pad, - to_str, -) +from evennia.utils.utils import crop, dedent, is_iter, m_len, make_iter, mod_import, pad, to_str # read from protocol NAWS later? _MAX_TEXT_WIDTH = settings.CLIENT_DEFAULT_WIDTH @@ -1179,6 +1169,7 @@ class EvMenu: for icol in range(ncols): start = icol * split end = min(start + split, max_end) + print(f"col {icol}:", table[start:end]) cols_list.append(EvColumn(*table[start:end])) return str(EvTable(table=cols_list, border="none")) diff --git a/evennia/utils/evtable.py b/evennia/utils/evtable.py index 8517344f61..f6837a79a0 100644 --- a/evennia/utils/evtable.py +++ b/evennia/utils/evtable.py @@ -118,7 +118,6 @@ from copy import copy, deepcopy from textwrap import TextWrapper from django.conf import settings - from evennia.utils.ansi import ANSIString from evennia.utils.utils import display_len as d_len from evennia.utils.utils import is_iter, justify diff --git a/evennia/utils/utils.py b/evennia/utils/utils.py index aa58fe121e..3ad2bff9b5 100644 --- a/evennia/utils/utils.py +++ b/evennia/utils/utils.py @@ -34,13 +34,12 @@ from django.core.validators import validate_email as django_validate_email from django.utils import timezone from django.utils.html import strip_tags from django.utils.translation import gettext as _ +from evennia.utils import logger from simpleeval import simple_eval from twisted.internet import reactor, threads from twisted.internet.defer import returnValue # noqa - used as import target from twisted.internet.task import deferLater -from evennia.utils import logger - _MULTIMATCH_TEMPLATE = settings.SEARCH_MULTIMATCH_TEMPLATE _EVENNIA_DIR = settings.EVENNIA_DIR _GAME_DIR = settings.GAME_DIR @@ -288,8 +287,8 @@ def justify(text, width=None, align="l", indent=0, fillchar=" "): # absolute mode - just crop or fill to width abs_lines = [] for line in text.split("\n"): - nlen = len(line) - if len(line) < width: + nlen = m_len(line) + if m_len(line) < width: line += sp * (width - nlen) else: line = crop(line, width=width, suffix="") @@ -304,7 +303,7 @@ def justify(text, width=None, align="l", indent=0, fillchar=" "): for ip, paragraph in enumerate(paragraphs): if ip > 0: words.append(("\n", 0)) - words.extend((word, len(word)) for word in paragraph.split()) + words.extend((word, m_len(word)) for word in paragraph.split()) if not words: # Just whitespace! From cd07c782406304db132974cc75bcbd1b1f39f6e6 Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 7 Dec 2022 19:35:06 +0100 Subject: [PATCH 19/49] Ran formatter --- evennia/server/server.py | 1 + evennia/server/tests/test_launcher.py | 5 +++-- evennia/utils/dbserialize.py | 1 + evennia/utils/evmenu.py | 12 +++++++++++- evennia/utils/evtable.py | 1 + evennia/utils/utils.py | 3 ++- 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/evennia/server/server.py b/evennia/server/server.py index 745dfeb480..db2548e8f9 100644 --- a/evennia/server/server.py +++ b/evennia/server/server.py @@ -31,6 +31,7 @@ from django.conf import settings from django.db import connection from django.db.utils import OperationalError from django.utils.translation import gettext as _ + from evennia.accounts.models import AccountDB from evennia.scripts.models import ScriptDB from evennia.server.models import ServerConfig diff --git a/evennia/server/tests/test_launcher.py b/evennia/server/tests/test_launcher.py index 2b894a0720..e0c1c0c27a 100644 --- a/evennia/server/tests/test_launcher.py +++ b/evennia/server/tests/test_launcher.py @@ -7,13 +7,14 @@ import os import pickle from anything import Something -from evennia.server import evennia_launcher -from evennia.server.portal import amp from mock import MagicMock, create_autospec, patch from twisted.internet import reactor from twisted.internet.base import DelayedCall from twisted.trial.unittest import TestCase as TwistedTestCase +from evennia.server import evennia_launcher +from evennia.server.portal import amp + DelayedCall.debug = True diff --git a/evennia/utils/dbserialize.py b/evennia/utils/dbserialize.py index d208e554f1..d49143f970 100644 --- a/evennia/utils/dbserialize.py +++ b/evennia/utils/dbserialize.py @@ -30,6 +30,7 @@ except ImportError: from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from django.utils.safestring import SafeString + from evennia.utils import logger from evennia.utils.utils import is_iter, to_bytes, uses_database diff --git a/evennia/utils/evmenu.py b/evennia/utils/evmenu.py index 1430bc31d4..4f4ecddfc4 100644 --- a/evennia/utils/evmenu.py +++ b/evennia/utils/evmenu.py @@ -273,12 +273,22 @@ from django.conf import settings # i18n from django.utils.translation import gettext as _ + from evennia import CmdSet, Command from evennia.commands import cmdhandler from evennia.utils import logger from evennia.utils.ansi import strip_ansi from evennia.utils.evtable import EvColumn, EvTable -from evennia.utils.utils import crop, dedent, is_iter, m_len, make_iter, mod_import, pad, to_str +from evennia.utils.utils import ( + crop, + dedent, + is_iter, + m_len, + make_iter, + mod_import, + pad, + to_str, +) # read from protocol NAWS later? _MAX_TEXT_WIDTH = settings.CLIENT_DEFAULT_WIDTH diff --git a/evennia/utils/evtable.py b/evennia/utils/evtable.py index f6837a79a0..8517344f61 100644 --- a/evennia/utils/evtable.py +++ b/evennia/utils/evtable.py @@ -118,6 +118,7 @@ from copy import copy, deepcopy from textwrap import TextWrapper from django.conf import settings + from evennia.utils.ansi import ANSIString from evennia.utils.utils import display_len as d_len from evennia.utils.utils import is_iter, justify diff --git a/evennia/utils/utils.py b/evennia/utils/utils.py index 3ad2bff9b5..b96338dead 100644 --- a/evennia/utils/utils.py +++ b/evennia/utils/utils.py @@ -34,12 +34,13 @@ from django.core.validators import validate_email as django_validate_email from django.utils import timezone from django.utils.html import strip_tags from django.utils.translation import gettext as _ -from evennia.utils import logger from simpleeval import simple_eval from twisted.internet import reactor, threads from twisted.internet.defer import returnValue # noqa - used as import target from twisted.internet.task import deferLater +from evennia.utils import logger + _MULTIMATCH_TEMPLATE = settings.SEARCH_MULTIMATCH_TEMPLATE _EVENNIA_DIR = settings.EVENNIA_DIR _GAME_DIR = settings.GAME_DIR From 8122c4f942a7ae0583b8dea512b181a9ba9328f2 Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 7 Dec 2022 19:36:27 +0100 Subject: [PATCH 20/49] Evennia 1.0.1 bug fix release --- .release.sh | 44 +++++++++++++++++++++++++++++++++++++++++ Makefile | 10 ++++------ evennia/VERSION.txt | 2 +- evennia/utils/evmenu.py | 13 +----------- pyproject.toml | 2 +- 5 files changed, 51 insertions(+), 20 deletions(-) create mode 100755 .release.sh diff --git a/.release.sh b/.release.sh new file mode 100755 index 0000000000..52a4e632c0 --- /dev/null +++ b/.release.sh @@ -0,0 +1,44 @@ +# Release helper + +VERSION=$(cat evennia/VERSION.txt) + +echo "This will release Evennia $VERSION (based on evennia/VERSION.txt)." +echo "Before continuing:" +echo " 1. Make sure you have Evennia upload credentials." +echo " 2. Determine if CHANGELOG.md should be updated and rebuilt." +echo " 3. Make sure VERSION.txt and pyproject.toml both show version $VERSION." +echo " 4. Make sure all changes are committed (all un-staged files will be wiped)." +echo " 5. Make sure all unit tests pass." + +read -p "Continue? [Y/n]> " yn + +case $yn in + [nN] ) echo "Aborting."; + exit;; + * ) echo "Starting release ...";; +esac + +# clean and build the pypi distribution +echo "Preparing and Building PyPi package ..." +rm -Rf dist/ +git clean -xdf +pip install --upgrade pip +pip install build twine +python -m build --sdist --wheel --outdir dist/ . + +echo "Uploading PyPi package (requires credentials) ..." + +python -m twine upload dist/* + +# tag the latest git commit +echo "Creating and pushing release tag tag v$VERSION ..." +git tag -a v$VERSION -m "Evennia release v$VERSION" +git push --tags + +echo "... Release complete." +echo "" +echo "Post-release actions:" +echo " 1. Make sure to push all commits." +echo " 2. Update github discussions to report on release." +echo " 2. Make post in discord #announcements channel pointing to discussion post." +echo " 3. Any other announcements as needed." diff --git a/Makefile b/Makefile index 5d707a6e04..8ccf3f355d 100644 --- a/Makefile +++ b/Makefile @@ -44,10 +44,8 @@ testp: evennia migrate;\ evennia test --keepdb --parallel 4 $(TESTS);\ +version: + echo $(VERSION) + release: - rm -Rf dist/ - git clean -xdf - pip install --upgrade pip - pip install build twine - python -m build --sdist --wheel --outdir dist/ . - python -m twine upload dist/* + ./.release.sh diff --git a/evennia/VERSION.txt b/evennia/VERSION.txt index d3827e75a5..7dea76edb3 100644 --- a/evennia/VERSION.txt +++ b/evennia/VERSION.txt @@ -1 +1 @@ -1.0 +1.0.1 diff --git a/evennia/utils/evmenu.py b/evennia/utils/evmenu.py index 4f4ecddfc4..2ee0163e06 100644 --- a/evennia/utils/evmenu.py +++ b/evennia/utils/evmenu.py @@ -273,22 +273,12 @@ from django.conf import settings # i18n from django.utils.translation import gettext as _ - from evennia import CmdSet, Command from evennia.commands import cmdhandler from evennia.utils import logger from evennia.utils.ansi import strip_ansi from evennia.utils.evtable import EvColumn, EvTable -from evennia.utils.utils import ( - crop, - dedent, - is_iter, - m_len, - make_iter, - mod_import, - pad, - to_str, -) +from evennia.utils.utils import crop, dedent, is_iter, m_len, make_iter, mod_import, pad, to_str # read from protocol NAWS later? _MAX_TEXT_WIDTH = settings.CLIENT_DEFAULT_WIDTH @@ -1179,7 +1169,6 @@ class EvMenu: for icol in range(ncols): start = icol * split end = min(start + split, max_end) - print(f"col {icol}:", table[start:end]) cols_list.append(EvColumn(*table[start:end])) return str(EvTable(table=cols_list, border="none")) diff --git a/pyproject.toml b/pyproject.toml index 1a1e53abaa..b348843cc2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "evennia" -version = "1.0" +version = "1.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.10" From 40eecaca94f78b18ddc95634ee2a6d76994bc6ca Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 7 Dec 2022 20:58:17 +0100 Subject: [PATCH 21/49] Remove automatic pypi release action, not going to be used --- .../github_action_publish_to_pypi.yml | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 .github/workflows/github_action_publish_to_pypi.yml diff --git a/.github/workflows/github_action_publish_to_pypi.yml b/.github/workflows/github_action_publish_to_pypi.yml deleted file mode 100644 index 48d3c246fa..0000000000 --- a/.github/workflows/github_action_publish_to_pypi.yml +++ /dev/null @@ -1,37 +0,0 @@ -# This Evennia workflow will deploy the Evennia package automatically to -# pypi if vNN tag was given. -# - -name: publish-evennia - -on: - push: - tags: ['v*'] - -jobs: - build-and-publish: - name: Build and publish Evennia to PyPi - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@master - - - name: Set up Python 3.11 - uses: actions/setup-python@v3 - with: - python-version: "3.11" - - - name: Install build - run: | - python -m pip install --upgrade pip - python -m pip install build --user - - - name: Build binary wheel and source tarball - run: | - python -m build --sdist --wheel --outdir dist/ . - - - name: Publish Evennia PyPi (on tag) - if: startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} From f2a612643866ffabadf213e8117ebeb668583629 Mon Sep 17 00:00:00 2001 From: Chiizujin Date: Thu, 8 Dec 2022 14:12:46 +1100 Subject: [PATCH 22/49] Fix help typos --- evennia/commands/default/account.py | 2 +- evennia/game_template/world/help_entries.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/evennia/commands/default/account.py b/evennia/commands/default/account.py index af920a2325..1dbb7d8ecf 100644 --- a/evennia/commands/default/account.py +++ b/evennia/commands/default/account.py @@ -1024,7 +1024,7 @@ class CmdStyle(COMMAND_DEFAULT_CLASS): style