Skip to content
Merged
4 changes: 4 additions & 0 deletions stubs/psutil/@tests/stubtest_allowlist_darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ psutil._pslinux
psutil._psutil_linux
psutil._psutil_windows
psutil._pswindows

# not always available on ARM64, but we test there
psutil.cpu_freq
psutil._psosx.cpu_freq
2 changes: 1 addition & 1 deletion stubs/psutil/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "7.0.*"
version = "7.1.1"
upstream_repository = "https://github.com/giampaolo/psutil"

[tool.stubtest]
Expand Down
9 changes: 5 additions & 4 deletions stubs/psutil/psutil/_psbsd.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ PROC_STATUSES: Incomplete
TCP_STATUSES: Incomplete
PAGESIZE: Incomplete
AF_LINK: Incomplete
HAS_PER_CPU_TIMES: Incomplete
HAS_PROC_NUM_THREADS: Incomplete
HAS_PROC_OPEN_FILES: Incomplete
HAS_PROC_NUM_FDS: Incomplete
kinfo_proc_map: Incomplete

class svmem(NamedTuple):
Expand Down Expand Up @@ -108,6 +105,10 @@ def sensors_temperatures(): ...
def cpu_freq(): ...
def boot_time(): ...
def users(): ...

INIT_BOOT_TIME: float

def adjust_proc_create_time(ctime: float) -> float: ...
def pids(): ...
def pid_exists(pid): ...
def is_zombie(pid): ...
Expand All @@ -132,7 +133,7 @@ class Process:
def cpu_num(self): ...
def memory_info(self): ...
memory_full_info: Incomplete
def create_time(self): ...
def create_time(self, monotonic: bool = False) -> float: ...
def num_threads(self): ...
def num_ctx_switches(self): ...
def threads(self): ...
Expand Down
4 changes: 2 additions & 2 deletions stubs/psutil/psutil/_pslinux.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ HAS_PROC_IO_PRIORITY: Incomplete
HAS_CPU_AFFINITY: Incomplete
CLOCK_TICKS: Incomplete
PAGESIZE: Incomplete
BOOT_TIME: Incomplete
LITTLE_ENDIAN: Incomplete
UNSET: object
DISK_SECTOR_SIZE: int
AF_LINK: Incomplete
AddressFamily: Incomplete
Expand Down Expand Up @@ -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) -> float: ...
def memory_info(self): ...
def memory_full_info(self): ...
def memory_maps(self): ...
Expand Down
11 changes: 5 additions & 6 deletions stubs/psutil/psutil/_psosx.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if sys.platform == "darwin":
ZombieProcess as ZombieProcess,
conn_tmap as conn_tmap,
conn_to_ntuple as conn_to_ntuple,
debug as debug,
isfile_strict as isfile_strict,
memoize_when_activated as memoize_when_activated,
parse_environ_block as parse_environ_block,
Expand Down Expand Up @@ -70,23 +71,21 @@ if sys.platform == "darwin":

Copy link
Contributor

@donbarbos donbarbos Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add from psutil._common import debug as debug to imports in _psosx.pyi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but I meant to add this import in _psosx.pyi (you added it in _psbsd.pyi)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, thanks :)

disk_usage = _psposix.disk_usage
disk_io_counters = _psutil_osx.disk_io_counters

def disk_partitions(all: bool = False) -> list[_common.sdiskpart]: ...
def sensors_battery() -> _common.sbattery | None: ...

net_io_counters = _psutil_osx.net_io_counters
net_if_addrs = _psutil_posix.net_if_addrs

def net_connections(kind: str = "inet") -> list[_common.sconn]: ...
def net_if_stats() -> dict[str, _common.snicstats]: ...
def boot_time() -> float: ...
INIT_BOOT_TIME: float
def adjust_proc_create_time(ctime: float) -> float: ...
def users() -> list[_common.suser]: ...
def pids() -> list[int]: ...

pid_exists = _psposix.pid_exists

def is_zombie(pid: int) -> bool: ...
def wrap_exceptions(fun: Callable[_P, _R]) -> Callable[_P, _R]: ...
def is_zombie(pid: int) -> bool: ...

class Process:
__slots__ = ["_cache", "_name", "_ppid", "pid"]
Expand All @@ -106,7 +105,7 @@ if sys.platform == "darwin":
def memory_info(self) -> pmem: ...
def memory_full_info(self) -> pfullmem: ...
def cpu_times(self) -> _common.pcputimes: ...
def create_time(self) -> float: ...
def create_time(self, monotonic: bool = False) -> float: ...
def num_ctx_switches(self) -> _common.pctxsw: ...
def num_threads(self) -> int: ...
def open_files(self) -> list[_common.popenfile]: ...
Expand Down
1 change: 0 additions & 1 deletion stubs/psutil/psutil/_psutil_linux.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ def proc_cpu_affinity_set(*args, **kwargs): ...
def proc_ioprio_get(*args, **kwargs): ...
def proc_ioprio_set(*args, **kwargs): ...
def set_debug(*args, **kwargs): ...
def users(*args, **kwargs): ...
2 changes: 1 addition & 1 deletion stubs/psutil/psutil/_psutil_osx.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ if sys.platform == "darwin":
def disk_io_counters() -> dict[str, tuple[int, int, int, int, int, int]]: ...
def disk_partitions() -> list[tuple[str, str, str, str]]: ...
def disk_usage_used(mount_point: StrOrBytesPath, default: _T, /) -> int | _T: ...
def has_cpu_freq() -> bool: ...
def net_io_counters() -> dict[str, tuple[int, int, int, int, int, int, int, int]]: ...
def per_cpu_times() -> list[tuple[float, float, float, float]]: ...
def pids() -> list[int]: ...
def sensors_battery() -> tuple[int, int, int]: ...
def swap_mem() -> tuple[int, int, int, int, int]: ...
def users() -> list[tuple[str, str, str, float, int]]: ...
def virtual_mem() -> tuple[int, int, int, int, int, int]: ...
def check_pid_range(pid: int, /) -> None: ...
def set_debug(value: bool, /) -> None: ...
2 changes: 2 additions & 0 deletions stubs/psutil/psutil/_psutil_posix.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
from _typeshed import Incomplete
from typing import Final

if sys.platform == "linux":
Expand Down Expand Up @@ -31,4 +32,5 @@ if sys.platform == "darwin":
AF_LINK: Final[int]
def net_if_duplex_speed(nic_name: str, /) -> list[int]: ...

def users() -> list[tuple[Incomplete, ...]]: ...
def setpriority(pid: int, priority: int, /) -> None: ...
2 changes: 1 addition & 1 deletion stubs/psutil/psutil/_psutil_windows.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if sys.platform == "win32":
def proc_info(
pid: int, /
) -> tuple[int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int]: ...
def boot_time() -> float: ...
def uptime() -> float: ...
def cpu_count_cores() -> int | None: ...
def cpu_count_logical() -> int | None: ...
def cpu_freq() -> tuple[int, int]: ...
Expand Down