Skip to content

Commit

Permalink
Merge pull request #398 from Pylons/replace-pkg_resources-importlib-m…
Browse files Browse the repository at this point in the history
…etadata

Replace pkg_resources use with importlib.metadata
  • Loading branch information
digitalresistor authored Jan 23, 2023
2 parents 56e44fe + 95a780c commit 1b36401
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1b36401

Please # to comment.