From 0076d30af100ed827f6f6d231257de304f91c55d Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Mon, 5 Jul 2021 13:03:44 +0000 Subject: [PATCH] Use build instead of setup.py Start transitioning into the PEP517 future of Python packaging by switching from explicitly calling setup.py to using the build module. Move install requirements into setup.cfg and update the install docs to refer to the new location. Get rid of the separate documentation build requirements file by moving into tox.ini deps for the docs testenv. While we're there, add some commentary in the tox.ini about some of the more opaque choices we've made for docs builds and testing YAML style. --- doc/requirements.txt | 5 ----- doc/source/install.rst | 14 +++++++------- requirements.txt | 6 ------ setup.cfg | 3 +++ tox.ini | 20 ++++++++++++-------- 5 files changed, 22 insertions(+), 26 deletions(-) delete mode 100644 doc/requirements.txt delete mode 100644 requirements.txt diff --git a/doc/requirements.txt b/doc/requirements.txt deleted file mode 100644 index e13feea..0000000 --- a/doc/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2018 mudpy authors. Permission to use, copy, -# modify, and distribute this software is granted under terms -# provided in the LICENSE file distributed with this software. - -sphinx diff --git a/doc/source/install.rst b/doc/source/install.rst index c3c93e8..016fd50 100644 --- a/doc/source/install.rst +++ b/doc/source/install.rst @@ -2,7 +2,7 @@ install guide =============== -.. Copyright (c) 2020 mudpy authors. Permission to use, copy, +.. Copyright (c) 2020-2021 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,12 +63,12 @@ administrative privileges, configurable in the `admins limit Using ``pip`` to install in a venv or with its ``--user`` option takes care of making sure the Python package dependencies listed in -the :file:`requirements.txt` file are available, but it should be -possible to run :file:`mudpy/daemon.py` as a normal python3 script -as long as you've installed your distro's packages of the -dependencies (on Debian/Ubuntu that's python3-passlib_ and -python3-yaml_, they're probably named something similar on other -distros). +the ``options.install_requires`` field of the :file:`setup.cfg` file +are available, but it should be possible to run +:file:`mudpy/daemon.py` as a normal python3 script as long as you've +installed your distro's packages of the dependencies (on +Debian/Ubuntu that's python3-passlib_ and python3-yaml_, they're +probably named something similar on other distros). .. _python3-passlib: https://packages.debian.org/python3-passlib .. _python3-yaml: https://packages.debian.org/python3-yaml diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index fc14974..0000000 --- a/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2014-2019 mudpy authors. Permission to use, copy, -# modify, and distribute this software is granted under terms -# provided in the LICENSE file distributed with this software. - -passlib>=1.7 -pyyaml diff --git a/setup.cfg b/setup.cfg index 9a70b8a..8736681 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,6 +45,9 @@ classifiers = Topic :: Internet [options] +install_requires = + passlib>=1.7 + pyyaml python_requires = >=3.6 [files] diff --git a/tox.ini b/tox.ini index 1979c04..c9d79fd 100644 --- a/tox.ini +++ b/tox.ini @@ -53,26 +53,27 @@ commands = mudpy {posargs} description = build release artifacts and check for conformance allowlist_externals = rm deps = - pbr + build twine - wheel commands = rm -fr {toxinidir}/dist - python setup.py bdist_wheel sdist + python -m build twine check --strict {toxinidir}/dist/* usedevelop = False [testenv:docs] +# Build an sdist into a temporary location so we'll have AUTHORS and ChangeLog +# files to include. Keep usedevelop on so that the project dependencies will be +# installed in the venv. description = generate hypertext documentation allowlist_externals = rm deps = - -r{toxinidir}/requirements.txt - -r{toxinidir}/doc/requirements.txt + build + sphinx commands = - rm -fr doc/build - python setup.py sdist + rm -fr {toxinidir}/doc/build + python -m build --outdir={toxinidir}/doc/build/dist --sdist sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html -usedevelop = False [testenv:flake8] description = style checks and static analysis of source code @@ -87,6 +88,9 @@ description = run the selftest with the included sample config commands = mudpy_selftest etc/mudpy.yaml [testenv:yamllint] +# Run the selftest before checking YAML files so we'll be sure to also catch at +# least some which are generated by the application, making sure it creates +# them with the same style we enforce for those carried in the repository. description = test data files for correct syntax and formatting deps = yamllint commands = -- 2.11.0