Skip to contentSkip to conversation

python3-stopit: Fixed the deprecated pkg_resources issue

PATCH Superseded [email protected] 3 participants 6 messages Apr 3 – Apr 7

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python3-stopit: Fixed the deprecated pkg_resources issue

From: "Bai, Haiqing" <[email protected]>

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.

---
 ...01-Drop-the-deprecated-pkg_resources.patch | 38 +++++++++++++++++++
 .../python/python3-stopit_1.1.2.bb            |  6 ++-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch
meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch new file +38 -0
new file mode 100644
index 0000000000..4252386384
@@ -0,0 +1,38 @@
+From b72825c89724c2c3b4c9c60d90c9d4ad597eead0 Mon Sep 17 00:00:00 2001
+From: "Bai, Haiqing" <[email protected]>
+Date: Thu, 2 Apr 2026 08:40:26 +0000
+Subject: [PATCH] Drop the deprecated pkg_resources
+
+pkg_resources is deprecated as an API. The pkg_resources package
+is slated for removal, so the way of obtaining the version needs
+to be updated.
+
+Upstream-Status: Inactive-Upstream [lastcommit: Jan/2024 lastrelease: Feb/2018]
+
+Signed-off-by: Bai, Haiqing <[email protected]>
+---
+ src/stopit/__init__.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/stopit/__init__.py b/src/stopit/__init__.py
+index 6ca0180..5ddfa4a 100644
+--- a/src/stopit/__init__.py
++++ b/src/stopit/__init__.py
+@@ -7,7 +7,7 @@ stopit
+ Public resources from ``stopit``
+ """
+ 
+-import pkg_resources
++from importlib.metadata import version
+ 
+ from .utils import LOG, TimeoutException
+ from .threadstop import ThreadingTimeout, async_raise, threading_timeoutable
+@@ -15,7 +15,7 @@ from .signalstop import SignalTimeout, signal_timeoutable
+ 
+ # PEP 396 style version marker
+ try:
+-    __version__ = pkg_resources.get_distribution(__name__).version
++    __version__ = version(__name__)
+ except:
+     LOG.warning("Could not get the package version from pkg_resources")
+     __version__ = 'unknown'
meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb +5 -1
index a952722619..a83adffcd2 100644
@@ -2,7 +2,6 @@ SUMMARY = "Raise asynchronous exceptions in other threads, control the timeout o
 HOMEPAGE = "https://pypi.org/project/stopit/"
 SECTION = "devel/python"
 
-SRC_URI += " file://LICENSE "
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${UNPACKDIR}/LICENSE;md5=497c556f42b1355b64190da2f3d88f93"
 
@@ -10,6 +9,11 @@ SRC_URI[sha256sum] = "f7f39c583fd92027bd9d06127b259aee7a5b7945c1f1fa56263811e1e7
 
 inherit pypi setuptools3
 
+SRC_URI += "\
+    file://LICENSE \
+    file://0001-Drop-the-deprecated-pkg_resources.patch \
+"
+
 RDEPENDS:${PN} += "\
     python3-setuptools \
     "
Signature · 1 line
2.53.0
#1 lore raw
Quoted 71 lines · haiqing.bai via lists.openembedded.org

From: "Bai, Haiqing" <[email protected]>

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.

---
 ...01-Drop-the-deprecated-pkg_resources.patch | 38 +++++++++++++++++++
 .../python/python3-stopit_1.1.2.bb            |  6 ++-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch
meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch new file +38 -0
new file mode 100644
index 0000000000..4252386384
@@ -0,0 +1,38 @@
+From b72825c89724c2c3b4c9c60d90c9d4ad597eead0 Mon Sep 17 00:00:00 2001
+From: "Bai, Haiqing" <[email protected]>
+Date: Thu, 2 Apr 2026 08:40:26 +0000
+Subject: [PATCH] Drop the deprecated pkg_resources
+
+pkg_resources is deprecated as an API. The pkg_resources package
+is slated for removal, so the way of obtaining the version needs
+to be updated.
+
+Upstream-Status: Inactive-Upstream [lastcommit: Jan/2024 lastrelease: Feb/2018]
+
+Signed-off-by: Bai, Haiqing <[email protected]>
+---
+ src/stopit/__init__.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/stopit/__init__.py b/src/stopit/__init__.py
+index 6ca0180..5ddfa4a 100644
+--- a/src/stopit/__init__.py
++++ b/src/stopit/__init__.py
+@@ -7,7 +7,7 @@ stopit
+ Public resources from ``stopit``
+ """
+ 
+-import pkg_resources
++from importlib.metadata import version
+ 
+ from .utils import LOG, TimeoutException
+ from .threadstop import ThreadingTimeout, async_raise, threading_timeoutable
+@@ -15,7 +15,7 @@ from .signalstop import SignalTimeout, signal_timeoutable
+ 
+ # PEP 396 style version marker
+ try:
+-    __version__ = pkg_resources.get_distribution(__name__).version
++    __version__ = version(__name__)
+ except:
+     LOG.warning("Could not get the package version from pkg_resources")
+     __version__ = 'unknown'
meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb +0 -1
index a952722619..a83adffcd2 100644
@@ -2,7 +2,6 @@ SUMMARY = "Raise asynchronous exceptions in other threads, control the timeout o
 HOMEPAGE = "https://pypi.org/project/stopit/"
 SECTION = "devel/python"
 
-SRC_URI += " file://LICENSE "
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${UNPACKDIR}/LICENSE;md5=497c556f42b1355b64190da2f3d88f93"
 
@@ -10,6 +9,11 @@ SRC_URI[sha256sum] = "f7f39c583fd92027bd9d06127b259aee7a5b7945c1f1fa56263811e1e7
 

meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb SRC_URI[sha256sum] = "f7f39c583fd92027bd9d06127b259aee7a5b7945c1f1fa56263811e1e7 · line 19

Quoted 10 lines
meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb +5 -0
 inherit pypi setuptools3
 
+SRC_URI += "\
+    file://LICENSE \
+    file://0001-Drop-the-deprecated-pkg_resources.patch \
+"
+
 RDEPENDS:${PN} += "\
     python3-setuptools \
     "

After this patch, does it still have a runtime dependency on setuptools? I think maybe that was the only reason for pulling this in

#2 lore raw
Quoted 85 lines · Gyorgy Sarvari via lists.openembedded.org
Quoted 6 lines · haiqing.bai via lists.openembedded.org

From: "Bai, Haiqing" <[email protected]>

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.

Quoted 6 lines
---
 ...01-Drop-the-deprecated-pkg_resources.patch | 38 +++++++++++++++++++
 .../python/python3-stopit_1.1.2.bb            |  6 ++-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644

meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch

Quoted 2 lines

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

Quoted 4 lines

new file mode 100644
index 0000000000..4252386384
--- /dev/null
+++

b/meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch

meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch line 10

Quoted 11 lines
meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch new file +10 -0
@@ -0,0 +1,38 @@
+From b72825c89724c2c3b4c9c60d90c9d4ad597eead0 Mon Sep 17 00:00:00 2001
+From: "Bai, Haiqing" <[email protected]>
+Date: Thu, 2 Apr 2026 08:40:26 +0000
+Subject: [PATCH] Drop the deprecated pkg_resources
+
+pkg_resources is deprecated as an API. The pkg_resources package
+is slated for removal, so the way of obtaining the version needs
+to be updated.
+
+Upstream-Status: Inactive-Upstream [lastcommit: Jan/2024 lastrelease:

Feb/2018]

Quoted 9 lines
meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch new file +9 -0
+
+Signed-off-by: Bai, Haiqing <[email protected]>
+---
+ src/stopit/__init__.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/stopit/__init__.py b/src/stopit/__init__.py
+index 6ca0180..5ddfa4a 100644
+--- a/src/stopit/__init__.py

meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch

Quoted 10 lines
meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch new file +10 -0
++++ b/src/stopit/__init__.py
+@@ -7,7 +7,7 @@ stopit
+ Public resources from ``stopit``
+ """
+
+-import pkg_resources
++from importlib.metadata import version
+
+ from .utils import LOG, TimeoutException
+ from .threadstop import ThreadingTimeout, async_raise,

threading_timeoutable

Review line 30

Quoted 1 line
(quoted diff) +1 -0
+@@ -15,7 +15,7 @@ from .signalstop import SignalTimeout,

signal_timeoutable

Review

Quoted 9 lines
meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch new file +8 -0
+
+ # PEP 396 style version marker
+ try:
+-    __version__ = pkg_resources.get_distribution(__name__).version
++    __version__ = version(__name__)
+ except:
+     LOG.warning("Could not get the package version from pkg_resources")
+     __version__ = 'unknown'
(quoted diff) +0 -0

b/meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb

meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb SUMMARY = "Raise asynchronous exceptions in other

Quoted 4 lines

index a952722619..a83adffcd2 100644

meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb +0 -0
@@ -2,7 +2,6 @@ SUMMARY = "Raise asynchronous exceptions in other

threads, control the timeout o

meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb SUMMARY = "Raise asynchronous exceptions in other threads, control the timeout o

Quoted 6 lines
meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb +0 -1
 HOMEPAGE = "https://pypi.org/project/stopit/"
 SECTION = "devel/python"
 
-SRC_URI += " file://LICENSE "
 LICENSE = "MIT"
 LIC_FILES_CHKSUM =

"file://${UNPACKDIR}/LICENSE;md5=497c556f42b1355b64190da2f3d88f93"

meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb SRC_URI[sha256sum] =

Quoted 2 lines
meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb +0 -0
@@ -10,6 +9,11 @@ SRC_URI[sha256sum] =

"f7f39c583fd92027bd9d06127b259aee7a5b7945c1f1fa56263811e1e7

Quoted 3 lines
meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb +0 -0
 inherit pypi setuptools3
 
Quoted 14 lines

meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb SRC_URI[sha256sum] = "f7f39c583fd92027bd9d06127b259aee7a5b7945c1f1fa56263811e1e7 · line 19

Quoted 8 lines
meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb +5 -0
+SRC_URI += "\
+    file://LICENSE \
+    file://0001-Drop-the-deprecated-pkg_resources.patch \
+"
+
 RDEPENDS:${PN} += "\
     python3-setuptools \
     "

After this patch, does it still have a runtime dependency on setuptools? I think maybe that was the only reason for pulling this in

Good question. It was added with
https://git.openembedded.org/meta-openembedded/commit/?id=812f091414b34dbebe4a3990c9039cbaadc4dd71
to fix

ModuleNotFoundError: No module named 'pkg_resources'

on target. So perhaps it should be reverted now as well.

Please test it out and send a revert of the above commit as a followup.

Quoted 11 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#125980):
https://lists.openembedded.org/g/openembedded-devel/message/125980
Mute This Topic: https://lists.openembedded.org/mt/118646263/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

Thank you. I've added the revert patch to make it a complete fix in V2.

From: Khem Raj <[email protected]>
Sent: 2026年4月6日 13:13
To: [email protected]
Cc: Bai, Haiqing <[email protected]>; [email protected]
Subject: Re: [oe] [meta-python][PATCH] python3-stopit: Fixed the deprecated pkg_resources issue

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

On Fri, Apr 3, 2026 at 1:50 AM Gyorgy Sarvari via lists.openembedded.org<https://urldefense.com/v3/__http:/lists.openembedded.org__;!!AjveYdw8EvQ!d2gLeREj_OmGELQfCRf1U65RzDdNgkEZWDiW_Utm8sro4icb26a9lMN0GjvVaqdllJwTYQfZhuGI4ui6CHPLqw$> <[email protected]<mailto:[email protected]>> wrote:

Quoted 71 lines · haiqing.bai via lists.openembedded.org

From: "Bai, Haiqing" <[email protected]<mailto:[email protected]>>

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.

---
 ...01-Drop-the-deprecated-pkg_resources.patch | 38 +++++++++++++++++++
 .../python/python3-stopit_1.1.2.bb<https://urldefense.com/v3/__http:/python3-stopit_1.1.2.bb__;!!AjveYdw8EvQ!d2gLeREj_OmGELQfCRf1U65RzDdNgkEZWDiW_Utm8sro4icb26a9lMN0GjvVaqdllJwTYQfZhuGI4ugOsveIZA$>            |  6 ++-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch
meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-deprecated-pkg_resources.patch new file +38 -0
new file mode 100644
index 0000000000..4252386384
@@ -0,0 +1,38 @@
+From b72825c89724c2c3b4c9c60d90c9d4ad597eead0 Mon Sep 17 00:00:00 2001
+From: "Bai, Haiqing" <[email protected]<mailto:[email protected]>>
+Date: Thu, 2 Apr 2026 08:40:26 +0000
+Subject: [PATCH] Drop the deprecated pkg_resources
+
+pkg_resources is deprecated as an API. The pkg_resources package
+is slated for removal, so the way of obtaining the version needs
+to be updated.
+
+Upstream-Status: Inactive-Upstream [lastcommit: Jan/2024 lastrelease: Feb/2018]
+
+Signed-off-by: Bai, Haiqing <[email protected]<mailto:[email protected]>>
+---
+ src/stopit/__init__.py<https://urldefense.com/v3/__http:/__init__.py__;!!AjveYdw8EvQ!d2gLeREj_OmGELQfCRf1U65RzDdNgkEZWDiW_Utm8sro4icb26a9lMN0GjvVaqdllJwTYQfZhuGI4ugjutQnfg$> | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/stopit/__init__.py<https://urldefense.com/v3/__http:/__init__.py__;!!AjveYdw8EvQ!d2gLeREj_OmGELQfCRf1U65RzDdNgkEZWDiW_Utm8sro4icb26a9lMN0GjvVaqdllJwTYQfZhuGI4ugjutQnfg$> b/src/stopit/__init__.py<https://urldefense.com/v3/__http:/__init__.py__;!!AjveYdw8EvQ!d2gLeREj_OmGELQfCRf1U65RzDdNgkEZWDiW_Utm8sro4icb26a9lMN0GjvVaqdllJwTYQfZhuGI4ugjutQnfg$>
+index 6ca0180..5ddfa4a 100644
+--- a/src/stopit/__init__.py<https://urldefense.com/v3/__http:/__init__.py__;!!AjveYdw8EvQ!d2gLeREj_OmGELQfCRf1U65RzDdNgkEZWDiW_Utm8sro4icb26a9lMN0GjvVaqdllJwTYQfZhuGI4ugjutQnfg$>
++++ b/src/stopit/__init__.py<https://urldefense.com/v3/__http:/__init__.py__;!!AjveYdw8EvQ!d2gLeREj_OmGELQfCRf1U65RzDdNgkEZWDiW_Utm8sro4icb26a9lMN0GjvVaqdllJwTYQfZhuGI4ugjutQnfg$>
+@@ -7,7 +7,7 @@ stopit
+ Public resources from ``stopit``
+ """
+
+-import pkg_resources
++from importlib.metadata import version
+
+ from .utils import LOG, TimeoutException
+ from .threadstop import ThreadingTimeout, async_raise, threading_timeoutable
+@@ -15,7 +15,7 @@ from .signalstop import SignalTimeout, signal_timeoutable
+
+ # PEP 396 style version marker
+ try:
+-    __version__ = pkg_resources.get_distribution(__name__).version
++    __version__ = version(__name__)
+ except:
+     LOG.warning("Could not get the package version from pkg_resources")
+     __version__ = 'unknown'
meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb<https://urldefense.com/v3/__http:/python3-stopit_1.1.2.bb__;!!AjveYdw8EvQ!d2gLeREj_OmGELQfCRf1U65RzDdNgkEZWDiW_Utm8sro4icb26a9lMN0GjvVaqdllJwTYQfZhuGI4ugOsveIZA$> +0 -1
index a952722619..a83adffcd2 100644
@@ -2,7 +2,6 @@ SUMMARY = "Raise asynchronous exceptions in other threads, control the timeout o
 HOMEPAGE = "https://pypi.org/project/stopit/<https://urldefense.com/v3/__https:/pypi.org/project/stopit/__;!!AjveYdw8EvQ!d2gLeREj_OmGELQfCRf1U65RzDdNgkEZWDiW_Utm8sro4icb26a9lMN0GjvVaqdllJwTYQfZhuGI4ujXfMpcNg$>"
 SECTION = "devel/python"
 
-SRC_URI += " file://LICENSE "
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${UNPACKDIR}/LICENSE;md5=497c556f42b1355b64190da2f3d88f93"
 
@@ -10,6 +9,11 @@ SRC_URI[sha256sum] = "f7f39c583fd92027bd9d06127b259aee7a5b7945c1f1fa56263811e1e7
 

meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb<https://urldefense.com/v3/__http:/python3-stopit_1.1.2.bb__;!!AjveYdw8EvQ!d2gLeREj_OmGELQfCRf1U65RzDdNgkEZWDiW_Utm8sro4icb26a9lMN0GjvVaqdllJwTYQfZhuGI4ugOsveIZA$> SRC_URI[sha256sum] = "f7f39c583fd92027bd9d06127b259aee7a5b7945c1f1fa56263811e1e7 · line 19

Quoted 10 lines
meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb<https://urldefense.com/v3/__http:/python3-stopit_1.1.2.bb__;!!AjveYdw8EvQ!d2gLeREj_OmGELQfCRf1U65RzDdNgkEZWDiW_Utm8sro4icb26a9lMN0GjvVaqdllJwTYQfZhuGI4ugOsveIZA$> +5 -0
 inherit pypi setuptools3
 
+SRC_URI += "\
+    file://LICENSE \
+    file://0001-Drop-the-deprecated-pkg_resources.patch \
+"
+
 RDEPENDS:${PN} += "\
     python3-setuptools \
     "

After this patch, does it still have a runtime dependency on setuptools? I think maybe that was the only reason for pulling this in

Good question. It was added with
https://git.openembedded.org/meta-openembedded/commit/?id=812f091414b34dbebe4a3990c9039cbaadc4dd71<https://urldefense.com/v3/__https:/git.openembedded.org/meta-openembedded/commit/?id=812f091414b34dbebe4a3990c9039cbaadc4dd71__;!!AjveYdw8EvQ!d2gLeREj_OmGELQfCRf1U65RzDdNgkEZWDiW_Utm8sro4icb26a9lMN0GjvVaqdllJwTYQfZhuGI4uigXV3EMg$>
to fix

ModuleNotFoundError: No module named 'pkg_resources'

on target. So perhaps it should be reverted now as well.

Please test it out and send a revert of the above commit as a followup.

#4 lore raw
In reply to Gyorgy Sarvari

Good catch, thanks. I've sent a revert patch for this.

-----Original Message-----
From: Gyorgy Sarvari <[email protected]>
Sent: 2026年4月3日 16:51
To: Bai, Haiqing <[email protected]>; [email protected]
Subject: Re: [oe] [meta-python][PATCH] python3-stopit: Fixed the deprecated pkg_resources issue

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Quoted 84 lines · haiqing.bai via lists.openembedded.org

From: "Bai, Haiqing" <[email protected]>

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.

---
 ...01-Drop-the-deprecated-pkg_resources.patch | 38 +++++++++++++++++++
 .../python/python3-stopit_1.1.2.bb            |  6 ++-
 2 files changed, 43 insertions(+), 1 deletion(-)  create mode 100644 

meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-depre cated-pkg_resources.patch

(quoted diff) +0 -0

a/meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-dep recated-pkg_resources.patch b/meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-dep recated-pkg_resources.patch
new file mode 100644
index 0000000000..4252386384

meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the new file +41 -0
+++ -deprecated-pkg_resources.patch
@@ -0,0 +1,38 @@
+From b72825c89724c2c3b4c9c60d90c9d4ad597eead0 Mon Sep 17 00:00:00 
+2001
+From: "Bai, Haiqing" <[email protected]>
+Date: Thu, 2 Apr 2026 08:40:26 +0000
+Subject: [PATCH] Drop the deprecated pkg_resources
+
+pkg_resources is deprecated as an API. The pkg_resources package is 
+slated for removal, so the way of obtaining the version needs to be 
+updated.
+
+Upstream-Status: Inactive-Upstream [lastcommit: Jan/2024 lastrelease: 
+Feb/2018]
+
+Signed-off-by: Bai, Haiqing <[email protected]>
+---
+ src/stopit/__init__.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/stopit/__init__.py b/src/stopit/__init__.py index 
+6ca0180..5ddfa4a 100644
+--- a/src/stopit/__init__.py
++++ b/src/stopit/__init__.py
+@@ -7,7 +7,7 @@ stopit
+ Public resources from ``stopit``
+ """
+
+-import pkg_resources
++from importlib.metadata import version
+
+ from .utils import LOG, TimeoutException  from .threadstop import 
+ThreadingTimeout, async_raise, threading_timeoutable @@ -15,7 +15,7 
+@@ from .signalstop import SignalTimeout, signal_timeoutable
+
+ # PEP 396 style version marker
+ try:
+-    __version__ = pkg_resources.get_distribution(__name__).version
++    __version__ = version(__name__)
+ except:
+     LOG.warning("Could not get the package version from pkg_resources")
+     __version__ = 'unknown'
(quoted diff) +0 -0

a/meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb b/meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb index a952722619..a83adffcd2 100644

meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb +0 -0
@@ -2,7 +2,6 @@ SUMMARY = "Raise asynchronous exceptions in other 

threads, control the timeout o HOMEPAGE = "https://pypi.org/project/stopit/"
SECTION = "devel/python"

meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb +0 -1
-SRC_URI += " file://LICENSE "
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${UNPACKDIR}/LICENSE;md5=497c556f42b1355b64190da2f3d88f93"
@@ -10,6 +9,11 @@ SRC_URI[sha256sum] = 

"f7f39c583fd92027bd9d06127b259aee7a5b7945c1f1fa56263811e1e7

inherit pypi setuptools3

meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb SRC_URI[sha256sum] = "f7f39c583fd92027bd9d06127b259aee7a5b7945c1f1fa56263811e1e7 · line 19

Quoted 7 lines
meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb +4 -0
+SRC_URI += "\
+    file://LICENSE \
+    file://0001-Drop-the-deprecated-pkg_resources.patch \ "
+
 RDEPENDS:${PN} += "\
     python3-setuptools \
     "

After this patch, does it still have a runtime dependency on setuptools? I think maybe that was the only reason for pulling this in

#5 lore raw
In reply to Gyorgy Sarvari

Good catch, thanks. I've sent a revert patch for this.

-----Original Message-----
From: Gyorgy Sarvari <[email protected]>
Sent: 2026年4月3日 16:51
To: Bai, Haiqing <[email protected]>; [email protected]
Subject: Re: [oe] [meta-python][PATCH] python3-stopit: Fixed the deprecated pkg_resources issue

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Quoted 84 lines · haiqing.bai via lists.openembedded.org

From: "Bai, Haiqing" <[email protected]>

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.

---
 ...01-Drop-the-deprecated-pkg_resources.patch | 38 +++++++++++++++++++
 .../python/python3-stopit_1.1.2.bb            |  6 ++-
 2 files changed, 43 insertions(+), 1 deletion(-)  create mode 100644 

meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-depre cated-pkg_resources.patch

(quoted diff) +0 -0

a/meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-dep recated-pkg_resources.patch b/meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the-dep recated-pkg_resources.patch
new file mode 100644
index 0000000000..4252386384

meta-python/recipes-devtools/python/python3-stopit/0001-Drop-the new file +41 -0
+++ -deprecated-pkg_resources.patch
@@ -0,0 +1,38 @@
+From b72825c89724c2c3b4c9c60d90c9d4ad597eead0 Mon Sep 17 00:00:00 
+2001
+From: "Bai, Haiqing" <[email protected]>
+Date: Thu, 2 Apr 2026 08:40:26 +0000
+Subject: [PATCH] Drop the deprecated pkg_resources
+
+pkg_resources is deprecated as an API. The pkg_resources package is 
+slated for removal, so the way of obtaining the version needs to be 
+updated.
+
+Upstream-Status: Inactive-Upstream [lastcommit: Jan/2024 lastrelease: 
+Feb/2018]
+
+Signed-off-by: Bai, Haiqing <[email protected]>
+---
+ src/stopit/__init__.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/stopit/__init__.py b/src/stopit/__init__.py index 
+6ca0180..5ddfa4a 100644
+--- a/src/stopit/__init__.py
++++ b/src/stopit/__init__.py
+@@ -7,7 +7,7 @@ stopit
+ Public resources from ``stopit``
+ """
+
+-import pkg_resources
++from importlib.metadata import version
+
+ from .utils import LOG, TimeoutException  from .threadstop import 
+ThreadingTimeout, async_raise, threading_timeoutable @@ -15,7 +15,7 
+@@ from .signalstop import SignalTimeout, signal_timeoutable
+
+ # PEP 396 style version marker
+ try:
+-    __version__ = pkg_resources.get_distribution(__name__).version
++    __version__ = version(__name__)
+ except:
+     LOG.warning("Could not get the package version from pkg_resources")
+     __version__ = 'unknown'
(quoted diff) +0 -0

a/meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb b/meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb index a952722619..a83adffcd2 100644

meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb +0 -0
@@ -2,7 +2,6 @@ SUMMARY = "Raise asynchronous exceptions in other 

threads, control the timeout o HOMEPAGE = "https://pypi.org/project/stopit/"
SECTION = "devel/python"

meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb +0 -1
-SRC_URI += " file://LICENSE "
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${UNPACKDIR}/LICENSE;md5=497c556f42b1355b64190da2f3d88f93"
@@ -10,6 +9,11 @@ SRC_URI[sha256sum] = 

"f7f39c583fd92027bd9d06127b259aee7a5b7945c1f1fa56263811e1e7

inherit pypi setuptools3

meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb SRC_URI[sha256sum] = "f7f39c583fd92027bd9d06127b259aee7a5b7945c1f1fa56263811e1e7 · line 19

Quoted 7 lines
meta-python/recipes-devtools/python/python3-stopit_1.1.2.bb +4 -0
+SRC_URI += "\
+    file://LICENSE \
+    file://0001-Drop-the-deprecated-pkg_resources.patch \ "
+
 RDEPENDS:${PN} += "\
     python3-setuptools \
     "

After this patch, does it still have a runtime dependency on setuptools? I think maybe that was the only reason for pulling this in