From 12843187ff2af8495fa8b4900066f72a61490073 Mon Sep 17 00:00:00 2001 From: Lev Blit Date: Tue, 14 Oct 2025 13:58:12 +0300 Subject: [PATCH 1/5] [psutil]: Bump psutil to 7.1.* --- stubs/psutil/METADATA.toml | 2 +- stubs/psutil/psutil/_pslinux.pyi | 4 ++-- stubs/psutil/psutil/_psutil_linux.pyi | 1 - stubs/psutil/psutil/_psutil_posix.pyi | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stubs/psutil/METADATA.toml b/stubs/psutil/METADATA.toml index 85e2bcc2e4e8..c309a68f483e 100644 --- a/stubs/psutil/METADATA.toml +++ b/stubs/psutil/METADATA.toml @@ -1,4 +1,4 @@ -version = "7.0.*" +version = "7.1.*" upstream_repository = "https://github.com/giampaolo/psutil" [tool.stubtest] diff --git a/stubs/psutil/psutil/_pslinux.pyi b/stubs/psutil/psutil/_pslinux.pyi index 1a947fc2b828..8b0e237ad1cc 100644 --- a/stubs/psutil/psutil/_pslinux.pyi +++ b/stubs/psutil/psutil/_pslinux.pyi @@ -24,8 +24,8 @@ HAS_PROC_IO_PRIORITY: Any HAS_CPU_AFFINITY: Any CLOCK_TICKS: Any PAGESIZE: Any -BOOT_TIME: Any LITTLE_ENDIAN: Any +UNSET: object DISK_SECTOR_SIZE: int AF_LINK: Any AddressFamily: Any @@ -213,7 +213,7 @@ class Process: def cpu_times(self): ... def cpu_num(self): ... def wait(self, timeout: Incomplete | None = ...): ... - def create_time(self): ... + def create_time(self, monotonic: bool = False): ... def memory_info(self): ... def memory_full_info(self): ... def memory_maps(self): ... diff --git a/stubs/psutil/psutil/_psutil_linux.pyi b/stubs/psutil/psutil/_psutil_linux.pyi index 877715d040fb..52b0a3f5dc72 100644 --- a/stubs/psutil/psutil/_psutil_linux.pyi +++ b/stubs/psutil/psutil/_psutil_linux.pyi @@ -14,4 +14,3 @@ def proc_cpu_affinity_set(*args, **kwargs) -> Any: ... def proc_ioprio_get(*args, **kwargs) -> Any: ... def proc_ioprio_set(*args, **kwargs) -> Any: ... def set_debug(*args, **kwargs) -> Any: ... -def users(*args, **kwargs) -> Any: ... diff --git a/stubs/psutil/psutil/_psutil_posix.pyi b/stubs/psutil/psutil/_psutil_posix.pyi index 2a58ee9a43de..37538667d014 100644 --- a/stubs/psutil/psutil/_psutil_posix.pyi +++ b/stubs/psutil/psutil/_psutil_posix.pyi @@ -32,3 +32,4 @@ if sys.platform == "darwin": def net_if_duplex_speed(*args, **kwargs): ... def setpriority(*args, **kwargs) -> Any: ... +def users(*args, **kwargs) -> Any: ... From 052551bd7e99a3ba61de564e6901748c2d724721 Mon Sep 17 00:00:00 2001 From: Lev Blit Date: Tue, 14 Oct 2025 14:15:23 +0300 Subject: [PATCH 2/5] fix osx --- stubs/psutil/@tests/stubtest_allowlist_darwin.txt | 3 +++ stubs/psutil/psutil/_psosx.pyi | 6 +++++- stubs/psutil/psutil/_psutil_osx.pyi | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/stubs/psutil/@tests/stubtest_allowlist_darwin.txt b/stubs/psutil/@tests/stubtest_allowlist_darwin.txt index 4cf5ba5d3a88..d15a40791938 100644 --- a/stubs/psutil/@tests/stubtest_allowlist_darwin.txt +++ b/stubs/psutil/@tests/stubtest_allowlist_darwin.txt @@ -2,3 +2,6 @@ psutil._pslinux psutil._psutil_linux psutil._psutil_windows psutil._pswindows + +# not always available on ARM64, but we test there +psutil._psosx.cpu_freq diff --git a/stubs/psutil/psutil/_psosx.pyi b/stubs/psutil/psutil/_psosx.pyi index dee1fd6ed291..678fdcd1cd5b 100644 --- a/stubs/psutil/psutil/_psosx.pyi +++ b/stubs/psutil/psutil/_psosx.pyi @@ -70,6 +70,10 @@ net_if_addrs: Any def net_connections(kind: str = "inet"): ... def net_if_stats(): ... def boot_time(): ... + +INIT_BOOT_TIME: float + +def adjust_proc_create_time(ctime: float) -> float: ... def users(): ... def pids(): ... @@ -96,7 +100,7 @@ class Process: def memory_info(self): ... def memory_full_info(self): ... def cpu_times(self): ... - def create_time(self): ... + def create_time(self, monotonic: bool = False): ... def num_ctx_switches(self): ... def num_threads(self): ... def open_files(self): ... diff --git a/stubs/psutil/psutil/_psutil_osx.pyi b/stubs/psutil/psutil/_psutil_osx.pyi index 3a6ea7372d40..af53eaf53503 100644 --- a/stubs/psutil/psutil/_psutil_osx.pyi +++ b/stubs/psutil/psutil/_psutil_osx.pyi @@ -29,6 +29,7 @@ def cpu_times(*args, **kwargs) -> Any: ... def disk_io_counters(*args, **kwargs) -> Any: ... def disk_partitions(*args, **kwargs) -> Any: ... def disk_usage_used(*args, **kwargs) -> Any: ... +def has_cpu_freq(*args, **kwargs) -> bool: ... def net_io_counters(*args, **kwargs) -> Any: ... def per_cpu_times(*args, **kwargs) -> Any: ... def pids(*args, **kwargs) -> Any: ... @@ -47,5 +48,4 @@ def proc_threads(*args, **kwargs) -> Any: ... def sensors_battery(*args, **kwargs) -> Any: ... def set_debug(*args, **kwargs) -> Any: ... def swap_mem(*args, **kwargs) -> Any: ... -def users(*args, **kwargs) -> Any: ... def virtual_mem(*args, **kwargs) -> Any: ... From 8c035af3647f2b0ca9a1389be794ba6d24454a23 Mon Sep 17 00:00:00 2001 From: Lev Blit Date: Tue, 14 Oct 2025 14:15:31 +0300 Subject: [PATCH 3/5] fix windows --- stubs/psutil/psutil/_psutil_windows.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/psutil/psutil/_psutil_windows.pyi b/stubs/psutil/psutil/_psutil_windows.pyi index a65eb03ed53f..312e3f63b8b4 100644 --- a/stubs/psutil/psutil/_psutil_windows.pyi +++ b/stubs/psutil/psutil/_psutil_windows.pyi @@ -36,7 +36,7 @@ class TimeoutAbandoned(Exception): ... class TimeoutExpired(Exception): ... def QueryDosDevice(*args, **kwargs): ... # incomplete -def boot_time(*args, **kwargs): ... # incomplete +def uptime(*args, **kwargs): ... # incomplete def check_pid_range(pid: int, /) -> None: ... def cpu_count_cores(*args, **kwargs): ... # incomplete def cpu_count_logical(*args, **kwargs): ... # incomplete From 48b7f35d944b45c75d35d0de5457dc1fe4686b49 Mon Sep 17 00:00:00 2001 From: Lev Blit Date: Tue, 14 Oct 2025 14:17:52 +0300 Subject: [PATCH 4/5] fix osx allowlist entry --- stubs/psutil/@tests/stubtest_allowlist_darwin.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/psutil/@tests/stubtest_allowlist_darwin.txt b/stubs/psutil/@tests/stubtest_allowlist_darwin.txt index d15a40791938..ae2e5e59ff64 100644 --- a/stubs/psutil/@tests/stubtest_allowlist_darwin.txt +++ b/stubs/psutil/@tests/stubtest_allowlist_darwin.txt @@ -4,4 +4,4 @@ psutil._psutil_windows psutil._pswindows # not always available on ARM64, but we test there -psutil._psosx.cpu_freq +psutil.cpu_freq From 129bd24e184a1b24cf5da328afacc3df748696d8 Mon Sep 17 00:00:00 2001 From: Lev Blit Date: Tue, 14 Oct 2025 14:19:02 +0300 Subject: [PATCH 5/5] oops - should have had them both --- stubs/psutil/@tests/stubtest_allowlist_darwin.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/stubs/psutil/@tests/stubtest_allowlist_darwin.txt b/stubs/psutil/@tests/stubtest_allowlist_darwin.txt index ae2e5e59ff64..d90126c03a35 100644 --- a/stubs/psutil/@tests/stubtest_allowlist_darwin.txt +++ b/stubs/psutil/@tests/stubtest_allowlist_darwin.txt @@ -5,3 +5,4 @@ psutil._pswindows # not always available on ARM64, but we test there psutil.cpu_freq +psutil._psosx.cpu_freq