Skip to contentSkip to conversation

python3-setproctitle: Add new recipe

PATCH In review [email protected] 2 participants 3 messages Sep 29, 2024 – Oct 17, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python3-setproctitle: Add new recipe

From: Mingli Yu <[email protected]>

A Python module to customize the process title.

 # ./run-ptest
PASS: tests/module_test.py::test_no_import_side_effect
PASS: tests/module_test.py::test_version
PASS: tests/module_test.py::test_c_extension_built
PASS: tests/setproctitle_test.py::test_runner
PASS: tests/setproctitle_test.py::test_init_getproctitle
PASS: tests/setproctitle_test.py::test_setproctitle
tests/setproctitle_test.py::test_setproctitle_darwin SKIPPED (Mac on...)
PASS: tests/setproctitle_test.py::test_prctl
PASS: tests/setproctitle_test.py::test_getproctitle
PASS: tests/setproctitle_test.py::test_kwarg
PASS: tests/setproctitle_test.py::test_environ
PASS: tests/setproctitle_test.py::test_issue_8
PASS: tests/setproctitle_test.py::test_large_cmdline
PASS: tests/setproctitle_test.py::test_weird_args
PASS: tests/setproctitle_test.py::test_weird_path
PASS: tests/setproctitle_test.py::test_embedded
PASS: tests/setproctitle_test.py::test_embedded_many_args
PASS: tests/setproctitle_test.py::test_noenv
PASS: tests/setproctitle_test.py::test_large_env
PASS: tests/setproctitle_test.py::test_clear_segfault
PASS: tests/setproctitle_test.py::test_fork_segfault
PASS: tests/setproctitle_test.py::test_thread_fork_segfault
PASS: tests/setthreadtitle_test.py::test_thread_title_unchanged
PASS: tests/setthreadtitle_test.py::test_set_thread_title
PASS: tests/setthreadtitle_test.py::test_set_threads_title
---
 ...0001-conftest.py-Make-embed-avaiable.patch | 45 +++++++++++++++++++
 .../python/python3-setproctitle/run-ptest     |  4 ++
 .../python/python3-setproctitle_1.3.3.bb      | 34 ++++++++++++++
 3 files changed, 83 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-setproctitle/0001-conftest.py-Make-embed-avaiable.patch
 create mode 100644 meta-python/recipes-devtools/python/python3-setproctitle/run-ptest
 create mode 100644 meta-python/recipes-devtools/python/python3-setproctitle_1.3.3.bb
meta-python/recipes-devtools/python/python3-setproctitle/0001-conftest.py-Make-embed-avaiable.patch new file +45 -0
new file mode 100644
index 000000000..5de07de03
@@ -0,0 +1,45 @@
+From ce7430f6252ce69af0699dc376662b5b1dc00b96 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <[email protected]>
+Date: Fri, 27 Sep 2024 10:56:32 +0000
+Subject: [PATCH] conftest.py: Make --embed avaiable
+
+Though --embed exists in the help message as below.
+ $ /usr/bin/python3.10-config --help
+ Usage: /usr/bin/python3.10-config [--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed
+
+ # https://github.com/dvarrazzo/py-setproctitle/issues/142
+ But has_embed which indicates if the help includes "--embed"
+ provides a wrong check as beow.
+ >>> import subprocess
+ >>> subprocess.check_output(["/usr/bin/python3.10-config", "--help"])
+Usage: /usr/bin/python3.10-config [--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed]
+ b''
+ >>> help = subprocess.check_output(["/usr/bin/python3.10-config", "--help"])
+ >>> has_embed = b"--embed" in help
+
+So make sure --embed avaiable to fix the gap.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Mingli Yu <[email protected]>
+---
+ tests/conftest.py | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/tests/conftest.py b/tests/conftest.py
+index 6e15988..b01e2bd 100644
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -84,8 +84,7 @@ def pyconfig():
+ 
+     def pyconfig_func(opt):
+         cmdline = [pyconfexe, f"--{opt}"]
+-        if has_embed:
+-            cmdline.append("--embed")
++        cmdline.append("--embed")
+         bout = sp.check_output(cmdline)
+         out = bout.decode(
+             sys.getfilesystemencoding()  # sounds like a good bet
+-- 
+2.35.5
+
meta-python/recipes-devtools/python/python3-setproctitle/run-ptest new file +4 -0
new file mode 100644
index 000000000..8bedb66d4
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# https://github.com/dvarrazzo/py-setproctitle/issues/141
+pytest -k 'not test_unicode' -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta-python/recipes-devtools/python/python3-setproctitle_1.3.3.bb new file +34 -0
new file mode 100644
index 000000000..01e9d21cd
@@ -0,0 +1,34 @@
+SUMMARY = "A Python module to customize the process title"
+DESCRIPTION = "The setproctitle module allows a process to change its \
+title (as displayed by system tools such as ps, top or MacOS Activity \
+Monitor)."
+HOMEPAGE = "https://github.com/dvarrazzo/py-setproctitle"
+BUGTRACKER = "https://github.com/dvarrazzo/py-setproctitle/issues"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=86d2d41b5f4f023f43466f8cb7adebaa"
+
+inherit pypi setuptools3 ptest
+
+SRC_URI[sha256sum] = "c913e151e7ea01567837ff037a23ca8740192880198b7fbb90b16d181607caae"
+
+SRC_URI += " \
+    file://0001-conftest.py-Make-embed-avaiable.patch \
+    file://run-ptest \
+"
+
+RDEPENDS:${PN}-ptest += "\
+    packagegroup-core-buildessential \
+    procps-ps \
+    python3-dev \
+    python3-multiprocessing \
+    ${PYTHON_PN}-pytest \
+"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
+INSANE_SKIP:${PN}-ptest = "dev-deps"
Signature · 1 line
2.34.1
#1 lore raw
Quoted 3 lines · Mingli via lists.openembedded.org

From: Mingli Yu <[email protected]>

A Python module to customize the process title.

Adding new recipes to a stable branch is outside the policy. Is there a reason I should?

BR,
Armin

Quoted 147 lines
  # ./run-ptest
PASS: tests/module_test.py::test_no_import_side_effect
PASS: tests/module_test.py::test_version
PASS: tests/module_test.py::test_c_extension_built
PASS: tests/setproctitle_test.py::test_runner
PASS: tests/setproctitle_test.py::test_init_getproctitle
PASS: tests/setproctitle_test.py::test_setproctitle
tests/setproctitle_test.py::test_setproctitle_darwin SKIPPED (Mac on...)
PASS: tests/setproctitle_test.py::test_prctl
PASS: tests/setproctitle_test.py::test_getproctitle
PASS: tests/setproctitle_test.py::test_kwarg
PASS: tests/setproctitle_test.py::test_environ
PASS: tests/setproctitle_test.py::test_issue_8
PASS: tests/setproctitle_test.py::test_large_cmdline
PASS: tests/setproctitle_test.py::test_weird_args
PASS: tests/setproctitle_test.py::test_weird_path
PASS: tests/setproctitle_test.py::test_embedded
PASS: tests/setproctitle_test.py::test_embedded_many_args
PASS: tests/setproctitle_test.py::test_noenv
PASS: tests/setproctitle_test.py::test_large_env
PASS: tests/setproctitle_test.py::test_clear_segfault
PASS: tests/setproctitle_test.py::test_fork_segfault
PASS: tests/setproctitle_test.py::test_thread_fork_segfault
PASS: tests/setthreadtitle_test.py::test_thread_title_unchanged
PASS: tests/setthreadtitle_test.py::test_set_thread_title
PASS: tests/setthreadtitle_test.py::test_set_threads_title
---
  ...0001-conftest.py-Make-embed-avaiable.patch | 45 +++++++++++++++++++
  .../python/python3-setproctitle/run-ptest     |  4 ++
  .../python/python3-setproctitle_1.3.3.bb      | 34 ++++++++++++++
  3 files changed, 83 insertions(+)

create mode 100644 meta-python/recipes-devtools/python/python3-setproctitle/0001-conftest.py-Make-embed-avaiable.patch create mode 100644 meta-python/recipes-devtools/python/python3-setproctitle/run-ptest
create mode 100644 meta-python/recipes-devtools/python/python3-setproctitle_1.3.3.bb

meta-python/recipes-devtools/python/python3-setproctitle/0001-conftest.py-Make-embed-avaiable.patch new file +45 -0
new file mode 100644
index 000000000..5de07de03
@@ -0,0 +1,45 @@
+From ce7430f6252ce69af0699dc376662b5b1dc00b96 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <[email protected]>
+Date: Fri, 27 Sep 2024 10:56:32 +0000
+Subject: [PATCH] conftest.py: Make --embed avaiable
+
+Though --embed exists in the help message as below.
+ $ /usr/bin/python3.10-config --help
+ Usage: /usr/bin/python3.10-config [--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed
+
+ # https://github.com/dvarrazzo/py-setproctitle/issues/142
+ But has_embed which indicates if the help includes "--embed"
+ provides a wrong check as beow.
+ >>> import subprocess
+ >>> subprocess.check_output(["/usr/bin/python3.10-config", "--help"])
+Usage: /usr/bin/python3.10-config [--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed]
+ b''
+ >>> help = subprocess.check_output(["/usr/bin/python3.10-config", "--help"])
+ >>> has_embed = b"--embed" in help
+
+So make sure --embed avaiable to fix the gap.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Mingli Yu <[email protected]>
+---
+ tests/conftest.py | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/tests/conftest.py b/tests/conftest.py
+index 6e15988..b01e2bd 100644
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -84,8 +84,7 @@ def pyconfig():
+
+     def pyconfig_func(opt):
+         cmdline = [pyconfexe, f"--{opt}"]
+-        if has_embed:
+-            cmdline.append("--embed")
++        cmdline.append("--embed")
+         bout = sp.check_output(cmdline)
+         out = bout.decode(
+             sys.getfilesystemencoding()  # sounds like a good bet
+--
+2.35.5
+
meta-python/recipes-devtools/python/python3-setproctitle/run-ptest new file +4 -0
new file mode 100644
index 000000000..8bedb66d4
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# https://github.com/dvarrazzo/py-setproctitle/issues/141
+pytest -k 'not test_unicode' -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta-python/recipes-devtools/python/python3-setproctitle_1.3.3.bb new file +34 -1
new file mode 100644
index 000000000..01e9d21cd
@@ -0,0 +1,34 @@
+SUMMARY = "A Python module to customize the process title"
+DESCRIPTION = "The setproctitle module allows a process to change its \
+title (as displayed by system tools such as ps, top or MacOS Activity \
+Monitor)."
+HOMEPAGE = "https://github.com/dvarrazzo/py-setproctitle"
+BUGTRACKER = "https://github.com/dvarrazzo/py-setproctitle/issues"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=86d2d41b5f4f023f43466f8cb7adebaa"
+
+inherit pypi setuptools3 ptest
+
+SRC_URI[sha256sum] = "c913e151e7ea01567837ff037a23ca8740192880198b7fbb90b16d181607caae"
+
+SRC_URI += " \
+    file://0001-conftest.py-Make-embed-avaiable.patch \
+    file://run-ptest \
+"
+
+RDEPENDS:${PN}-ptest += "\
+    packagegroup-core-buildessential \
+    procps-ps \
+    python3-dev \
+    python3-multiprocessing \
+    ${PYTHON_PN}-pytest \
+"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
+INSANE_SKIP:${PN}-ptest = "dev-deps"
 
-=-=-=-=-=-=-=-=-=-=-=-

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

author
#2 lore raw
Quoted 10 lines · On 10/6/24 18:53, akuster808 wrote:

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 3 lines · Mingli via lists.openembedded.org

From: Mingli Yu <[email protected]>

A Python module to customize the process title.

Adding new recipes to a stable branch is outside the policy. Is there a reason I should?

That's okay.

Thanks,

Quoted 158 lines

BR,
Armin

Quoted 154 lines
  # ./run-ptest
PASS: tests/module_test.py::test_no_import_side_effect
PASS: tests/module_test.py::test_version
PASS: tests/module_test.py::test_c_extension_built
PASS: tests/setproctitle_test.py::test_runner
PASS: tests/setproctitle_test.py::test_init_getproctitle
PASS: tests/setproctitle_test.py::test_setproctitle
tests/setproctitle_test.py::test_setproctitle_darwin SKIPPED (Mac on...)
PASS: tests/setproctitle_test.py::test_prctl
PASS: tests/setproctitle_test.py::test_getproctitle
PASS: tests/setproctitle_test.py::test_kwarg
PASS: tests/setproctitle_test.py::test_environ
PASS: tests/setproctitle_test.py::test_issue_8
PASS: tests/setproctitle_test.py::test_large_cmdline
PASS: tests/setproctitle_test.py::test_weird_args
PASS: tests/setproctitle_test.py::test_weird_path
PASS: tests/setproctitle_test.py::test_embedded
PASS: tests/setproctitle_test.py::test_embedded_many_args
PASS: tests/setproctitle_test.py::test_noenv
PASS: tests/setproctitle_test.py::test_large_env
PASS: tests/setproctitle_test.py::test_clear_segfault
PASS: tests/setproctitle_test.py::test_fork_segfault
PASS: tests/setproctitle_test.py::test_thread_fork_segfault
PASS: tests/setthreadtitle_test.py::test_thread_title_unchanged
PASS: tests/setthreadtitle_test.py::test_set_thread_title
PASS: tests/setthreadtitle_test.py::test_set_threads_title

---
  ...0001-conftest.py-Make-embed-avaiable.patch | 45 +++++++++++++++++++ .../python/python3-setproctitle/run-ptest     |  4 ++ .../python/python3-setproctitle_1.3.3.bb      | 34 ++++++++++++++

  3 files changed, 83 insertions(+)

  create mode 100644 meta-python/recipes-devtools/python/python3-setproctitle/0001-conftest.py-Make-embed-avaiable.patch create mode 100644 meta-python/recipes-devtools/python/python3-setproctitle/run-ptest
  create mode 100644 meta-python/recipes-devtools/python/python3-setproctitle_1.3.3.bb

(quoted diff) +0 -0
new file mode 100644
index 000000000..5de07de03

b/meta-python/recipes-devtools/python/python3-setproctitle/0001-conftest.py-Make-embed-avaiable.patch

meta-python/recipes-devtools/python/python3-setproctitle/0001-conftest.py-Make-embed-avaiable.patch new file +8 -0
@@ -0,0 +1,45 @@
+From ce7430f6252ce69af0699dc376662b5b1dc00b96 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <[email protected]>
+Date: Fri, 27 Sep 2024 10:56:32 +0000
+Subject: [PATCH] conftest.py: Make --embed avaiable
+
+Though --embed exists in the help message as below.
+ $ /usr/bin/python3.10-config --help
+ Usage: /usr/bin/python3.10-config 

[--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed

meta-python/recipes-devtools/python/python3-setproctitle/0001-conftest.py-Make-embed-avaiable.patch new file +7 -0
+
+ # https://github.com/dvarrazzo/py-setproctitle/issues/142
+ But has_embed which indicates if the help includes "--embed"
+ provides a wrong check as beow.
+ >>> import subprocess
+ >>> subprocess.check_output(["/usr/bin/python3.10-config", "--help"])
+Usage: /usr/bin/python3.10-config 

[--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed]
+ b''
+ >>> help = subprocess.check_output(["/usr/bin/python3.10-config",
"--help"])
+ >>> has_embed = b"--embed" in help

meta-python/recipes-devtools/python/python3-setproctitle/0001-conftest.py-Make-embed-avaiable.patch new file +27 -0
+
+So make sure --embed avaiable to fix the gap.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Mingli Yu <[email protected]>
+---
+ tests/conftest.py | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/tests/conftest.py b/tests/conftest.py
+index 6e15988..b01e2bd 100644
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -84,8 +84,7 @@ def pyconfig():
+
+     def pyconfig_func(opt):
+         cmdline = [pyconfexe, f"--{opt}"]
+-        if has_embed:
+-            cmdline.append("--embed")
++        cmdline.append("--embed")
+         bout = sp.check_output(cmdline)
+         out = bout.decode(
+             sys.getfilesystemencoding()  # sounds like a good bet
+--
+2.35.5
+
meta-python/recipes-devtools/python/python3-setproctitle/run-ptest new file +4 -0
new file mode 100644
index 000000000..8bedb66d4
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# https://github.com/dvarrazzo/py-setproctitle/issues/141
+pytest -k 'not test_unicode' -o log_cli=true -o log_cli_level=INFO | 

sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'

meta-python/recipes-devtools/python/python3-setproctitle_1.3.3.bb new file +8 -0
new file mode 100644
index 000000000..01e9d21cd
@@ -0,0 +1,34 @@
+SUMMARY = "A Python module to customize the process title"
+DESCRIPTION = "The setproctitle module allows a process to change its \
+title (as displayed by system tools such as ps, top or MacOS Activity \
+Monitor)."
+HOMEPAGE = "https://github.com/dvarrazzo/py-setproctitle"
+BUGTRACKER = "https://github.com/dvarrazzo/py-setproctitle/issues"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = 

"file://COPYRIGHT;md5=86d2d41b5f4f023f43466f8cb7adebaa"

meta-python/recipes-devtools/python/python3-setproctitle_1.3.3.bb new file +4 -0
+
+inherit pypi setuptools3 ptest
+
+SRC_URI[sha256sum] = 

"c913e151e7ea01567837ff037a23ca8740192880198b7fbb90b16d181607caae"

meta-python/recipes-devtools/python/python3-setproctitle_1.3.3.bb new file +22 -1
+
+SRC_URI += " \
+    file://0001-conftest.py-Make-embed-avaiable.patch \
+    file://run-ptest \
+"
+
+RDEPENDS:${PN}-ptest += "\
+    packagegroup-core-buildessential \
+    procps-ps \
+    python3-dev \
+    python3-multiprocessing \
+    ${PYTHON_PN}-pytest \
+"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
+INSANE_SKIP:${PN}-ptest = "dev-deps"
 
-=-=-=-=-=-=-=-=-=-=-=-

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