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
3 changes: 3 additions & 0 deletions stubs/psutil/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ psutil.__all__
psutil._psaix
psutil._psbsd
psutil._pssunos
psutil._psutil_aix
psutil._psutil_bsd
psutil._psutil_sunos

# Test utilities
psutil.tests.*
Expand Down
2 changes: 1 addition & 1 deletion stubs/psutil/@tests/stubtest_allowlist_darwin.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
psutil._pslinux
psutil._pswindows
psutil._psutil_linux
psutil._psutil_windows
psutil._pswindows

# not always available on ARM64, but we test there
psutil.cpu_freq
Expand Down
4 changes: 2 additions & 2 deletions stubs/psutil/@tests/stubtest_allowlist_linux.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
psutil._psosx
psutil._psutil_windows
psutil._psutil_osx
psutil._pswindows
psutil._psutil_osx
psutil._psutil_windows
5 changes: 2 additions & 3 deletions stubs/psutil/@tests/stubtest_allowlist_win32.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
psutil._pslinux
psutil._psosx
psutil._psutil_linux
psutil._pslinux
psutil._psutil_osx
psutil._psutil_posix
psutil._psutil_linux
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.1.1"
version = "7.1.3"
upstream_repository = "https://github.com/giampaolo/psutil"

[tool.stubtest]
Expand Down
1 change: 0 additions & 1 deletion stubs/psutil/psutil/_psbsd.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ INIT_BOOT_TIME: float
def adjust_proc_create_time(ctime: float) -> float: ...
def pids(): ...
def pid_exists(pid): ...
def is_zombie(pid): ...
def wrap_exceptions(fun): ...
def wrap_exceptions_procfs(inst) -> AbstractContextManager[None]: ...

Expand Down
5 changes: 2 additions & 3 deletions stubs/psutil/psutil/_psosx.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if sys.platform == "darwin":
usage_percent as usage_percent,
)

from . import _common, _psposix, _psutil_osx, _psutil_posix
from . import _common, _psposix, _psutil_osx

_P = ParamSpec("_P")
_R = TypeVar("_R")
Expand Down Expand Up @@ -75,7 +75,7 @@ if sys.platform == "darwin":
def sensors_battery() -> _common.sbattery | None: ...

net_io_counters = _psutil_osx.net_io_counters
net_if_addrs = _psutil_posix.net_if_addrs
net_if_addrs = _psutil_osx.net_if_addrs
def net_connections(kind: str = "inet") -> list[_common.sconn]: ...
def net_if_stats() -> dict[str, _common.snicstats]: ...
def boot_time() -> float: ...
Expand All @@ -85,7 +85,6 @@ if sys.platform == "darwin":
def pids() -> list[int]: ...
pid_exists = _psposix.pid_exists
def wrap_exceptions(fun: Callable[_P, _R]) -> Callable[_P, _R]: ...
def is_zombie(pid: int) -> bool: ...

class Process:
__slots__ = ["_cache", "_name", "_ppid", "pid"]
Expand Down
53 changes: 53 additions & 0 deletions stubs/psutil/psutil/_psutil_aix.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
from _typeshed import Incomplete

# TODO: Add POSIX constants and check their aviability (see psutil_posix_add_constants)
AF_LINK: Incomplete

def getpagesize() -> int: ...
def net_if_addrs(): ...
def net_if_flags(nic_name: str, /) -> list[str]: ...
def net_if_is_running(nic_name: str, /) -> bool: ...
def net_if_mtu(nic_name: str, /) -> int: ...
def proc_priority_get(pid: int, /) -> int: ...
def proc_priority_set(pid: int, priority: int, /) -> None: ...

version: Incomplete
SIDL: Incomplete
SZOMB: Incomplete
SACTIVE: Incomplete
SSWAP: Incomplete
SSTOP: Incomplete
TCPS_CLOSED: Incomplete
TCPS_CLOSING: Incomplete
TCPS_CLOSE_WAIT: Incomplete
TCPS_LISTEN: Incomplete
TCPS_ESTABLISHED: Incomplete
TCPS_SYN_SENT: Incomplete
TCPS_SYN_RCVD: Incomplete
TCPS_FIN_WAIT_1: Incomplete
TCPS_FIN_WAIT_2: Incomplete
TCPS_LAST_ACK: Incomplete
TCPS_TIME_WAIT: Incomplete
PSUTIL_CONN_NONE: Incomplete

def proc_args(pid: int, /) -> list[str]: ...
def proc_basic_info(pid: int, procfs_path: str, /): ...
def proc_cpu_times(pid: int, procfs_path: str, /): ...
def proc_cred(pid: int, procfs_path: str, /): ...
def proc_environ(pid: int, /): ...
def proc_name(pid: int, procfs_path: str, /): ...
def proc_threads(pid: int, /): ...
def proc_io_counters(pid: int, /): ...
def proc_num_ctx_switches(requested_pid: int, /): ...
def boot_time(): ...
def disk_io_counters(): ...
def disk_partitions(): ...
def per_cpu_times(): ...
def swap_mem(): ...
def virtual_mem(): ...
def net_io_counters(): ...
def cpu_stats(): ...
def net_connections(requested_pid: int, /): ...
def net_if_stats(nic_name: str, /): ...
def check_pid_range(pid: int, /) -> None: ...
def set_debug(value: bool, /) -> None: ...
73 changes: 73 additions & 0 deletions stubs/psutil/psutil/_psutil_bsd.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
from _typeshed import Incomplete

# TODO: Add POSIX constants and check their aviability (see psutil_posix_add_constants)
AF_LINK: Incomplete

def getpagesize() -> int: ...
def net_if_addrs(): ...
def net_if_flags(nic_name: str, /) -> list[str]: ...
def net_if_is_running(nic_name: str, /) -> bool: ...
def net_if_mtu(nic_name: str, /) -> int: ...
def proc_priority_get(pid: int, /) -> int: ...
def proc_priority_set(pid: int, priority: int, /) -> None: ...
def net_if_duplex_speed(nic_name: str, /): ...
def proc_is_zombie(pid: int, /) -> bool: ...

SIDL: Incomplete
SRUN: Incomplete
SSLEEP: Incomplete
SSTOP: Incomplete
SZOMB: Incomplete
SWAIT: Incomplete # only FreeBSD
SLOCK: Incomplete # only FreeBSD
SDEAD: Incomplete # only OpenBSD and NetBSD
SONPROC: Incomplete # only OpenBSD and NetBSD
SSUSPENDED: Incomplete # only NetBSD
TCPS_CLOSED: Incomplete
TCPS_CLOSING: Incomplete
TCPS_CLOSE_WAIT: Incomplete
TCPS_LISTEN: Incomplete
TCPS_ESTABLISHED: Incomplete
TCPS_SYN_SENT: Incomplete
TCPS_SYN_RECEIVED: Incomplete
TCPS_FIN_WAIT_1: Incomplete
TCPS_FIN_WAIT_2: Incomplete
TCPS_LAST_ACK: Incomplete
TCPS_TIME_WAIT: Incomplete
PSUTIL_CONN_NONE: Incomplete

def proc_cmdline(*args, **kwargs): ...
def proc_cwd(*args, **kwargs): ...
def proc_environ(*args, **kwargs): ...
def proc_name(*args, **kwargs): ...
def proc_num_fds(*args, **kwargs): ...
def proc_oneshot_info(*args, **kwargs): ...
def proc_open_files(*args, **kwargs): ...
def proc_threads(*args, **kwargs): ...
def proc_num_threads(*args, **kwargs): ... # only FreeBSD and OpenBSD
def proc_cpu_affinity_get(*args, **kwargs): ... # only FreeBSD
def proc_cpu_affinity_set(*args, **kwargs): ... # only FreeBSD
def proc_exe(*args, **kwargs): ... # only FreeBSD
def proc_getrlimit(*args, **kwargs): ... # only FreeBSD
def proc_memory_maps(*args, **kwargs): ... # only FreeBSD
def proc_net_connections(*args, **kwargs): ... # only FreeBSD
def proc_setrlimit(*args, **kwargs): ... # only FreeBSD
def boot_time(*args, **kwargs): ...
def cpu_count_logical(*args, **kwargs): ...
def cpu_stats(*args, **kwargs): ...
def cpu_times(*args, **kwargs): ...
def disk_io_counters(*args, **kwargs): ...
def disk_partitions(*args, **kwargs): ...
def net_connections(*args, **kwargs): ...
def net_io_counters(*args, **kwargs): ...
def per_cpu_times(*args, **kwargs): ...
def pids(*args, **kwargs): ...
def swap_mem(*args, **kwargs): ...
def users(*args, **kwargs): ...
def virtual_mem(*args, **kwargs): ...
def cpu_freq(*args, **kwargs): ... # only FreeBSD and OpenBSD
def cpu_topology(*args, **kwargs): ... # only FreeBSD
def sensors_battery(*args, **kwargs): ... # only FreeBSD
def sensors_cpu_temperature(*args, **kwargs): ... # only FreeBSD
def check_pid_range(*args, **kwargs): ...
def set_debug(*args, **kwargs): ...
49 changes: 40 additions & 9 deletions stubs/psutil/psutil/_psutil_linux.pyi
Original file line number Diff line number Diff line change
@@ -1,14 +1,45 @@
from _typeshed import Incomplete
from typing import Final

# TODO: Add POSIX constants and check their aviability (see psutil_posix_add_constants)
RLIM_INFINITY: Final[int]
RLIMIT_AS: Final[int]
RLIMIT_CORE: Final[int]
RLIMIT_CPU: Final[int]
RLIMIT_DATA: Final[int]
RLIMIT_FSIZE: Final[int]
RLIMIT_LOCKS: Final[int]
RLIMIT_MEMLOCK: Final[int]
RLIMIT_MSGQUEUE: Final[int]
RLIMIT_NICE: Final[int]
RLIMIT_NOFILE: Final[int]
RLIMIT_NPROC: Final[int]
RLIMIT_RSS: Final[int]
RLIMIT_RTPRIO: Final[int]
RLIMIT_RTTIME: Final[int]
RLIMIT_SIGPENDING: Final[int]
RLIMIT_STACK: Final[int]

def getpagesize() -> int: ...
def net_if_addrs(): ...
def net_if_flags(nic_name: str, /) -> list[str]: ...
def net_if_is_running(nic_name: str, /) -> bool: ...
def net_if_mtu(nic_name: str, /) -> int: ...
def proc_priority_get(pid: int, /) -> int: ...
def proc_priority_set(pid: int, priority: int, /) -> None: ...
def users() -> list[tuple[Incomplete, ...]]: ...

version: int
DUPLEX_FULL: int
DUPLEX_HALF: int
DUPLEX_UNKNOWN: int
version: int

def check_pid_range(pid: int, /) -> None: ...
def disk_partitions(*args, **kwargs): ...
def linux_sysinfo(*args, **kwargs): ...
def net_if_duplex_speed(*args, **kwargs): ...
def proc_cpu_affinity_get(*args, **kwargs): ...
def proc_cpu_affinity_set(*args, **kwargs): ...
def proc_ioprio_get(*args, **kwargs): ...
def proc_ioprio_get(pid: int, /): ...
def proc_ioprio_set(*args, **kwargs): ...
def set_debug(*args, **kwargs): ...
def proc_cpu_affinity_get(pid: int, /): ...
def proc_cpu_affinity_set(*args, **kwargs): ...
def disk_partitions(mtab_path: str, /): ...
def net_if_duplex_speed(nic_name: str, /): ...
def linux_sysinfo() -> tuple[int, int, int, int, int, int, int]: ...
def check_pid_range(pid: int, /) -> None: ...
def set_debug(value: bool, /) -> None: ...
16 changes: 15 additions & 1 deletion stubs/psutil/psutil/_psutil_osx.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
import sys

if sys.platform == "darwin":
from _typeshed import StrOrBytesPath
from _typeshed import Incomplete, StrOrBytesPath
from collections.abc import Sequence
from socket import AddressFamily, SocketKind
from typing import Final, TypeVar

_T = TypeVar("_T")

# TODO: Add POSIX constants and check their aviability (see psutil_posix_add_constants)
AF_LINK: Incomplete

def getpagesize() -> int: ...
def net_if_addrs(): ...
def net_if_flags(nic_name: str, /) -> list[str]: ...
def net_if_is_running(nic_name: str, /) -> bool: ...
def net_if_mtu(nic_name: str, /) -> int: ...
def proc_priority_get(pid: int, /) -> int: ...
def proc_priority_set(pid: int, priority: int, /) -> None: ...
def net_if_duplex_speed(nic_name: str, /): ...
def users() -> list[tuple[Incomplete, ...]]: ...
def proc_is_zombie(pid: int, /) -> bool: ...

version: Final[int]
SIDL: Final = 1
SRUN: Final = 2
Expand Down
36 changes: 0 additions & 36 deletions stubs/psutil/psutil/_psutil_posix.pyi

This file was deleted.

59 changes: 59 additions & 0 deletions stubs/psutil/psutil/_psutil_sunos.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
from _typeshed import Incomplete

# TODO: Add POSIX constants and check their aviability (see psutil_posix_add_constants)
AF_LINK: Incomplete

def getpagesize() -> int: ...
def net_if_addrs(): ...
def net_if_flags(nic_name: str, /) -> list[str]: ...
def net_if_is_running(nic_name: str, /) -> bool: ...
def net_if_mtu(nic_name: str, /) -> int: ...
def proc_priority_get(pid: int, /) -> int: ...
def proc_priority_set(pid: int, priority: int, /) -> None: ...
def users() -> list[tuple[Incomplete, ...]]: ...

version: Incomplete
SSLEEP: Incomplete
SRUN: Incomplete
SZOMB: Incomplete
SSTOP: Incomplete
SIDL: Incomplete
SONPROC: Incomplete
SWAIT: Incomplete
PRNODEV: Incomplete
TCPS_CLOSED: Incomplete
TCPS_CLOSING: Incomplete
TCPS_CLOSE_WAIT: Incomplete
TCPS_LISTEN: Incomplete
TCPS_ESTABLISHED: Incomplete
TCPS_SYN_SENT: Incomplete
TCPS_SYN_RCVD: Incomplete
TCPS_FIN_WAIT_1: Incomplete
TCPS_FIN_WAIT_2: Incomplete
TCPS_LAST_ACK: Incomplete
TCPS_TIME_WAIT: Incomplete
TCPS_IDLE: Incomplete
TCPS_BOUND: Incomplete
PSUTIL_CONN_NONE: Incomplete

def proc_basic_info(pid: int, procfs_path: str, /) -> tuple[Incomplete, ...]: ...
def proc_cpu_num(pid: int, procfs_path: str, /): ...
def proc_cpu_times(pid: int, procfs_path: str, /): ...
def proc_cred(pid: int, procfs_path: str, /): ...
def proc_environ(pid: int, procfs_path: str, /): ...
def proc_memory_maps(pid: int, procfs_path: str, /): ...
def proc_name_and_args(pid: int, procfs_path: str, /): ...
def proc_num_ctx_switches(pid: int, procfs_path: str, /): ...
def query_process_thread(pid: int, tid: int, procfs_path: str, /): ...
def boot_time(): ...
def cpu_count_cores(): ...
def cpu_stats(): ...
def disk_io_counters(): ...
def disk_partitions(): ...
def net_connections(pid: int, /): ...
def net_if_stats(): ...
def net_io_counters(): ...
def per_cpu_times(): ...
def swap_mem(): ...
def check_pid_range(pid: int, /): ...
def set_debug(value: bool, /) -> None: ...