From: Jeremy Stanley Date: Sat, 15 Oct 2022 17:33:14 +0000 (+0000) Subject: Drop deprecation filters for pip and yamllint X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=commitdiff_plain;h=HEAD;hp=7dc10476791b9e639d98d54ca697aaa6565fbc10 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. --- 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 diff --git a/LICENSE b/LICENSE index 54ec971..4b8d86e 100644 --- a/LICENSE +++ b/LICENSE @@ -10,7 +10,7 @@ preferred license of many projects (OpenBSD, for example). copyright notice ---------------- -Copyright (c) 2004-2021 Jeremy Stanley and other +Copyright (c) 2004-2022 Jeremy Stanley and other mudpy authors listed in the Git history or AUTHORS file. permission notice diff --git a/mudpy/__init__.py b/mudpy/__init__.py index f9e00b8..216d03d 100644 --- a/mudpy/__init__.py +++ b/mudpy/__init__.py @@ -1,6 +1,6 @@ """Core modules package for the mudpy engine.""" -# Copyright (c) 2004-2019 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. @@ -12,40 +12,19 @@ import mudpy def load(): """Import/reload some modules (be careful, as this can result in loops).""" - # hard-coded fallback list of modules expected in this package - # TODO(fungi) remove this once Python 3.6 is no longer supported - fallback_modules = [ - "command", - "daemon", - "data", - "menu", - "misc", - "password", - "telnet", - "version", - ] - try: - # dynamically build module list from package contents (this only works - # in Python 3.7 and later, hence the try/except) - modules = [] - for module in mudpy.__loader__.contents(): - - if ( - # make sure it's a module file, not a directory - module.endswith('.py') - - # don't include this file, we're inside it - and module != '__init__.py'): - - # trim off the .py file extension - modules.append(module[:-3]) - - # make sure the fallback list is kept up to date with package contents - if fallback_modules != sorted(modules): - raise Exception("Fallback module list is incomplete") - - except AttributeError: - modules = fallback_modules + # dynamically build module list from package contents + modules = [] + for module in mudpy.__spec__.loader.get_resource_reader().contents(): + + if ( + # make sure it's a module file, not a directory + module.endswith('.py') + + # don't include this file, we're inside it + and module != '__init__.py'): + + # trim off the .py file extension + modules.append(module[:-3]) # iterate over the list of module files included in the package for module in modules: 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/mudpy/data.py b/mudpy/data.py index eeea8fb..b45cd67 100644 --- a/mudpy/data.py +++ b/mudpy/data.py @@ -1,6 +1,6 @@ """Data interface functions for the mudpy engine.""" -# Copyright (c) 2004-2021 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. @@ -63,7 +63,8 @@ class Data: except FileNotFoundError: # it's normal if the file is one which doesn't exist yet self.data = {} - log_entry = ("File %s is unavailable." % self.source, 6) + log_entry = ( + "File %s was not found and will be created." % self.source, 6) try: mudpy.misc.log(*log_entry) except NameError: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e03fc14 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,56 @@ +# Copyright (c) 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. + +[build-system] +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 54c899d..f6b4429 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,58 +1,6 @@ -# Copyright (c) 2016-2021 mudpy authors. Permission to use, copy, +# Copyright (c) 2016-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. [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.6 - 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.6 - -[files] -packages = - mudpy - -[entry_points] -console_scripts = - mudpy = mudpy.daemon:main - mudpy_selftest = mudpy.tests.selftest:main diff --git a/setup.py b/setup.py index 0ee8be3..d404fc1 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ -# Copyright (c) 2016-2019 mudpy authors. Permission to use, copy, +# Copyright (c) 2016-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. import setuptools -setuptools.setup(setup_requires=['pbr>=5'], pbr=True) +setuptools.setup(pbr=True) 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. diff --git a/tox.ini b/tox.ini index b6b1917..33c4fb9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2021 mudpy authors. Permission to use, copy, +# Copyright (c) 2016-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. @@ -13,17 +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 -# 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." -# 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" +# 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" # multiple callers raise DeprecationWarning "Creating a LegacyVersion has been # deprecated and will be removed in the next major release" # SetupTools raises @@ -39,26 +32,28 @@ 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 -# filelock raises DeprecationWarning "use poll_interval instead of -# poll_intervall" -# 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 +# setuptools.config.pyprojecttoml raises +# setuptools.config.pyprojecttoml._ExperimentalProjectMetadata "Support for +# `[tool.setuptools]` in `pyproject.toml` is still *beta*." but the parent +# Warning class has to be used instead setenv = - 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:use poll_interval instead of poll_intervall:DeprecationWarning, ignore::DeprecationWarning:pip._vendor.certifi.core, ignore::DeprecationWarning:pip._vendor.pep517.in_process + 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:'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 +download = true 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} @@ -68,34 +63,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] @@ -108,7 +101,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