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: 0 additions & 3 deletions stubs/psutil/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# TODO: missing from stub
psutil.__all__

# Stubtest does not support these platforms
psutil._psaix
psutil._psbsd
Expand Down
1 change: 1 addition & 0 deletions stubs/psutil/@tests/stubtest_allowlist_darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ psutil._psutil_windows
# not always available on ARM64, but we test there
psutil.cpu_freq
psutil._psosx.cpu_freq
psutil.__all__ # cpu_freq is only added to __all__ at runtime when it is available
126 changes: 126 additions & 0 deletions stubs/psutil/psutil/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,132 @@ from psutil._common import (

from . import _ntuples as _ntp

__all__ = [
# exceptions
"Error",
"NoSuchProcess",
"ZombieProcess",
"AccessDenied",
"TimeoutExpired",
# constants
"version_info",
"__version__",
"STATUS_RUNNING",
"STATUS_IDLE",
"STATUS_SLEEPING",
"STATUS_DISK_SLEEP",
"STATUS_STOPPED",
"STATUS_TRACING_STOP",
"STATUS_ZOMBIE",
"STATUS_DEAD",
"STATUS_WAKING",
"STATUS_LOCKED",
"STATUS_WAITING",
"STATUS_PARKED",
"CONN_ESTABLISHED",
"CONN_SYN_SENT",
"CONN_SYN_RECV",
"CONN_FIN_WAIT1",
"CONN_FIN_WAIT2",
"CONN_TIME_WAIT",
"CONN_CLOSE",
"CONN_CLOSE_WAIT",
"CONN_LAST_ACK",
"CONN_LISTEN",
"CONN_CLOSING",
"CONN_NONE",
"AF_LINK",
"NIC_DUPLEX_FULL",
"NIC_DUPLEX_HALF",
"NIC_DUPLEX_UNKNOWN",
"POWER_TIME_UNKNOWN",
"POWER_TIME_UNLIMITED",
"BSD",
"FREEBSD",
"LINUX",
"NETBSD",
"OPENBSD",
"MACOS",
"OSX",
"POSIX",
"SUNOS",
"WINDOWS",
"AIX",
# classes
"Process",
"Popen",
# functions
"pid_exists",
"pids",
"process_iter",
"wait_procs",
"virtual_memory",
"swap_memory",
"cpu_times",
"cpu_percent",
"cpu_times_percent",
"cpu_count",
"cpu_stats",
"cpu_freq",
"getloadavg",
"net_io_counters",
"net_connections",
"net_if_addrs",
"net_if_stats",
"disk_io_counters",
"disk_partitions",
"disk_usage",
"sensors_battery",
"users",
"boot_time",
"heap_info",
"heap_trim",
]

if sys.platform == "linux":
__all__ += [
"PROCFS_PATH",
"IOPRIO_CLASS_NONE",
"IOPRIO_CLASS_RT",
"IOPRIO_CLASS_BE",
"IOPRIO_CLASS_IDLE",
"RLIMIT_AS",
"RLIMIT_CORE",
"RLIMIT_CPU",
"RLIMIT_DATA",
"RLIMIT_FSIZE",
"RLIMIT_LOCKS",
"RLIMIT_MEMLOCK",
"RLIMIT_MSGQUEUE",
"RLIMIT_NICE",
"RLIMIT_NOFILE",
"RLIMIT_NPROC",
"RLIMIT_RSS",
"RLIMIT_RTPRIO",
"RLIMIT_RTTIME",
"RLIMIT_SIGPENDING",
"RLIMIT_STACK",
"RLIM_INFINITY",
"sensors_temperatures",
"sensors_fans",
]
elif sys.platform == "win32":
__all__ += [
"win_service_iter",
"win_service_get",
"ABOVE_NORMAL_PRIORITY_CLASS",
"BELOW_NORMAL_PRIORITY_CLASS",
"HIGH_PRIORITY_CLASS",
"IDLE_PRIORITY_CLASS",
"NORMAL_PRIORITY_CLASS",
"REALTIME_PRIORITY_CLASS",
"IOPRIO_VERYLOW",
"IOPRIO_LOW",
"IOPRIO_NORMAL",
"IOPRIO_HIGH",
"CONN_DELETE_TCB",
]

if sys.platform == "linux":
from ._pslinux import (
IOPRIO_CLASS_BE as IOPRIO_CLASS_BE,
Expand Down