From 41f8b8aeb9f95f314c684a93ea01080c9a75ad42 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Tue, 19 Apr 2022 14:43:15 +0000 Subject: [PATCH 01/10] Various tox.ini improvements and cleanup Be more explicit about when we do and don't install the project in different testenvs by setting skip_install. This is currently redundant, but a sensible safeguard in case the implicit behavior from skipsdist and no usedevelop ever changes. Use shutil.rmtree() in place of calling `rm` so that we won't need an allowlist of executables outside the venv. Switch to tox's {envpython} replacement macro rather than invoking the interpreter by its assumed name, for improved portability. Inherit {[testenv]deps} in the deps list for any testenv which needs to extend it rather than duplicating its contents, for the sake of maintainability. Don't bother listing flake8 as an explicit dep in its testenv, since the flake8-bugbear plugin will pull it in as a requirement anyway. Update the DeprecationWarning comment about pyparsing now that the fix is available in 3.0.8 (but still not updated where it's being vendored). --- tox.ini | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/tox.ini b/tox.ini index e62c385..fddb29d 100644 --- a/tox.ini +++ b/tox.ini @@ -17,9 +17,8 @@ basepython = python3 # 'language_level' not set, using 2 for now (Py2). This will change in a # later release!" but this can't be matched by message because it has a comma # py311... pip._vendor.pyparsing.core and pkg_resources._vendor.pyparsing raise -# DeprecationWarning "module 'sre_constants' is deprecated" until a new -# release containing https://github.com/pyparsing/pyparsing/commit/3c03942 is -# vendored into pip and pkg_resources +# DeprecationWarning "module 'sre_constants' is deprecated" until +# pyparsing>=3.0.8 is vendored into pip and pkg_resources # py310... distutils.command.install raises DeprecationWarning "The # distutils.sysconfig module is deprecated, use sysconfig instead" but this # can't be matched by message because it contains a comma @@ -58,11 +57,13 @@ deps = {toxinidir} [testenv:bandit] description = check for potential security risks in source code +skip_install = True deps = bandit commands = bandit -r mudpy -x mudpy/tests {posargs} [testenv:codespell] description = find common spelling mistakes in code and documentation +skip_install = True deps = codespell commands = codespell {posargs} @@ -72,34 +73,32 @@ commands = mudpy {posargs} [testenv:dist] description = build release artifacts and check for conformance -allowlist_externals = rm +skip_install = True deps = build twine commands = - rm -fr {toxinidir}/dist - python -m build + {envpython} -c "import shutil; shutil.rmtree('{toxinidir}/dist', ignore_errors=True)" + {envpython} -m build twine check --strict {toxinidir}/dist/* [testenv:docs] # Build an sdist into a temporary location so we'll have AUTHORS and ChangeLog # files to include. description = generate hypertext documentation -allowlist_externals = rm deps = - {toxinidir} + {[testenv]deps} build sphinx commands = - rm -fr {toxinidir}/doc/build - python -m build --outdir={toxinidir}/doc/build/dist --sdist + {envpython} -c "import shutil; shutil.rmtree('{toxinidir}/doc/build', ignore_errors=True)" + {envpython} -m build --outdir={toxinidir}/doc/build/dist --sdist sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html [testenv:flake8] description = style checks and static analysis of source code -deps = - flake8 - flake8-bugbear +skip_install = True +deps = flake8-bugbear commands = flake8 {posargs} [testenv:selftest_config] @@ -112,7 +111,7 @@ commands = mudpy_selftest etc/mudpy.yaml # them with the same style we enforce for those carried in the repository. description = test data files for correct syntax and formatting deps = - {toxinidir} + {[testenv]deps} yamllint commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml -- 2.11.0 From e3bc7f74dbe123224316870707ee0dd2a4ea00c8 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Thu, 26 May 2022 16:36:17 +0000 Subject: [PATCH 02/10] Update warning filters for Python 3.11.0b1 etc Python 3.11.0b1 adds new deprecation warnings for "dead batteries" in the stdlib, both for our dependencies and ourself (telnetlib is used a bit in the selftest). Also some new warnings are cropping up with pip 22 and SetupTools 62, so filter those for now until they're solved. Drop a filter for deprecated sre_constants use in the pkg_resources vendored version of pyparsing which has recently been updated. --- tox.ini | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index fddb29d..0a8a021 100644 --- a/tox.ini +++ b/tox.ini @@ -16,14 +16,25 @@ basepython = python3 # py311... Cython.Compiler.Main raises FutureWarning "Cython directive # 'language_level' not set, using 2 for now (Py2). This will change in a # later release!" but this can't be matched by message because it has a comma -# py311... pip._vendor.pyparsing.core and pkg_resources._vendor.pyparsing raise -# DeprecationWarning "module 'sre_constants' is deprecated" until -# pyparsing>=3.0.8 is vendored into pip and pkg_resources +# py311... pip._internal.index.collector and Cython.Tempita raise +# DeprecationWarning "'cgi' is deprecated and slated for removal in Python +# 3.13" +# py311... passlib.utils raises DeprecationWarning "'crypt' is deprecated and +# slated for removal in Python 3.13" +# py311... mudpy.tests.selftest raises DeprecationWarning "'telnetlib' is +# deprecated and slated for removal in Python 3.13" # py310... distutils.command.install raises DeprecationWarning "The # distutils.sysconfig module is deprecated, use sysconfig instead" but this # can't be matched by message because it contains a comma # flake8... flake8.plugins.manager raises DeprecationWarning "SelectableGroups # dict interface is deprecated. Use select." +# yamllint... setuptools.command.build_py raises +# setuptools._deprecation_warning.SetuptoolsDeprecationWarning "Installing +# 'yamllint.conf' as data is deprecated, please list it in `packages`. [...]" +# but the message can't be matched because it contains a comma and spans +# multiple lines while the custom Warning subclass can't be matched +# specifically leading to a blanket ignore for all Warning types in package +# builds # multiple callers raise DeprecationWarning "The distutils package is # deprecated and slated for removal in Python 3.12. Use setuptools or check # PEP 632 for potential alternatives" @@ -49,7 +60,7 @@ basepython = python3 # contains a colon setenv = PYTHONWARNDFAULTENCODING = 1 - PYTHONWARNINGS = error, ignore::FutureWarning:Cython.Compiler.Main, ignore::DeprecationWarning:distutils.command.install, ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning, ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning, ignore:SelectableGroups dict interface is deprecated. Use select.:DeprecationWarning:flake8.plugins.manager, ignore:setup.py install is deprecated. Use build and pip and other standards-based tools., ignore:easy_install command is deprecated. Use build and pip and other standards-based tools., ignore::DeprecationWarning:pip._vendor.certifi.core, ignore::DeprecationWarning:pip._vendor.pep517.in_process, ignore:module 'sre_constants' is deprecated:DeprecationWarning:pip._vendor.pyparsing.core, ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing + PYTHONWARNINGS = error, ignore::FutureWarning:Cython.Compiler.Main, ignore::DeprecationWarning:distutils.command.install, ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning, ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning, ignore:SelectableGroups dict interface is deprecated. Use select.:DeprecationWarning:flake8.plugins.manager, ignore:setup.py install is deprecated. Use build and pip and other standards-based tools., ignore:easy_install command is deprecated. Use build and pip and other standards-based tools., ignore::DeprecationWarning:pip._vendor.certifi.core, ignore::DeprecationWarning:pip._vendor.pep517.in_process, ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning:pip._internal.index.collector, ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning:Cython.Tempita, ignore:'crypt' is deprecated and slated for removal in Python 3.13:DeprecationWarning:passlib.utils, ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:mudpy.tests.selftest, ignore::Warning:setuptools.command.build_py PYTHONUTF8 = 1 VIRTUALENV_CREATOR = venv commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml -- 2.11.0 From bcb3728503c41c9bbe96971b5dbba2e63d607b64 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Thu, 26 May 2022 16:41:25 +0000 Subject: [PATCH 03/10] Force testing with newer pip and friends Set the "download" option to true in the default tox testenv, so that pip, SetupTools and wheel will be updated to newer versions when tests start. This should be manually overridden for now if offline testing with precreated venvs is desired. --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 0a8a021..61d1cd3 100644 --- a/tox.ini +++ b/tox.ini @@ -64,6 +64,7 @@ setenv = PYTHONUTF8 = 1 VIRTUALENV_CREATOR = venv commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml +download = true deps = {toxinidir} [testenv:bandit] -- 2.11.0 From e6f6c65d4c05325b90f43fab711f92d590a5c162 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Thu, 26 May 2022 16:50:08 +0000 Subject: [PATCH 04/10] Move SetupTools metadata into pyproject.toml SetupTools 61 adds experimental support for reading metadata from pyproject.toml files instead of traditional setup.py or setup.cfg. PBR still seems to require the package name in setup.cfg for now, but otherwise hollow this file out moving everything to the new solution. Because this is experimental, silence a warning from SetupTools which states that. Also work around newer SetupTools complaints about namespace packages included as data by informing it that mudpy.tests and mudpy.tests.fixtures are included modules even though they really aren't. --- pyproject.toml | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- setup.cfg | 51 --------------------------------------------------- tox.ini | 7 ++++++- 3 files changed, 56 insertions(+), 53 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 01b888b..e03fc14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,5 +3,54 @@ # provided in the LICENSE file distributed with this software. [build-system] -requires = ["pbr>=5.8.0", "setuptools>=36.6.0"] +requires = ["pbr>=5.8", "setuptools>=61"] build-backend = "pbr.build" + +[project] +authors = [{email = "fungi@yuggoth.org"}, {name = "Jeremy Stanley"}] +classifiers = [ + "License :: OSI Approved :: ISC License (ISCL)", + "Operating System :: POSIX", + "Operating System :: Unix", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Communications", + "Topic :: Communications :: BBS", + "Topic :: Communications :: Chat", + "Topic :: Games/Entertainment", + "Topic :: Games/Entertainment :: Multi-User Dungeons (MUD)", + "Topic :: Games/Entertainment :: Role-Playing", + "Topic :: Internet", +] +dependencies = ["passlib>=1.7", "pyyaml"] +description = "The mudpy MUD server engine." +dynamic = ["version"] +keywords = ["game", "mud", "telnet"] +maintainers = [{email = "fungi@yuggoth.org"}, {name = "Jeremy Stanley"}] +name = "mudpy" +readme = {charset = "UTF-8", content-type = "text/x-rst", file = "README"} +requires-python = ">=3.7" + +[project.scripts] +mudpy = "mudpy.daemon:main" +mudpy_selftest = "mudpy.tests.selftest:main" + +[project.urls] +"Big ChangeLog" = "https://mudpy.org/clog/mudpy/" +"Browse Source" = "https://mudpy.org/code/mudpy/" +"Bug Reporting" = "https://mudpy.org/bugs/mudpy/" +"Documentation" = "https://mudpy.org/docs/mudpy/" +"Git Clone URL" = "https://mudpy.org/code/mudpy/" +"License Texts" = "https://mudpy.org/license/" +"Release Files" = "https://mudpy.org/dist/mudpy/" + +[tool.setuptools] +# Silence a warning about namespace packages included as data because we ship +# subdirectories inside the mudpy package tree +packages = ["mudpy", "mudpy.tests", "mudpy.tests.fixtures"] diff --git a/setup.cfg b/setup.cfg index deccc06..f6b4429 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,54 +4,3 @@ [metadata] name = mudpy -summary = The mudpy MUD server engine. -long_description = file: README -long_description_content_type = text/x-rst; charset=UTF-8 -author = Jeremy Stanley -author_email = fungi@yuggoth.org -url = https://mudpy.org/ -project_urls = - Big ChangeLog = https://mudpy.org/clog/mudpy/ - Browse Source = https://mudpy.org/code/mudpy/ - Bug Reporting = https://mudpy.org/bugs/mudpy/ - Documentation = https://mudpy.org/docs/mudpy/ - Git Clone URL = https://mudpy.org/code/mudpy/ - License Texts = https://mudpy.org/license/ - Release Files = https://mudpy.org/dist/mudpy/ -keywords = mud game telnet -license = ISC License (ISCL) -platforms = POSIX/Unix -classifiers = - License :: OSI Approved :: ISC License (ISCL) - Operating System :: POSIX - Operating System :: Unix - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3 :: Only - Topic :: Communications - Topic :: Communications :: BBS - Topic :: Communications :: Chat - Topic :: Games/Entertainment - Topic :: Games/Entertainment :: Multi-User Dungeons (MUD) - Topic :: Games/Entertainment :: Role-Playing - Topic :: Internet - -[options] -install_requires = - passlib>=1.7 - pyyaml -python_requires = >=3.7 - -[files] -packages = - mudpy - -[entry_points] -console_scripts = - mudpy = mudpy.daemon:main - mudpy_selftest = mudpy.tests.selftest:main diff --git a/tox.ini b/tox.ini index 61d1cd3..11e535f 100644 --- a/tox.ini +++ b/tox.ini @@ -53,6 +53,11 @@ basepython = python3 # setuptools._deprecation_warning.SetuptoolsDeprecationWarning "easy_install # command is deprecated. Use build and pip and other standards-based tools." # but only the message can be matched because the exception is private +# setuptools.config.pyprojecttoml raises +# setuptools.config.pyprojecttoml._ExperimentalProjectMetadata "Support for +# project metadata in `pyproject.toml` is still experimental and may be +# removed (or change) in future releases." but the parent Warning class has +# to be used instead # pip._vendor.certifi.core and pip._vendor.pep517.in_process raise # DeprecationWarning "path is deprecated. Use files() instead. Refer to # https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy @@ -60,7 +65,7 @@ basepython = python3 # contains a colon setenv = PYTHONWARNDFAULTENCODING = 1 - PYTHONWARNINGS = error, ignore::FutureWarning:Cython.Compiler.Main, ignore::DeprecationWarning:distutils.command.install, ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning, ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning, ignore:SelectableGroups dict interface is deprecated. Use select.:DeprecationWarning:flake8.plugins.manager, ignore:setup.py install is deprecated. Use build and pip and other standards-based tools., ignore:easy_install command is deprecated. Use build and pip and other standards-based tools., ignore::DeprecationWarning:pip._vendor.certifi.core, ignore::DeprecationWarning:pip._vendor.pep517.in_process, ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning:pip._internal.index.collector, ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning:Cython.Tempita, ignore:'crypt' is deprecated and slated for removal in Python 3.13:DeprecationWarning:passlib.utils, ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:mudpy.tests.selftest, ignore::Warning:setuptools.command.build_py + PYTHONWARNINGS = error, ignore::FutureWarning:Cython.Compiler.Main, ignore::DeprecationWarning:distutils.command.install, ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning, ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning, ignore:SelectableGroups dict interface is deprecated. Use select.:DeprecationWarning:flake8.plugins.manager, ignore:setup.py install is deprecated. Use build and pip and other standards-based tools., ignore:easy_install command is deprecated. Use build and pip and other standards-based tools., ignore::DeprecationWarning:pip._vendor.certifi.core, ignore::DeprecationWarning:pip._vendor.pep517.in_process, ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning:pip._internal.index.collector, ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning:Cython.Tempita, ignore:'crypt' is deprecated and slated for removal in Python 3.13:DeprecationWarning:passlib.utils, ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:mudpy.tests.selftest, ignore::Warning:setuptools.command.build_py, ignore:Support for project metadata in `pyproject.toml` is still experimental and may be removed (or change) in future releases.:Warning:setuptools.config.pyprojecttoml PYTHONUTF8 = 1 VIRTUALENV_CREATOR = venv commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml -- 2.11.0 From 886033c236609341ba7abd606c45d404c81bb5d1 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Sun, 26 Jun 2022 12:25:49 +0000 Subject: [PATCH 05/10] Change SetupTools pyproject.toml metadata warning A recent update to SetupTools has altered the warning message it emits about the experimental nature of its pyproject.toml-based metadata parser. Update our PYTHONWARNINGS filter to match. --- tox.ini | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 11e535f..f9fd393 100644 --- a/tox.ini +++ b/tox.ini @@ -55,9 +55,8 @@ basepython = python3 # but only the message can be matched because the exception is private # setuptools.config.pyprojecttoml raises # setuptools.config.pyprojecttoml._ExperimentalProjectMetadata "Support for -# project metadata in `pyproject.toml` is still experimental and may be -# removed (or change) in future releases." but the parent Warning class has -# to be used instead +# `[tool.setuptools]` in `pyproject.toml` is still *beta*." but the parent +# Warning class has to be used instead # pip._vendor.certifi.core and pip._vendor.pep517.in_process raise # DeprecationWarning "path is deprecated. Use files() instead. Refer to # https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy @@ -65,7 +64,7 @@ basepython = python3 # contains a colon setenv = PYTHONWARNDFAULTENCODING = 1 - PYTHONWARNINGS = error, ignore::FutureWarning:Cython.Compiler.Main, ignore::DeprecationWarning:distutils.command.install, ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning, ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning, ignore:SelectableGroups dict interface is deprecated. Use select.:DeprecationWarning:flake8.plugins.manager, ignore:setup.py install is deprecated. Use build and pip and other standards-based tools., ignore:easy_install command is deprecated. Use build and pip and other standards-based tools., ignore::DeprecationWarning:pip._vendor.certifi.core, ignore::DeprecationWarning:pip._vendor.pep517.in_process, ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning:pip._internal.index.collector, ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning:Cython.Tempita, ignore:'crypt' is deprecated and slated for removal in Python 3.13:DeprecationWarning:passlib.utils, ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:mudpy.tests.selftest, ignore::Warning:setuptools.command.build_py, ignore:Support for project metadata in `pyproject.toml` is still experimental and may be removed (or change) in future releases.:Warning:setuptools.config.pyprojecttoml + PYTHONWARNINGS = error, ignore::FutureWarning:Cython.Compiler.Main, ignore::DeprecationWarning:distutils.command.install, ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning, ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning, ignore:SelectableGroups dict interface is deprecated. Use select.:DeprecationWarning:flake8.plugins.manager, ignore:setup.py install is deprecated. Use build and pip and other standards-based tools., ignore:easy_install command is deprecated. Use build and pip and other standards-based tools., ignore::DeprecationWarning:pip._vendor.certifi.core, ignore::DeprecationWarning:pip._vendor.pep517.in_process, ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning:pip._internal.index.collector, ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning:Cython.Tempita, ignore:'crypt' is deprecated and slated for removal in Python 3.13:DeprecationWarning:passlib.utils, ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:mudpy.tests.selftest, ignore::Warning:setuptools.command.build_py, ignore:Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.:Warning:setuptools.config.pyprojecttoml PYTHONUTF8 = 1 VIRTUALENV_CREATOR = venv commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml -- 2.11.0 From d8a885567ef00da6967a872524ffa9d6193f4fbe Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Tue, 26 Jul 2022 22:21:05 +0000 Subject: [PATCH 06/10] Stub out initial inventory management commands Basic command framework to get items into your inventory, drop items from your inventory, and list items in your inventory. No functionality is yet implemented by these. --- mudpy/command.py | 29 ++++++++++++++++++++++++++++- share/command.yaml | 15 ++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/mudpy/command.py b/mudpy/command.py index d186053..2318024 100644 --- a/mudpy/command.py +++ b/mudpy/command.py @@ -1,6 +1,6 @@ """User command functions for the mudpy engine.""" -# Copyright (c) 2004-2020 mudpy authors. Permission to use, copy, +# Copyright (c) 2004-2022 mudpy authors. Permission to use, copy, # modify, and distribute this software is granted under terms # provided in the LICENSE file distributed with this software. @@ -162,6 +162,26 @@ def evaluate(actor, parameters): return True +def c_get(actor, parameters): + """Move a prop into inventory.""" + if not parameters: + message = "What do you wish to get?" + else: + message = ('Not yet implemented.') + actor.send(message) + return True + + +def drop(actor, parameters): + """Move a prop out of inventory.""" + if not parameters: + message = "What do you wish to drop?" + else: + message = ('Not yet implemented.') + actor.send(message) + return True + + def halt(actor, parameters): """Halt the world.""" if actor.owner: @@ -290,6 +310,13 @@ def help(actor, parameters): return True +def inventory(actor, parameters): + """List the inventory.""" + message = ('Not yet implemented.') + actor.send(message) + return True + + def look(actor, parameters): """Look around.""" if parameters: diff --git a/share/command.yaml b/share/command.yaml index fd78a03..cfa10f7 100644 --- a/share/command.yaml +++ b/share/command.yaml @@ -1,5 +1,5 @@ --- -_copy: Copyright (c) 2004-2020 mudpy authors. Permission to use, copy, +_copy: Copyright (c) 2004-2022 mudpy authors. Permission to use, copy, modify, and distribute this software is granted under terms provided in the LICENSE file distributed with this software. @@ -44,6 +44,16 @@ command.evaluate.help: For debugging purposes, you can use this to run certain useful for inspecting the contents of in-memory objects, for example:$(eol)$(eol) evaluate universe.groups['actor'].keys() +command.get.action: command.c_get +command.get.description: Pick up or retrieve an item. +command.get.help: To retrieve something from your environment into your + inventory, get it by whatever name is shown, or even a subset or keyword + which you think might relate to it. + +command.drop.description: Put an item onto the ground. +command.drop.help: To drop something, reference it by whatever name is shown in + your inventory. + command.halt.administrative: true command.halt.description: Shut down the world. command.halt.help: This will save all active accounts, disconnect all clients @@ -54,6 +64,9 @@ command.help.help: This will list all command words available to you along with a brief description or, alternatively, give you detailed information on one command. +command.inventory.description: Look in your inventory. +command.inventory.help: List the items you're currently carrying around. + command.look.description: Look around. command.look.help: With the look command, you can see where you are. -- 2.11.0 From 53a5137cf78afc2507fc6739a1ef1c2b6118a9a3 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Tue, 2 Aug 2022 13:54:39 +0000 Subject: [PATCH 07/10] Simplify test warning filter for Pip 22.2 The fix to replace Pip's use of the deprecated cgi module was included in the 22.2 release, so we can clean up our exclusion for that particular DeprecationWarning. --- tox.ini | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index f9fd393..0585b26 100644 --- a/tox.ini +++ b/tox.ini @@ -16,9 +16,8 @@ basepython = python3 # py311... Cython.Compiler.Main raises FutureWarning "Cython directive # 'language_level' not set, using 2 for now (Py2). This will change in a # later release!" but this can't be matched by message because it has a comma -# py311... pip._internal.index.collector and Cython.Tempita raise -# DeprecationWarning "'cgi' is deprecated and slated for removal in Python -# 3.13" +# py311... Cython.Tempita raises DeprecationWarning "'cgi' is deprecated and +# slated for removal in Python 3.13" # py311... passlib.utils raises DeprecationWarning "'crypt' is deprecated and # slated for removal in Python 3.13" # py311... mudpy.tests.selftest raises DeprecationWarning "'telnetlib' is @@ -64,7 +63,7 @@ basepython = python3 # contains a colon setenv = PYTHONWARNDFAULTENCODING = 1 - PYTHONWARNINGS = error, ignore::FutureWarning:Cython.Compiler.Main, ignore::DeprecationWarning:distutils.command.install, ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning, ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning, ignore:SelectableGroups dict interface is deprecated. Use select.:DeprecationWarning:flake8.plugins.manager, ignore:setup.py install is deprecated. Use build and pip and other standards-based tools., ignore:easy_install command is deprecated. Use build and pip and other standards-based tools., ignore::DeprecationWarning:pip._vendor.certifi.core, ignore::DeprecationWarning:pip._vendor.pep517.in_process, ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning:pip._internal.index.collector, ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning:Cython.Tempita, ignore:'crypt' is deprecated and slated for removal in Python 3.13:DeprecationWarning:passlib.utils, ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:mudpy.tests.selftest, ignore::Warning:setuptools.command.build_py, ignore:Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.:Warning:setuptools.config.pyprojecttoml + PYTHONWARNINGS = error, ignore::FutureWarning:Cython.Compiler.Main, ignore::DeprecationWarning:distutils.command.install, ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning, ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning, ignore:SelectableGroups dict interface is deprecated. Use select.:DeprecationWarning:flake8.plugins.manager, ignore:setup.py install is deprecated. Use build and pip and other standards-based tools., ignore:easy_install command is deprecated. Use build and pip and other standards-based tools., ignore::DeprecationWarning:pip._vendor.certifi.core, ignore::DeprecationWarning:pip._vendor.pep517.in_process, ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning:Cython.Tempita, ignore:'crypt' is deprecated and slated for removal in Python 3.13:DeprecationWarning:passlib.utils, ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:mudpy.tests.selftest, ignore::Warning:setuptools.command.build_py, ignore:Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.:Warning:setuptools.config.pyprojecttoml PYTHONUTF8 = 1 VIRTUALENV_CREATOR = venv commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml -- 2.11.0 From e1c28efd28dcad31000a07dfe303adfde4b47522 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Mon, 12 Sep 2022 13:45:00 +0000 Subject: [PATCH 08/10] Add "ro" to the codespell exclusion list We use "ro" as a standard abbreviation for "read only," but it seems that codespell has recently started to not like it. --- .codespellrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.codespellrc b/.codespellrc index c7331af..e96450b 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,7 +1,7 @@ -# Copyright (c) 2020-2021 mudpy authors. Permission to use, copy, +# Copyright (c) 2020-2022 mudpy authors. Permission to use, copy, # modify, and distribute this software is granted under terms # provided in the LICENSE file distributed with this software. [codespell] -ignore-words-list = files',wont,teh,theyre,youre +ignore-words-list = files',ro,teh,theyre,wont,youre skip = *.log,*.pyc,.eggs,.git,.tox,build,data -- 2.11.0 From 355203a3fe0e14856f681566195707568be92ca6 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Sat, 1 Oct 2022 17:04:29 +0000 Subject: [PATCH 09/10] Remove more Python warning filters Many warnings emitted by dependencies have been fixed, so drop them from the list of ones to ignore. --- tox.ini | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/tox.ini b/tox.ini index 0585b26..1e90c1a 100644 --- a/tox.ini +++ b/tox.ini @@ -13,20 +13,10 @@ description = run the functional selftest with optimized configuration basepython = python3 # TODO(fungi) Switch this to "error" once the following are solved # -# py311... Cython.Compiler.Main raises FutureWarning "Cython directive -# 'language_level' not set, using 2 for now (Py2). This will change in a -# later release!" but this can't be matched by message because it has a comma -# py311... Cython.Tempita raises DeprecationWarning "'cgi' is deprecated and -# slated for removal in Python 3.13" # py311... passlib.utils raises DeprecationWarning "'crypt' is deprecated and # slated for removal in Python 3.13" # py311... mudpy.tests.selftest raises DeprecationWarning "'telnetlib' is # deprecated and slated for removal in Python 3.13" -# py310... distutils.command.install raises DeprecationWarning "The -# distutils.sysconfig module is deprecated, use sysconfig instead" but this -# can't be matched by message because it contains a comma -# flake8... flake8.plugins.manager raises DeprecationWarning "SelectableGroups -# dict interface is deprecated. Use select." # yamllint... setuptools.command.build_py raises # setuptools._deprecation_warning.SetuptoolsDeprecationWarning "Installing # 'yamllint.conf' as data is deprecated, please list it in `packages`. [...]" @@ -34,9 +24,6 @@ basepython = python3 # multiple lines while the custom Warning subclass can't be matched # specifically leading to a blanket ignore for all Warning types in package # builds -# multiple callers raise DeprecationWarning "The distutils package is -# deprecated and slated for removal in Python 3.12. Use setuptools or check -# PEP 632 for potential alternatives" # multiple callers raise DeprecationWarning "Creating a LegacyVersion has been # deprecated and will be removed in the next major release" # SetupTools raises @@ -63,7 +50,7 @@ basepython = python3 # contains a colon setenv = PYTHONWARNDFAULTENCODING = 1 - PYTHONWARNINGS = error, ignore::FutureWarning:Cython.Compiler.Main, ignore::DeprecationWarning:distutils.command.install, ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning, ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning, ignore:SelectableGroups dict interface is deprecated. Use select.:DeprecationWarning:flake8.plugins.manager, ignore:setup.py install is deprecated. Use build and pip and other standards-based tools., ignore:easy_install command is deprecated. Use build and pip and other standards-based tools., ignore::DeprecationWarning:pip._vendor.certifi.core, ignore::DeprecationWarning:pip._vendor.pep517.in_process, ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning:Cython.Tempita, ignore:'crypt' is deprecated and slated for removal in Python 3.13:DeprecationWarning:passlib.utils, ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:mudpy.tests.selftest, ignore::Warning:setuptools.command.build_py, ignore:Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.:Warning:setuptools.config.pyprojecttoml + PYTHONWARNINGS = error, ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning, ignore:setup.py install is deprecated. Use build and pip and other standards-based tools., ignore:easy_install command is deprecated. Use build and pip and other standards-based tools., ignore::DeprecationWarning:pip._vendor.certifi.core, ignore::DeprecationWarning:pip._vendor.pep517.in_process, ignore:'crypt' is deprecated and slated for removal in Python 3.13:DeprecationWarning:passlib.utils, ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:mudpy.tests.selftest, ignore::Warning:setuptools.command.build_py, ignore:Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.:Warning:setuptools.config.pyprojecttoml PYTHONUTF8 = 1 VIRTUALENV_CREATOR = venv commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml -- 2.11.0 From b96d6f737a35a8eac11e484f2743ff366dccc593 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Sat, 15 Oct 2022 17:33:14 +0000 Subject: [PATCH 10/10] Drop deprecation filters for pip and yamllint With the releases of pip 22.3 and yamllint 1.28.0, several more deprecation warnings have been addressed. Remove them from our testing filter list. --- tox.ini | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/tox.ini b/tox.ini index 1e90c1a..33c4fb9 100644 --- a/tox.ini +++ b/tox.ini @@ -17,13 +17,6 @@ basepython = python3 # slated for removal in Python 3.13" # py311... mudpy.tests.selftest raises DeprecationWarning "'telnetlib' is # deprecated and slated for removal in Python 3.13" -# yamllint... setuptools.command.build_py raises -# setuptools._deprecation_warning.SetuptoolsDeprecationWarning "Installing -# 'yamllint.conf' as data is deprecated, please list it in `packages`. [...]" -# but the message can't be matched because it contains a comma and spans -# multiple lines while the custom Warning subclass can't be matched -# specifically leading to a blanket ignore for all Warning types in package -# builds # multiple callers raise DeprecationWarning "Creating a LegacyVersion has been # deprecated and will be removed in the next major release" # SetupTools raises @@ -43,14 +36,9 @@ basepython = python3 # setuptools.config.pyprojecttoml._ExperimentalProjectMetadata "Support for # `[tool.setuptools]` in `pyproject.toml` is still *beta*." but the parent # Warning class has to be used instead -# pip._vendor.certifi.core and pip._vendor.pep517.in_process raise -# DeprecationWarning "path is deprecated. Use files() instead. Refer to -# https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy -# for migration advice." but this can't be matched by message because it -# contains a colon setenv = PYTHONWARNDFAULTENCODING = 1 - PYTHONWARNINGS = error, ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning, ignore:setup.py install is deprecated. Use build and pip and other standards-based tools., ignore:easy_install command is deprecated. Use build and pip and other standards-based tools., ignore::DeprecationWarning:pip._vendor.certifi.core, ignore::DeprecationWarning:pip._vendor.pep517.in_process, ignore:'crypt' is deprecated and slated for removal in Python 3.13:DeprecationWarning:passlib.utils, ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:mudpy.tests.selftest, ignore::Warning:setuptools.command.build_py, ignore:Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.:Warning:setuptools.config.pyprojecttoml + PYTHONWARNINGS = error, ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning, ignore:setup.py install is deprecated. Use build and pip and other standards-based tools., ignore:easy_install command is deprecated. Use build and pip and other standards-based tools., ignore:'crypt' is deprecated and slated for removal in Python 3.13:DeprecationWarning:passlib.utils, ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:mudpy.tests.selftest, ignore:Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.:Warning:setuptools.config.pyprojecttoml PYTHONUTF8 = 1 VIRTUALENV_CREATOR = venv commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml -- 2.11.0