Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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): ...
def memory_info(self): ...
def memory_full_info(self): ...
def memory_maps(self): ...
Expand Down
10 changes: 4 additions & 6 deletions stubs/psutil/psutil/_psosx.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,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

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 +104,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(*args, **kwargs) -> bool: ...
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.

It wasn't necessary, I just already typed it, so I decided to suggest it:

Suggested change
def has_cpu_freq(*args, **kwargs) -> bool: ...
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: ...
1 change: 1 addition & 0 deletions stubs/psutil/psutil/_psutil_posix.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ if sys.platform == "darwin":
AF_LINK: Final[int]
def net_if_duplex_speed(nic_name: str, /) -> list[int]: ...

def users(*args, **kwargs): ...
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def users(*args, **kwargs): ...
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