From 3950a787afcecf26cf431d9eff615ba6897229ca75ee2a2d0336db69d78ef93e Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 25 Jan 2021 22:42:02 +0000 Subject: [PATCH 1/2] Accepting request 866659 from home:alarrosa:branches:devel:languages:python - update to 5.8.0: * Enhancements: - 1863: disk_partitions() exposes 2 extra fields: maxfile and maxpath, which are the maximum file name and path name length. - 1872: [Windows] added support for PyPy 2.7. - 1879: provide pre-compiled wheels for Linux and macOS. - 1880: get rid of Travis and Cirrus CI services (they are no longer free). CI testing is now done by GitHub Actions on Linux, macOS and FreeBSD (yes). AppVeyor is still being used for Windows CI. * Bug fixes: - 1708: [Linux] get rid of sensors_temperatures() duplicates. (patch by Tim Schlueter). - 1839: [Windows] always raise AccessDenied when failing to query 64 processes from 32 bit ones (NtWoW64 APIs). - 1866: [Windows] process exe(), cmdline(), environ() may raise "invalid access to memory location" on Python 3.9. - 1874: [Solaris] wrong swap output given when encrypted column is present. - 1875: [Windows] process username() may raise ERROR_NONE_MAPPED if the SID has no corresponding account name. In this case AccessDenied is now raised. - 1877: [Windows] OpenProcess may fail with ERROR_SUCCESS. Turn it into AccessDenied or NoSuchProcess depending on whether the PID is alive. - 1886: [macOS] EIO error may be raised on cmdline() and environment(). Now it gets translated into AccessDenied. - 1891: [macOS] get rid of deprecated getpagesize(). - Rebase patch and skip three other tests that fail on obs OBS-URL: https://build.opensuse.org/request/show/866659 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psutil?expand=0&rev=129 --- psutil-5.7.3.tar.gz | 3 -- psutil-5.8.0.tar.gz | 3 ++ python-psutil.changes | 35 ++++++++++++++++++++ python-psutil.spec | 4 +-- skip-obs.patch | 76 +++++++++++++++++++++++++++++-------------- 5 files changed, 92 insertions(+), 29 deletions(-) delete mode 100644 psutil-5.7.3.tar.gz create mode 100644 psutil-5.8.0.tar.gz diff --git a/psutil-5.7.3.tar.gz b/psutil-5.7.3.tar.gz deleted file mode 100644 index db498c3..0000000 --- a/psutil-5.7.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:af73f7bcebdc538eda9cc81d19db1db7bf26f103f91081d780bbacfcb620dee2 -size 465556 diff --git a/psutil-5.8.0.tar.gz b/psutil-5.8.0.tar.gz new file mode 100644 index 0000000..c852adc --- /dev/null +++ b/psutil-5.8.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c9ccb99ab76025f2f0bbecf341d4656e9c1351db8cc8a03ccd62e318ab4b5c6 +size 470886 diff --git a/python-psutil.changes b/python-psutil.changes index 7f091d8..2749969 100644 --- a/python-psutil.changes +++ b/python-psutil.changes @@ -1,3 +1,38 @@ +------------------------------------------------------------------- +Mon Jan 25 16:03:37 UTC 2021 - Antonio Larrosa + +- update to 5.8.0: + * Enhancements: + - 1863: disk_partitions() exposes 2 extra fields: maxfile and + maxpath, which are the maximum file name and path name + length. + - 1872: [Windows] added support for PyPy 2.7. + - 1879: provide pre-compiled wheels for Linux and macOS. + - 1880: get rid of Travis and Cirrus CI services (they are no + longer free). CI testing is now done by GitHub Actions on + Linux, macOS and FreeBSD (yes). AppVeyor is still being used + for Windows CI. + * Bug fixes: + - 1708: [Linux] get rid of sensors_temperatures() duplicates. + (patch by Tim Schlueter). + - 1839: [Windows] always raise AccessDenied when failing to + query 64 processes from 32 bit ones (NtWoW64 APIs). + - 1866: [Windows] process exe(), cmdline(), environ() may raise + "invalid access to memory location" on Python 3.9. + - 1874: [Solaris] wrong swap output given when encrypted column + is present. + - 1875: [Windows] process username() may raise + ERROR_NONE_MAPPED if the SID has no corresponding account + name. In this case AccessDenied is now raised. + - 1877: [Windows] OpenProcess may fail with ERROR_SUCCESS. + Turn it into AccessDenied or NoSuchProcess depending on + whether the PID is alive. + - 1886: [macOS] EIO error may be raised on cmdline() and + environment(). Now it gets translated into AccessDenied. + - 1891: [macOS] get rid of deprecated getpagesize(). +- Rebase patch and skip three other tests that fail on obs + * skip-obs.patch + ------------------------------------------------------------------- Fri Dec 11 12:19:05 UTC 2020 - Benjamin Greiner diff --git a/python-psutil.spec b/python-psutil.spec index ae283b6..63bb4ec 100644 --- a/python-psutil.spec +++ b/python-psutil.spec @@ -1,7 +1,7 @@ # # spec file for package python-psutil # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ %endif %bcond_without python2 Name: python-psutil -Version: 5.7.3 +Version: 5.8.0 Release: 0 Summary: A process utilities module for Python License: BSD-3-Clause diff --git a/skip-obs.patch b/skip-obs.patch index e6f34d6..a666369 100644 --- a/skip-obs.patch +++ b/skip-obs.patch @@ -1,8 +1,16 @@ -Index: psutil-5.7.3/psutil/tests/test_misc.py +Index: psutil-5.8.0/psutil/tests/test_misc.py =================================================================== ---- psutil-5.7.3.orig/psutil/tests/test_misc.py -+++ psutil-5.7.3/psutil/tests/test_misc.py -@@ -664,7 +664,7 @@ class TestScripts(PsutilTestCase): +--- psutil-5.8.0.orig/psutil/tests/test_misc.py ++++ psutil-5.8.0/psutil/tests/test_misc.py +@@ -354,6 +354,7 @@ class TestMisc(PsutilTestCase): + check(psutil.disk_usage(os.getcwd())) + check(psutil.users()) + ++ @unittest.skipIf(True, 'does not work on obs') + def test_setup_script(self): + setup_py = os.path.join(ROOT_DIR, 'setup.py') + if CI_TESTING and not os.path.exists(setup_py): +@@ -667,7 +668,7 @@ class TestScripts(PsutilTestCase): src = f.read() ast.parse(src) @@ -11,7 +19,7 @@ Index: psutil-5.7.3/psutil/tests/test_misc.py # make sure all example scripts have a test method defined meths = dir(self) for name in os.listdir(SCRIPTS_DIR): -@@ -682,7 +682,7 @@ class TestScripts(PsutilTestCase): +@@ -685,7 +686,7 @@ class TestScripts(PsutilTestCase): if not stat.S_IXUSR & os.stat(path)[stat.ST_MODE]: self.fail('%r is not executable' % path) @@ -20,11 +28,11 @@ Index: psutil-5.7.3/psutil/tests/test_misc.py self.assert_stdout('disk_usage.py') def test_free(self): -Index: psutil-5.7.3/psutil/tests/test_linux.py +Index: psutil-5.8.0/psutil/tests/test_linux.py =================================================================== ---- psutil-5.7.3.orig/psutil/tests/test_linux.py -+++ psutil-5.7.3/psutil/tests/test_linux.py -@@ -682,7 +682,7 @@ class TestSystemCPUCountLogical(PsutilTe +--- psutil-5.8.0.orig/psutil/tests/test_linux.py ++++ psutil-5.8.0/psutil/tests/test_linux.py +@@ -675,7 +675,7 @@ class TestSystemCPUCountLogical(PsutilTe self.assertEqual(psutil.cpu_count(logical=True), num) @unittest.skipIf(not which("lscpu"), "lscpu utility not available") @@ -33,7 +41,7 @@ Index: psutil-5.7.3/psutil/tests/test_linux.py out = sh("lscpu -p") num = len([x for x in out.split('\n') if not x.startswith('#')]) self.assertEqual(psutil.cpu_count(logical=True), num) -@@ -725,7 +725,7 @@ class TestSystemCPUCountLogical(PsutilTe +@@ -718,7 +718,7 @@ class TestSystemCPUCountLogical(PsutilTe class TestSystemCPUCountPhysical(PsutilTestCase): @unittest.skipIf(not which("lscpu"), "lscpu utility not available") @@ -42,7 +50,7 @@ Index: psutil-5.7.3/psutil/tests/test_linux.py out = sh("lscpu -p") core_ids = set() for line in out.split('\n'): -@@ -1080,7 +1080,7 @@ class TestSystemDiskPartitions(PsutilTes +@@ -1068,7 +1068,7 @@ class TestSystemDiskPartitions(PsutilTes @unittest.skipIf(not hasattr(os, 'statvfs'), "os.statvfs() not available") @skip_on_not_implemented() @@ -51,7 +59,7 @@ Index: psutil-5.7.3/psutil/tests/test_linux.py # test psutil.disk_usage() and psutil.disk_partitions() # against "df -a" def df(path): -@@ -1254,7 +1254,7 @@ class TestSystemDiskIoCounters(PsutilTes +@@ -1242,7 +1242,7 @@ class TestSystemDiskIoCounters(PsutilTes self.assertEqual(ret.read_count, 1) self.assertEqual(ret.write_count, 5) @@ -60,29 +68,49 @@ Index: psutil-5.7.3/psutil/tests/test_linux.py def exists(path): if path == '/proc/diskstats': return False -Index: psutil-5.7.3/psutil/tests/test_posix.py +Index: psutil-5.8.0/psutil/tests/test_posix.py =================================================================== ---- psutil-5.7.3.orig/psutil/tests/test_posix.py -+++ psutil-5.7.3/psutil/tests/test_posix.py -@@ -371,7 +371,7 @@ class TestSystemAPIs(PsutilTestCase): - +--- psutil-5.8.0.orig/psutil/tests/test_posix.py ++++ psutil-5.8.0/psutil/tests/test_posix.py +@@ -376,7 +376,7 @@ class TestSystemAPIs(PsutilTestCase): # AIX can return '-' in df output instead of numbers, e.g. for /proc @unittest.skipIf(AIX, "unreliable on AIX") + @retry_on_failure() - def test_disk_usage(self): + def _test_disk_usage(self): def df(device): out = sh("df -k %s" % device).strip() line = out.split('\n')[1] -Index: psutil-5.7.3/psutil/tests/test_system.py +Index: psutil-5.8.0/psutil/tests/test_system.py =================================================================== ---- psutil-5.7.3.orig/psutil/tests/test_system.py -+++ psutil-5.7.3/psutil/tests/test_system.py -@@ -591,7 +591,7 @@ class TestDiskAPIs(PsutilTestCase): +--- psutil-5.8.0.orig/psutil/tests/test_system.py ++++ psutil-5.8.0/psutil/tests/test_system.py +@@ -200,6 +200,7 @@ class TestMiscAPIs(PsutilTestCase): + self.assertLess(bt, time.time()) + + @unittest.skipIf(CI_TESTING and not psutil.users(), "unreliable on CI") ++ @unittest.skipIf(True, "does not work on obs") + def test_users(self): + users = psutil.users() + self.assertNotEqual(users, []) +@@ -580,7 +581,7 @@ class TestDiskAPIs(PsutilTestCase): def test_disk_usage_bytes(self): psutil.disk_usage(b'.') - def test_disk_partitions(self): + def _test_disk_partitions(self): - # all = False - ls = psutil.disk_partitions(all=False) - # on travis we get: + def check_ntuple(nt): + self.assertIsInstance(nt.device, str) + self.assertIsInstance(nt.mountpoint, str) +Index: psutil-5.8.0/psutil/tests/test_contracts.py +=================================================================== +--- psutil-5.8.0.orig/psutil/tests/test_contracts.py ++++ psutil-5.8.0/psutil/tests/test_contracts.py +@@ -246,6 +246,7 @@ class TestSystemAPITypes(PsutilTestCase) + self.assertIsInstance(k, str) + self.assert_ntuple_of_nums(v, type_=(int, long)) + ++ @unittest.skipIf(True, "does not work on obs") + def test_disk_partitions(self): + # Duplicate of test_system.py. Keep it anyway. + for disk in psutil.disk_partitions(): From be1bd93299d986aea0a8ad9e3816a9bd7468936a25fa1921649a095d12195dd7 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 29 Jan 2021 09:54:20 +0000 Subject: [PATCH 2/2] Accepting request 867673 from home:alarrosa:branches:devel:languages:python - Do not install tests (and change the way they're run since they were run from %{buildroot}) - Add patch to skip tests related to rlimit and zombie processes that fail when building for python2 on i586: * skip_rlimit_tests_on_python2.patch OBS-URL: https://build.opensuse.org/request/show/867673 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psutil?expand=0&rev=130 --- python-psutil.changes | 13 ++++++++ python-psutil.spec | 6 +++- skip_rlimit_tests_on_python2.patch | 52 ++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 skip_rlimit_tests_on_python2.patch diff --git a/python-psutil.changes b/python-psutil.changes index 2749969..eac9777 100644 --- a/python-psutil.changes +++ b/python-psutil.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Fri Jan 29 08:19:00 UTC 2021 - Antonio Larrosa + +- Do not install tests (and change the way they're run since they + were run from %{buildroot}) + +------------------------------------------------------------------- +Thu Jan 28 16:25:35 UTC 2021 - Antonio Larrosa + +- Add patch to skip tests related to rlimit and zombie processes + that fail when building for python2 on i586: + * skip_rlimit_tests_on_python2.patch + ------------------------------------------------------------------- Mon Jan 25 16:03:37 UTC 2021 - Antonio Larrosa diff --git a/python-psutil.spec b/python-psutil.spec index 63bb4ec..2280f04 100644 --- a/python-psutil.spec +++ b/python-psutil.spec @@ -34,6 +34,8 @@ Patch1: skip-obs.patch # PATCH-FIX-UPSTREAM skip_failing_tests.patch gh#giampaolo/psutil#1635 mcepl@suse.com # skip tests failing because of incomplete emulation of the environment in osc build Patch2: skip_failing_tests.patch +# PATCH-FIX-SLE skip_rlimit_tests_on_python2.patch alarrosa@suse.com +Patch3: skip_rlimit_tests_on_python2.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -75,6 +77,7 @@ sed -i "1s/#!.*//" psutil/{__init__.py,_compat.py,_psbsd.py,_pslinux.py,_psosx.p %{python_expand mkdir -p %{buildroot}%{_docdir}/%{$python_prefix}-psutil cp -r scripts %{buildroot}%{_docdir}/%{$python_prefix}-psutil/ find %{buildroot}%{_docdir}/%{$python_prefix}-psutil/scripts/ -type f -name "*.py" -exec sed -i "s|#!%{_bindir}/env python.*|#!%{__$python}|" {} \; +rm -rf %{buildroot}%{$python_sitearch}/psutil/tests %fdupes %{buildroot}%{_docdir}/%{$python_prefix}-psutil/ %fdupes %{buildroot}%{$python_sitearch} } @@ -84,9 +87,10 @@ find %{buildroot}%{_docdir}/%{$python_prefix}-psutil/scripts/ -type f -name "*.p export LANG=en_US.UTF-8 export PSUTIL_TESTING=1 export TRAVIS=1 +march=`python3 -c "import platform ; print(platform.machine())"` # Note test_fetch_all is a bit flaky, occasionally failing -%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -Wa psutil/tests/runner.py +%python_expand PYTHONPATH=build/lib.linux-${march}-%{$python_version}/ $python -Wa psutil/tests/runner.py %endif %files %{python_files} diff --git a/skip_rlimit_tests_on_python2.patch b/skip_rlimit_tests_on_python2.patch new file mode 100644 index 0000000..6e96549 --- /dev/null +++ b/skip_rlimit_tests_on_python2.patch @@ -0,0 +1,52 @@ +Index: psutil-5.8.0/psutil/tests/test_process.py +=================================================================== +--- psutil-5.8.0.orig/psutil/tests/test_process.py ++++ psutil-5.8.0/psutil/tests/test_process.py +@@ -416,6 +416,7 @@ class TestProcess(PsutilTestCase): + p.ionice(init) + + @unittest.skipIf(not HAS_RLIMIT, "not supported") ++ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2") + def test_rlimit_get(self): + import resource + p = psutil.Process(os.getpid()) +@@ -439,6 +440,7 @@ class TestProcess(PsutilTestCase): + self.assertGreaterEqual(ret[1], -1) + + @unittest.skipIf(not HAS_RLIMIT, "not supported") ++ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2") + def test_rlimit_set(self): + p = self.spawn_psproc() + p.rlimit(psutil.RLIMIT_NOFILE, (5, 5)) +@@ -452,6 +454,7 @@ class TestProcess(PsutilTestCase): + p.rlimit(psutil.RLIMIT_NOFILE, (5, 5, 5)) + + @unittest.skipIf(not HAS_RLIMIT, "not supported") ++ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2") + def test_rlimit(self): + p = psutil.Process() + testfn = self.get_testfn() +@@ -472,6 +475,7 @@ class TestProcess(PsutilTestCase): + self.assertEqual(p.rlimit(psutil.RLIMIT_FSIZE), (soft, hard)) + + @unittest.skipIf(not HAS_RLIMIT, "not supported") ++ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2") + def test_rlimit_infinity(self): + # First set a limit, then re-set it by specifying INFINITY + # and assume we overridden the previous limit. +@@ -487,6 +491,7 @@ class TestProcess(PsutilTestCase): + self.assertEqual(p.rlimit(psutil.RLIMIT_FSIZE), (soft, hard)) + + @unittest.skipIf(not HAS_RLIMIT, "not supported") ++ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2") + def test_rlimit_infinity_value(self): + # RLIMIT_FSIZE should be RLIM_INFINITY, which will be a really + # big number on a platform with large file support. On these +@@ -1270,6 +1275,7 @@ class TestProcess(PsutilTestCase): + self.assertEqual(normcase(p.exe()), normcase(PYTHON_EXE)) + + @unittest.skipIf(not POSIX, 'POSIX only') ++ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2") + def test_zombie_process(self): + def succeed_or_zombie_p_exc(fun): + try: