Skip to content
Merged
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
1 change: 0 additions & 1 deletion stubs/psutil/@tests/stubtest_allowlist_win32.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
psutil._pslinux
psutil._psosx

psutil._psutil_linux
psutil._psutil_osx
psutil._psutil_posix
5 changes: 4 additions & 1 deletion stubs/psutil/psutil/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import sys
from _typeshed import Incomplete
from collections.abc import Callable, Iterable, Iterator
from contextlib import AbstractContextManager
from types import TracebackType
from typing import Any, Literal, Protocol, overload, type_check_only
from typing_extensions import Self, TypeAlias, deprecated

Expand Down Expand Up @@ -230,7 +231,9 @@ class Process:
class Popen(Process):
def __init__(self, *args, **kwargs) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(self, *args: object, **kwargs: object) -> None: ...
def __exit__(
self, exc_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
) -> None: ...
def __getattribute__(self, name: str) -> Any: ...
def __dir__(self) -> list[str]: ...

Expand Down
2 changes: 1 addition & 1 deletion stubs/psutil/psutil/_common.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def memoize_when_activated(fun: _Func) -> _Func: ...
def isfile_strict(path: StrOrBytesPath) -> bool: ...
def path_exists_strict(path: StrOrBytesPath) -> bool: ...
def supports_ipv6() -> bool: ...
def parse_environ_block(data): ...
def parse_environ_block(data: str) -> dict[str, str]: ...
def sockfam_to_enum(num: int) -> AddressFamily: ...
def socktype_to_enum(num: int) -> SocketKind: ...
@overload
Expand Down
191 changes: 100 additions & 91 deletions stubs/psutil/psutil/_psutil_windows.pyi
Original file line number Diff line number Diff line change
@@ -1,94 +1,103 @@
from typing import Final
import sys

ABOVE_NORMAL_PRIORITY_CLASS: Final = 32768
BELOW_NORMAL_PRIORITY_CLASS: Final = 16384
ERROR_ACCESS_DENIED: int
ERROR_INVALID_NAME: int
ERROR_PRIVILEGE_NOT_HELD: int
ERROR_SERVICE_DOES_NOT_EXIST: int
HIGH_PRIORITY_CLASS: Final = 128
IDLE_PRIORITY_CLASS: Final = 64
INFINITE: int
MIB_TCP_STATE_CLOSED: int
MIB_TCP_STATE_CLOSE_WAIT: int
MIB_TCP_STATE_CLOSING: int
MIB_TCP_STATE_DELETE_TCB: int
MIB_TCP_STATE_ESTAB: int
MIB_TCP_STATE_FIN_WAIT1: int
MIB_TCP_STATE_FIN_WAIT2: int
MIB_TCP_STATE_LAST_ACK: int
MIB_TCP_STATE_LISTEN: int
MIB_TCP_STATE_SYN_RCVD: int
MIB_TCP_STATE_SYN_SENT: int
MIB_TCP_STATE_TIME_WAIT: int
NORMAL_PRIORITY_CLASS: Final = 32
PSUTIL_CONN_NONE: int
REALTIME_PRIORITY_CLASS: Final = 256
WINDOWS_10: int
WINDOWS_7: int
WINDOWS_8: int
WINDOWS_8_1: int
WINDOWS_VISTA: int
WINVER: int
version: int
if sys.platform == "win32":
from collections.abc import Sequence
from socket import AddressFamily, SocketKind
from typing import Final

class TimeoutAbandoned(Exception): ...
class TimeoutExpired(Exception): ...
version: Final[int]
ABOVE_NORMAL_PRIORITY_CLASS: Final = 32768
BELOW_NORMAL_PRIORITY_CLASS: Final = 16384
HIGH_PRIORITY_CLASS: Final = 128
IDLE_PRIORITY_CLASS: Final = 64
NORMAL_PRIORITY_CLASS: Final = 32
REALTIME_PRIORITY_CLASS: Final = 256
MIB_TCP_STATE_CLOSED: Final = 1
MIB_TCP_STATE_CLOSING: Final = 9
MIB_TCP_STATE_CLOSE_WAIT: Final = 8
MIB_TCP_STATE_LISTEN: Final = 2
MIB_TCP_STATE_ESTAB: Final = 5
MIB_TCP_STATE_SYN_SENT: Final = 3
MIB_TCP_STATE_SYN_RCVD: Final = 4
MIB_TCP_STATE_FIN_WAIT1: Final = 6
MIB_TCP_STATE_FIN_WAIT2: Final = 7
MIB_TCP_STATE_LAST_ACK: Final = 10
MIB_TCP_STATE_TIME_WAIT: Final = 11
MIB_TCP_STATE_DELETE_TCB: Final = 12
PSUTIL_CONN_NONE: Final = 128
INFINITE: Final[int]
ERROR_ACCESS_DENIED: Final = 5
ERROR_INVALID_NAME: Final = 123
ERROR_SERVICE_DOES_NOT_EXIST: Final = 1060
ERROR_PRIVILEGE_NOT_HELD: Final = 1314
WINVER: Final[int]
WINDOWS_VISTA: Final = 60
WINDOWS_7: Final = 61
WINDOWS_8: Final = 62
WINDOWS_8_1: Final = 63
WINDOWS_10: Final = 100

def QueryDosDevice(*args, **kwargs): ... # incomplete
def boot_time(*args, **kwargs): ... # incomplete
def check_pid_range(pid: int, /) -> None: ...
def cpu_count_cores(*args, **kwargs): ... # incomplete
def cpu_count_logical(*args, **kwargs): ... # incomplete
def cpu_freq(*args, **kwargs): ... # incomplete
def cpu_stats(*args, **kwargs): ... # incomplete
def cpu_times(*args, **kwargs): ... # incomplete
def disk_io_counters(*args, **kwargs): ... # incomplete
def disk_partitions(*args, **kwargs): ... # incomplete
def disk_usage(*args, **kwargs): ... # incomplete
def getloadavg(*args, **kwargs): ... # incomplete
def getpagesize(*args, **kwargs): ... # incomplete
def init_loadavg_counter(*args, **kwargs): ... # incomplete
def net_connections(*args, **kwargs): ... # incomplete
def net_if_addrs(*args, **kwargs): ... # incomplete
def net_if_stats(*args, **kwargs): ... # incomplete
def net_io_counters(*args, **kwargs): ... # incomplete
def per_cpu_times(*args, **kwargs): ... # incomplete
def pid_exists(*args, **kwargs): ... # incomplete
def pids(*args, **kwargs): ... # incomplete
def ppid_map(*args, **kwargs): ... # incomplete
def proc_cmdline(*args, **kwargs): ... # incomplete
def proc_cpu_affinity_get(*args, **kwargs): ... # incomplete
def proc_cpu_affinity_set(*args, **kwargs): ... # incomplete
def proc_cwd(*args, **kwargs): ... # incomplete
def proc_environ(*args, **kwargs): ... # incomplete
def proc_exe(*args, **kwargs): ... # incomplete
def proc_info(*args, **kwargs): ... # incomplete
def proc_io_counters(*args, **kwargs): ... # incomplete
def proc_io_priority_get(*args, **kwargs): ... # incomplete
def proc_io_priority_set(*args, **kwargs): ... # incomplete
def proc_is_suspended(*args, **kwargs): ... # incomplete
def proc_kill(*args, **kwargs): ... # incomplete
def proc_memory_info(*args, **kwargs): ... # incomplete
def proc_memory_maps(*args, **kwargs): ... # incomplete
def proc_memory_uss(*args, **kwargs): ... # incomplete
def proc_num_handles(*args, **kwargs): ... # incomplete
def proc_open_files(*args, **kwargs): ... # incomplete
def proc_priority_get(*args, **kwargs): ... # incomplete
def proc_priority_set(*args, **kwargs): ... # incomplete
def proc_suspend_or_resume(*args, **kwargs): ... # incomplete
def proc_threads(*args, **kwargs): ... # incomplete
def proc_times(*args, **kwargs): ... # incomplete
def proc_username(*args, **kwargs): ... # incomplete
def proc_wait(*args, **kwargs): ... # incomplete
def sensors_battery(*args, **kwargs): ... # incomplete
def set_debug(*args, **kwargs): ... # incomplete
def swap_percent(*args, **kwargs): ... # incomplete
def users(*args, **kwargs): ... # incomplete
def virtual_mem(*args, **kwargs): ... # incomplete
def winservice_enumerate(*args, **kwargs): ... # incomplete
def winservice_query_config(*args, **kwargs): ... # incomplete
def winservice_query_descr(*args, **kwargs): ... # incomplete
def winservice_query_status(*args, **kwargs): ... # incomplete
def winservice_start(*args, **kwargs): ... # incomplete
def winservice_stop(*args, **kwargs): ... # incomplete
class TimeoutAbandoned(Exception): ...
class TimeoutExpired(Exception): ...

def proc_cmdline(pid: int, use_peb: bool = True) -> list[str]: ...
def proc_cpu_affinity_get(pid: int, /) -> int: ...
def proc_cpu_affinity_set(pid: int, mask: int, /) -> None: ...
def proc_cwd(pid: int, /) -> str: ...
def proc_environ(pid: int, /) -> str: ...
def proc_exe(pid: int, /) -> str: ...
def proc_io_counters(pid: int, /) -> tuple[int, int, int, int, int, int]: ...
def proc_io_priority_get(pid: int, /) -> int: ...
def proc_io_priority_set(pid: int, priority: int, /) -> None: ...
def proc_is_suspended(pid: int, /) -> bool: ...
def proc_kill(pid: int, /) -> None: ...
def proc_memory_info(pid: int, /) -> tuple[int, int, int, int, int, int, int, int, int, int]: ...
def proc_memory_maps(pid: int, /) -> list[tuple[int, str, str, int]]: ...
def proc_memory_uss(pid: int, /) -> int: ...
def proc_num_handles(pid: int, /) -> int: ...
def proc_open_files(pid: int, /) -> list[str]: ...
def proc_priority_get(pid: int, /) -> int: ...
def proc_priority_set(pid: int, priority: int, /) -> None: ...
def proc_suspend_or_resume(pid: int, suspend: bool | None, /) -> None: ...
def proc_threads(pid: int, /) -> list[tuple[int, float, float]]: ...
def proc_times(pid: int, /) -> tuple[float, float, float]: ...
def proc_username(pid: int, /) -> tuple[str, str]: ...
def proc_wait(pid: int, timeout: int, /) -> int | None: ...
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 cpu_count_cores() -> int | None: ...
def cpu_count_logical() -> int | None: ...
def cpu_freq() -> tuple[int, int]: ...
def cpu_stats() -> tuple[int, int, int, int]: ...
def cpu_times() -> tuple[float, float, float]: ...
def disk_io_counters() -> dict[str, tuple[int, int, int, int, int, int]]: ...
def disk_partitions(all: bool, /) -> list[tuple[str, str, str, str]]: ...
def disk_usage(path: str, /) -> tuple[int, int, int]: ...
def getloadavg() -> tuple[float, float, float]: ...
def getpagesize() -> int: ...
def swap_percent() -> float: ...
def init_loadavg_counter() -> None: ...
def net_connections(
pid: int, af_filter: Sequence[AddressFamily | int | None], type_filter: Sequence[SocketKind | int | None], /
) -> list[tuple[int, int, int, tuple[str | None, int], tuple[str | None, int], int, int]]: ...
def net_if_addrs() -> list[tuple[str, int, str, str | None, None, None]]: ...
def net_if_stats() -> dict[str, tuple[bool, int, int, int]]: ...
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, float]]: ...
def pid_exists(pid: int, /) -> bool: ...
def pids() -> list[int]: ...
def ppid_map() -> dict[int, int]: ...
def sensors_battery() -> tuple[int, int, int, int]: ...
def users() -> list[tuple[str, str | None, float]]: ...
def virtual_mem() -> tuple[int, int, int, int]: ...
def winservice_enumerate() -> list[tuple[str, str]]: ...
def winservice_query_config(service_name: str, /) -> tuple[str, str, str, str]: ...
def winservice_query_descr(service_name: str, /) -> str: ...
def winservice_query_status(service_name: str, /) -> tuple[str, int] | str: ...
def winservice_start(service_name: str, /) -> None: ...
def winservice_stop(service_name: str, /) -> None: ...
def QueryDosDevice(device_path: str, /) -> str: ...
def check_pid_range(pid: int, /) -> None: ...
def set_debug(value: bool, /) -> None: ...
Loading