Skip to content
Snippets Groups Projects
Verified Commit 64699e4b authored by Carl Smedstad's avatar Carl Smedstad
Browse files

upgpkg: 6.1.0-1: Upstream release

https://github.com/giampaolo/psutil/releases/tag/release-6.1.0

Also, don't package tests.
parent c286475e
No related branches found
No related tags found
No related merge requests found
pkgbase = python-psutil
pkgdesc = A cross-platform process and system utilities module for Python
pkgver = 6.0.0
pkgver = 6.1.0
pkgrel = 1
url = https://github.com/giampaolo/psutil
arch = x86_64
......@@ -14,9 +14,9 @@ pkgbase = python-psutil
makedepends = python-wheel
depends = glibc
depends = python
source = python-psutil-6.0.0.tar.gz::https://github.com/giampaolo/psutil/archive/release-6.0.0.tar.gz
source = remove-failing-tests.patch
sha512sums = 9db50d4c10cd6c0a73099f7262c218fd6e8e38fb443d22b42a45765527fe6f982455a7ca23d6d679ccc5df130c4257bb7fb5ee539ac5991d92358a072ab290a7
sha512sums = 5194ff360af46fcda1201fe3217e4590ea6086b16e594ac7c5bbf8c7ef42c1e4bbe00cb16e6f53ba2509678006313a339cde68f052f8444c2bfa3bbf31052a8f
source = python-psutil-6.1.0.tar.gz::https://github.com/giampaolo/psutil/archive/release-6.1.0.tar.gz
source = dont-package-tests.patch
sha512sums = 7dc755c62ad4607b3f34dd60701be86836f9226ac305387205a9dbf2837b6fded6d71f4919323a4e6b77308f9851db560f1bebedb2ae9a9e5fc59ee3adbc4538
sha512sums = bc902748c8de706a2196f8a19801314f11035c17c8ad406330ba54f821c3ba9144c49d9b7e305d56500576993162c6d148f7db9cf0c61d4fd23b4d85adb3d461
pkgname = python-psutil
......@@ -3,7 +3,7 @@
# Maintainer: Sébastien Luttringer
pkgname=python-psutil
pkgver=6.0.0
pkgver=6.1.0
pkgrel=1
arch=('x86_64')
pkgdesc='A cross-platform process and system utilities module for Python'
......@@ -26,41 +26,43 @@ checkdepends=(
)
source=(
"$pkgname-$pkgver.tar.gz::$url/archive/release-$pkgver.tar.gz"
"remove-failing-tests.patch"
)
sha512sums=(
'9db50d4c10cd6c0a73099f7262c218fd6e8e38fb443d22b42a45765527fe6f982455a7ca23d6d679ccc5df130c4257bb7fb5ee539ac5991d92358a072ab290a7'
'5194ff360af46fcda1201fe3217e4590ea6086b16e594ac7c5bbf8c7ef42c1e4bbe00cb16e6f53ba2509678006313a339cde68f052f8444c2bfa3bbf31052a8f'
"dont-package-tests.patch"
)
sha512sums=('7dc755c62ad4607b3f34dd60701be86836f9226ac305387205a9dbf2837b6fded6d71f4919323a4e6b77308f9851db560f1bebedb2ae9a9e5fc59ee3adbc4538'
'bc902748c8de706a2196f8a19801314f11035c17c8ad406330ba54f821c3ba9144c49d9b7e305d56500576993162c6d148f7db9cf0c61d4fd23b4d85adb3d461')
prepare() {
cd psutil-release-$pkgver
# Some tests are failing in a chroot - remove them.
patch -Np1 -i "$srcdir/remove-failing-tests.patch"
patch -Np1 -i ../dont-package-tests.patch
}
build() {
cd psutil-release-$pkgver
python -m build --wheel --no-isolation
}
check() {
cd psutil-release-$pkgver
python -m installer --destdir=tmp_install dist/*.whl
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
export PYTHONPATH="$PWD/tmp_install/$site_packages"
export GITHUB_ACTIONS=1 # Skips some failing tests.
python psutil/tests/runner.py
cp -r psutil/tests "$PWD/tmp_install/$site_packages/psutil"
cd "$PWD/tmp_install/$site_packages"
# Deselect tests failing in a chroot - not sure why.
pytest \
--config-file=/dev/null \
--rootdir="$PWD" \
--deselect psutil/tests/test_connections.py::TestSystemWideConnections::test_multi_sockets_procs \
--deselect psutil/tests/test_linux.py::TestRootFsDeviceFinder::test_against_findmnt \
--deselect psutil/tests/test_linux.py::TestRootFsDeviceFinder::test_comparisons \
--deselect psutil/tests/test_linux.py::TestRootFsDeviceFinder::test_disk_partitions_mocked \
--deselect psutil/tests/test_linux.py::TestSystemNetIfAddrs::test_ips \
--deselect psutil/tests/test_system.py::TestMiscAPIs::test_users
}
package() {
cd psutil-release-$pkgver
python -m installer --destdir="$pkgdir" dist/*.whl
install -D -m 644 LICENSE "$pkgdir/"usr/share/licenses/$pkgname/LICENSE
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
# vim:set ts=2 sw=2 et:
diff --git a/setup.py b/setup.py
index a7b7e817..c7f0a308 100755
--- a/setup.py
+++ b/setup.py
@@ -22,6 +22,7 @@ import sys
import sysconfig
import tempfile
import warnings
+from setuptools import find_packages
with warnings.catch_warnings():
@@ -485,7 +486,7 @@ def main():
url='https://github.com/giampaolo/psutil',
platforms='Platform Independent',
license='BSD-3-Clause',
- packages=['psutil', 'psutil.tests'],
+ packages=find_packages(exclude=["psutil.tests", "psutil.tests.*"]),
ext_modules=extensions,
options=options,
classifiers=[
diff --unified --recursive --text --new-file psutil-release-6.0.0.orig/psutil/tests/test_linux.py psutil-release-6.0.0/psutil/tests/test_linux.py
--- psutil-release-6.0.0.orig/psutil/tests/test_linux.py 2024-07-04 19:20:12.930686377 +0200
+++ psutil-release-6.0.0/psutil/tests/test_linux.py 2024-07-04 19:26:20.779890199 +0200
@@ -980,11 +980,6 @@
@unittest.skipIf(not LINUX, "LINUX only")
class TestSystemCPUStats(PsutilTestCase):
- def test_ctx_switches(self):
- vmstat_value = vmstat("context switches")
- psutil_value = psutil.cpu_stats().ctx_switches
- self.assertAlmostEqual(vmstat_value, psutil_value, delta=500)
-
def test_interrupts(self):
vmstat_value = vmstat("interrupts")
psutil_value = psutil.cpu_stats().interrupts
@@ -1010,48 +1005,6 @@
@unittest.skipIf(not LINUX, "LINUX only")
-class TestSystemNetIfAddrs(PsutilTestCase):
- def test_ips(self):
- for name, addrs in psutil.net_if_addrs().items():
- for addr in addrs:
- if addr.family == psutil.AF_LINK:
- self.assertEqual(addr.address, get_mac_address(name))
- elif addr.family == socket.AF_INET:
- self.assertEqual(addr.address, get_ipv4_address(name))
- self.assertEqual(addr.netmask, get_ipv4_netmask(name))
- if addr.broadcast is not None:
- self.assertEqual(
- addr.broadcast, get_ipv4_broadcast(name)
- )
- else:
- self.assertEqual(get_ipv4_broadcast(name), '0.0.0.0')
- elif addr.family == socket.AF_INET6:
- # IPv6 addresses can have a percent symbol at the end.
- # E.g. these 2 are equivalent:
- # "fe80::1ff:fe23:4567:890a"
- # "fe80::1ff:fe23:4567:890a%eth0"
- # That is the "zone id" portion, which usually is the name
- # of the network interface.
- address = addr.address.split('%')[0]
- self.assertIn(address, get_ipv6_addresses(name))
-
- # XXX - not reliable when having virtual NICs installed by Docker.
- # @unittest.skipIf(not which('ip'), "'ip' utility not available")
- # def test_net_if_names(self):
- # out = sh("ip addr").strip()
- # nics = [x for x in psutil.net_if_addrs().keys() if ':' not in x]
- # found = 0
- # for line in out.split('\n'):
- # line = line.strip()
- # if re.search(r"^\d+:", line):
- # found += 1
- # name = line.split(':')[1].strip()
- # self.assertIn(name, nics)
- # self.assertEqual(len(nics), found, msg="%s\n---\n%s" % (
- # pprint.pformat(nics), out))
-
-
-@unittest.skipIf(not LINUX, "LINUX only")
@unittest.skipIf(QEMU_USER, "QEMU user not supported")
class TestSystemNetIfStats(PsutilTestCase):
@unittest.skipIf(not which("ifconfig"), "ifconfig utility not available")
@@ -1445,19 +1398,6 @@
findmnt_value = sh("findmnt -o SOURCE -rn /")
self.assertEqual(psutil_value, findmnt_value)
- def test_disk_partitions_mocked(self):
- with mock.patch(
- 'psutil._pslinux.cext.disk_partitions',
- return_value=[('/dev/root', '/', 'ext4', 'rw')],
- ) as m:
- part = psutil.disk_partitions()[0]
- assert m.called
- if not GITHUB_ACTIONS:
- self.assertNotEqual(part.device, "/dev/root")
- self.assertEqual(part.device, RootFsDeviceFinder().find())
- else:
- self.assertEqual(part.device, "/dev/root")
-
# =====================================================================
# --- misc
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment