diff options
| author | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2024-11-02 21:40:14 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2024-11-02 21:40:14 +0000 |
| commit | 2d776379530af4a34a064948232be6b931b33ccc (patch) | |
| tree | d50584f2c2da21a652fa855b8e9653525972d270 /dev-python/psutil | |
| parent | 5942278792ca55128f7c21d91f2ee679ce943b67 (diff) | |
| download | baldeagleos-repo-2d776379530af4a34a064948232be6b931b33ccc.tar.gz baldeagleos-repo-2d776379530af4a34a064948232be6b931b33ccc.tar.xz baldeagleos-repo-2d776379530af4a34a064948232be6b931b33ccc.zip | |
Adding metadata
Diffstat (limited to 'dev-python/psutil')
| -rw-r--r-- | dev-python/psutil/files/psutil-6.0.0-py313t.patch | 190 | ||||
| -rw-r--r-- | dev-python/psutil/psutil-6.1.0.ebuild | 12 |
2 files changed, 11 insertions, 191 deletions
diff --git a/dev-python/psutil/files/psutil-6.0.0-py313t.patch b/dev-python/psutil/files/psutil-6.0.0-py313t.patch deleted file mode 100644 index 1cdc63ed406e..000000000000 --- a/dev-python/psutil/files/psutil-6.0.0-py313t.patch +++ /dev/null @@ -1,190 +0,0 @@ -From 5c0c0893c7565a39f1ac3f9c286fd1e1c58a7cd6 Mon Sep 17 00:00:00 2001 -From: Sam Gross <colesbury@gmail.com> -Date: Mon, 24 Jun 2024 17:51:07 +0000 -Subject: [PATCH 1/2] Fix GIL warnings and a few thread-safety issues in - free-threaded CPython - -- The temporary `argv` C array is no longer global in OpenBSD's - proc_cmdline -- The `maxcpus` variable is no longer global in FreeBSD's per_cpu_times. - -Signed-off-by: Sam Gross <colesbury@gmail.com> ---- - psutil/_psutil_aix.c | 3 +++ - psutil/_psutil_bsd.c | 4 ++++ - psutil/_psutil_linux.c | 4 ++++ - psutil/_psutil_osx.c | 4 ++++ - psutil/_psutil_posix.c | 4 ++++ - psutil/_psutil_sunos.c | 4 ++++ - psutil/_psutil_windows.c | 4 ++++ - psutil/arch/freebsd/cpu.c | 2 +- - psutil/arch/openbsd/proc.c | 4 +++- - 9 files changed, 31 insertions(+), 2 deletions(-) - -diff --git a/psutil/_psutil_aix.c b/psutil/_psutil_aix.c -index ce89a7bd7c..42f921188e 100644 ---- a/psutil/_psutil_aix.c -+++ b/psutil/_psutil_aix.c -@@ -1080,6 +1080,9 @@ void init_psutil_aix(void) - PyObject *module = PyModule_Create(&moduledef); - #else - PyObject *module = Py_InitModule("_psutil_aix", PsutilMethods); -+#endif -+#ifdef Py_GIL_DISABLED -+ PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED); - #endif - PyModule_AddIntConstant(module, "version", PSUTIL_VERSION); - -diff --git a/psutil/_psutil_bsd.c b/psutil/_psutil_bsd.c -index 6517d5800a..facaba831f 100644 ---- a/psutil/_psutil_bsd.c -+++ b/psutil/_psutil_bsd.c -@@ -143,6 +143,10 @@ static PyMethodDef mod_methods[] = { - if (mod == NULL) - INITERR; - -+#ifdef Py_GIL_DISABLED -+ PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED); -+#endif -+ - if (PyModule_AddIntConstant(mod, "version", PSUTIL_VERSION)) INITERR; - // process status constants - -diff --git a/psutil/_psutil_linux.c b/psutil/_psutil_linux.c -index 292e1c5524..46244c5792 100644 ---- a/psutil/_psutil_linux.c -+++ b/psutil/_psutil_linux.c -@@ -78,6 +78,10 @@ static PyMethodDef mod_methods[] = { - if (mod == NULL) - INITERR; - -+#ifdef Py_GIL_DISABLED -+ PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED); -+#endif -+ - if (PyModule_AddIntConstant(mod, "version", PSUTIL_VERSION)) INITERR; - if (PyModule_AddIntConstant(mod, "DUPLEX_HALF", DUPLEX_HALF)) INITERR; - if (PyModule_AddIntConstant(mod, "DUPLEX_FULL", DUPLEX_FULL)) INITERR; -diff --git a/psutil/_psutil_osx.c b/psutil/_psutil_osx.c -index 4aa11d1700..09fa267a98 100644 ---- a/psutil/_psutil_osx.c -+++ b/psutil/_psutil_osx.c -@@ -91,6 +91,10 @@ static PyMethodDef mod_methods[] = { - if (mod == NULL) - INITERR; - -+#ifdef Py_GIL_DISABLED -+ PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED); -+#endif -+ - if (psutil_setup() != 0) - INITERR; - -diff --git a/psutil/_psutil_posix.c b/psutil/_psutil_posix.c -index 24628afc78..8ced7beaac 100644 ---- a/psutil/_psutil_posix.c -+++ b/psutil/_psutil_posix.c -@@ -913,6 +913,10 @@ static PyMethodDef mod_methods[] = { - if (mod == NULL) - INITERR; - -+#ifdef Py_GIL_DISABLED -+ PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED); -+#endif -+ - #if defined(PSUTIL_BSD) || \ - defined(PSUTIL_OSX) || \ - defined(PSUTIL_SUNOS) || \ -diff --git a/psutil/_psutil_sunos.c b/psutil/_psutil_sunos.c -index 54f353c106..d21f59c618 100644 ---- a/psutil/_psutil_sunos.c -+++ b/psutil/_psutil_sunos.c -@@ -1721,6 +1721,10 @@ void init_psutil_sunos(void) - if (module == NULL) - INITERROR; - -+#ifdef Py_GIL_DISABLED -+ PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED); -+#endif -+ - if (psutil_setup() != 0) - INITERROR; - -diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c -index bb6e12ff80..0c221bdc23 100644 ---- a/psutil/_psutil_windows.c -+++ b/psutil/_psutil_windows.c -@@ -165,6 +165,10 @@ void init_psutil_windows(void) - if (module == NULL) - INITERROR; - -+#ifdef Py_GIL_DISABLED -+ PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED); -+#endif -+ - if (psutil_setup() != 0) - INITERROR; - if (psutil_set_se_debug() != 0) -diff --git a/psutil/arch/freebsd/cpu.c b/psutil/arch/freebsd/cpu.c -index a15d96efc1..9fa1a7dbe6 100644 ---- a/psutil/arch/freebsd/cpu.c -+++ b/psutil/arch/freebsd/cpu.c -@@ -26,7 +26,7 @@ For reference, here's the git history with original(ish) implementations: - - PyObject * - psutil_per_cpu_times(PyObject *self, PyObject *args) { -- static int maxcpus; -+ int maxcpus; - int mib[2]; - int ncpu; - size_t len; -diff --git a/psutil/arch/openbsd/proc.c b/psutil/arch/openbsd/proc.c -index 96b85bc502..bec2c42ea7 100644 ---- a/psutil/arch/openbsd/proc.c -+++ b/psutil/arch/openbsd/proc.c -@@ -147,7 +147,7 @@ PyObject * - psutil_proc_cmdline(PyObject *self, PyObject *args) { - pid_t pid; - int mib[4]; -- static char **argv; -+ char **argv = NULL; - char **p; - size_t argv_size = 128; - PyObject *py_retlist = PyList_New(0); -@@ -189,9 +189,11 @@ psutil_proc_cmdline(PyObject *self, PyObject *args) { - Py_DECREF(py_arg); - } - -+ free(argv); - return py_retlist; - - error: -+ free(argv); - Py_XDECREF(py_arg); - Py_DECREF(py_retlist); - return NULL; - -From 69c74c63a322fae4a763bf8347f9e5e3202d5ecf Mon Sep 17 00:00:00 2001 -From: Sam Gross <colesbury@gmail.com> -Date: Mon, 24 Jun 2024 18:26:00 +0000 -Subject: [PATCH 2/2] Add `if (argv != NULL)` check - -Signed-off-by: Sam Gross <colesbury@gmail.com> ---- - psutil/arch/openbsd/proc.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/psutil/arch/openbsd/proc.c b/psutil/arch/openbsd/proc.c -index bec2c42ea7..0881ccd555 100644 ---- a/psutil/arch/openbsd/proc.c -+++ b/psutil/arch/openbsd/proc.c -@@ -193,7 +193,8 @@ psutil_proc_cmdline(PyObject *self, PyObject *args) { - return py_retlist; - - error: -- free(argv); -+ if (argv != NULL) -+ free(argv); - Py_XDECREF(py_arg); - Py_DECREF(py_retlist); - return NULL; diff --git a/dev-python/psutil/psutil-6.1.0.ebuild b/dev-python/psutil/psutil-6.1.0.ebuild index 799ee98b3f2d..da980f9fabe3 100644 --- a/dev-python/psutil/psutil-6.1.0.ebuild +++ b/dev-python/psutil/psutil-6.1.0.ebuild @@ -17,7 +17,7 @@ HOMEPAGE=" LICENSE="BSD" SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" distutils_enable_tests pytest @@ -27,6 +27,7 @@ python_test() { tests/test_linux.py::TestRootFsDeviceFinder::test_disk_partitions_mocked tests/test_linux.py::TestSystemDiskPartitions::test_zfs_fs tests/test_linux.py::TestSystemNetIfAddrs::test_ips + tests/test_posix.py::TestProcess::test_nice tests/test_process.py::TestProcess::test_ionice_linux tests/test_system.py::TestDiskAPIs::test_disk_partitions @@ -51,6 +52,8 @@ python_test() { tests/test_linux.py::TestSystemCPUCountLogical::test_emulate_fallbacks tests/test_linux.py::TestSystemCPUFrequency::test_emulate_use_cpuinfo tests/test_linux.py::TestSystemCPUFrequency::test_emulate_use_second_file + tests/test_system.py::TestCpuAPIs::test_cpu_freq + tests/test_system.py::TestCpuAPIs::test_cpu_times_comparison # broken in some setups tests/test_linux.py::TestMisc::test_issue_687 @@ -61,6 +64,13 @@ python_test() { tests/test_posix.py::TestSystemAPIs::test_users tests/test_process.py::TestProcess::test_terminal tests/test_unicode.py::TestFSAPIs::test_memory_maps + + # fails on all AT containers + tests/test_system.py::TestMiscAPIs::test_users + + # failing without /sys/class/power_supply? + tests/test_memleaks.py::TestModuleFunctionsLeaks::test_sensors_battery + tests/test_misc.py::TestMisc::test_serialization ) # Since we are running in an environment a bit similar to CI, |
