From 785a4d8569e9533b4014eef6ff1c957bb467b5a2 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Mon, 3 Mar 2025 17:43:41 +0100 Subject: [PATCH 1/3] chore: drop pkg_resources usage --- docs/conf.py | 4 ++-- src/zope/testrunner/options.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 0174ab1..072d0e5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,11 +15,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..dda2ca7 100644 --- a/src/zope/testrunner/options.py +++ b/src/zope/testrunner/options.py @@ -19,7 +19,7 @@ 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 +611,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) From f4a650df5c0cef8ffaa8343633f343ae7c3b02b4 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Mon, 3 Mar 2025 17:44:08 +0100 Subject: [PATCH 2/3] Update CHANGES --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From f7bb461693b1e9cdbb68ea47a78e7c4be81763d8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 16:46:00 +0000 Subject: [PATCH 3/3] Apply pre-commit code formatting --- docs/conf.py | 1 - src/zope/testrunner/options.py | 1 - 2 files changed, 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 072d0e5..13148c9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,7 +14,6 @@ import os import sys - from importlib.metadata import distribution diff --git a/src/zope/testrunner/options.py b/src/zope/testrunner/options.py index dda2ca7..2aea5a0 100644 --- a/src/zope/testrunner/options.py +++ b/src/zope/testrunner/options.py @@ -18,7 +18,6 @@ import os import re import sys - from importlib.metadata import distribution from zope.testrunner.formatter import ColorfulOutputFormatter