diff --git a/CHANGES.rst b/CHANGES.rst index c61591e..3ce3852 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,7 @@ 7.1 (unreleased) ================ -- Nothing changed yet. +- Replace `pkg_resources` with `importlib.metadata` 7.0 (2025-02-12) diff --git a/docs/conf.py b/docs/conf.py index 0174ab1..13148c9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,12 +14,11 @@ import os import sys - -import pkg_resources +from importlib.metadata import distribution sys.path.append(os.path.abspath('../src')) -rqmt = pkg_resources.require('zope.testrunner')[0] +rqmt = distribution('zope.testrunner') # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the diff --git a/src/zope/testrunner/options.py b/src/zope/testrunner/options.py index 42af6cc..2aea5a0 100644 --- a/src/zope/testrunner/options.py +++ b/src/zope/testrunner/options.py @@ -18,8 +18,7 @@ import os import re import sys - -import pkg_resources +from importlib.metadata import distribution from zope.testrunner.formatter import ColorfulOutputFormatter from zope.testrunner.formatter import OutputFormatter @@ -611,7 +610,7 @@ def apply_auto_progress(args): options.original_testrunner_args = args if options.showversion: - dist = pkg_resources.require('zope.testrunner')[0] + dist = distribution('zope.testrunner') print('zope.testrunner version %s' % dist.version) sys.exit(0)