diff --git a/docs/conf.py b/docs/conf.py index 392bde96..bb1b1f51 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,11 @@ # sys.path.append(os.path.abspath('some/directory')) import datetime -import pkg_resources + +try: + from importlib.metadata import version as metadata_version +except ImportError: + from importlib_metadata import version as metadata_version import pylons_sphinx_themes # General configuration @@ -53,7 +57,7 @@ # other places throughout the built documents. # # The short X.Y version. -version = pkg_resources.get_distribution("waitress").version +version = metadata_version("waitress") # The full version, including alpha/beta/rc tags. release = version diff --git a/setup.cfg b/setup.cfg index 672ef9d6..65625dce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -58,6 +58,7 @@ docs = Sphinx>=1.8.1 docutils pylons-sphinx-themes>=1.0.9 + importlib-metadata; python_version < "3.8" [tool:pytest] python_files = test_*.py