diff options
| author | Bai, Haiqing <Haiqing.Bai@windriver.com> | 2026-04-03 03:38:41 +0000 |
|---|---|---|
| committer | Khem Raj <khem.raj@oss.qualcomm.com> | 2026-04-03 01:05:45 -0700 |
| commit | dab9004db6063ad3ad16b94a91f5e47fbde8db45 (patch) | |
| tree | 3c655a4ee8ab84dcfaaa7fc7cb7b470c45e7a5b5 /meta-python/recipes-devtools/python/python3-stopit | |
| parent | 584fec0f74ad7c3ebe3bc5794be93382d4d386eb (diff) | |
| download | meta-openembedded-dab9004db6063ad3ad16b94a91f5e47fbde8db45.tar.gz | |
python3-stopit: Fixed the deprecated pkg_resources issue
pkg_resources is deprecated as an API. The pkg_resources package
has been removed from setuptools, so the way of obtaining the
version needs to be replaced with importlib.metadata module.
Signed-off-by: Bai, Haiqing <Haiqing.Bai@windriver.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-stopit')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch b/meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch new file mode 100644 index 0000000000..4252386384 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | From b72825c89724c2c3b4c9c60d90c9d4ad597eead0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "Bai, Haiqing" <Haiqing.Bai@windriver.com> | ||
| 3 | Date: Thu, 2 Apr 2026 08:40:26 +0000 | ||
| 4 | Subject: [PATCH] Drop the deprecated pkg_resources | ||
| 5 | |||
| 6 | pkg_resources is deprecated as an API. The pkg_resources package | ||
| 7 | is slated for removal, so the way of obtaining the version needs | ||
| 8 | to be updated. | ||
| 9 | |||
| 10 | Upstream-Status: Inactive-Upstream [lastcommit: Jan/2024 lastrelease: Feb/2018] | ||
| 11 | |||
| 12 | Signed-off-by: Bai, Haiqing <Haiqing.Bai@windriver.com> | ||
| 13 | --- | ||
| 14 | src/stopit/__init__.py | 4 ++-- | ||
| 15 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/src/stopit/__init__.py b/src/stopit/__init__.py | ||
| 18 | index 6ca0180..5ddfa4a 100644 | ||
| 19 | --- a/src/stopit/__init__.py | ||
| 20 | +++ b/src/stopit/__init__.py | ||
| 21 | @@ -7,7 +7,7 @@ stopit | ||
| 22 | Public resources from ``stopit`` | ||
| 23 | """ | ||
| 24 | |||
| 25 | -import pkg_resources | ||
| 26 | +from importlib.metadata import version | ||
| 27 | |||
| 28 | from .utils import LOG, TimeoutException | ||
| 29 | from .threadstop import ThreadingTimeout, async_raise, threading_timeoutable | ||
| 30 | @@ -15,7 +15,7 @@ from .signalstop import SignalTimeout, signal_timeoutable | ||
| 31 | |||
| 32 | # PEP 396 style version marker | ||
| 33 | try: | ||
| 34 | - __version__ = pkg_resources.get_distribution(__name__).version | ||
| 35 | + __version__ = version(__name__) | ||
| 36 | except: | ||
| 37 | LOG.warning("Could not get the package version from pkg_resources") | ||
| 38 | __version__ = 'unknown' | ||
