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
2 changes: 1 addition & 1 deletion stubs/psutil/psutil/_psaix.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darw
def open_files(self) -> list[_common.popenfile]: ...
def num_fds(self) -> int: ...
def num_ctx_switches(self) -> _common.pctxsw: ...
def wait(self, timeout: float | None = None): ...
def wait(self, timeout: float | None = None) -> int | None: ...
def io_counters(self) -> _common.pio: ...
2 changes: 1 addition & 1 deletion stubs/psutil/psutil/_psbsd.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darw
def num_ctx_switches(self) -> _common.pctxsw: ...
def threads(self) -> list[_common.pthread]: ...
def net_connections(self, kind: str = "inet") -> list[_common.pconn]: ...
def wait(self, timeout: float | None = None): ...
def wait(self, timeout: float | None = None) -> int | None: ...
def nice_get(self) -> int: ...
def nice_set(self, value: int) -> None: ...
def status(self) -> str: ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/psutil/psutil/_pslinux.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ if sys.platform == "linux":
def io_counters(self) -> pio: ...
def cpu_times(self) -> pcputimes: ...
def cpu_num(self) -> int: ...
def wait(self, timeout: float | None = None): ...
def wait(self, timeout: float | None = None) -> int | None: ...
def create_time(self, monotonic: bool = False) -> float: ...
def memory_info(self) -> pmem: ...
def memory_full_info(self) -> pfullmem: ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/psutil/psutil/_psosx.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ if sys.platform == "darwin":
def open_files(self) -> list[_common.popenfile]: ...
def net_connections(self, kind: str = "inet"): ...
def num_fds(self) -> int: ...
def wait(self, timeout: float | None = None): ...
def wait(self, timeout: float | None = None) -> int | None: ...
def nice_get(self): ...
def nice_set(self, value): ...
def status(self) -> str: ...
Expand Down
68 changes: 61 additions & 7 deletions stubs/psutil/psutil/_psposix.pyi
Original file line number Diff line number Diff line change
@@ -1,19 +1,73 @@
import enum
import sys
from _typeshed import FileDescriptorOrPath, StrOrBytesPath
from _typeshed import FileDescriptorOrPath, Incomplete, StrOrBytesPath, Unused
from collections.abc import Callable

from ._common import sdiskusage

def pid_exists(pid: int) -> bool: ...

# Sync with `signal.Signals`, but with opposite values:
class Negsignal(enum.IntEnum):
SIGABRT = -6
SIGFPE = -8
SIGILL = -4
SIGINT = -2
SIGSEGV = -11
SIGTERM = -15

if sys.platform == "win32":
SIGBREAK = -21
CTRL_C_EVENT = 0
CTRL_BREAK_EVENT = -1
else:
SIGALRM = -14
SIGBUS = -7
SIGCHLD = -17
SIGCONT = -18
SIGHUP = -1
SIGIO = -29
SIGIOT = -6
SIGKILL = -9
SIGPIPE = -13
SIGPROF = -27
SIGQUIT = -3
SIGSTOP = -19
SIGSYS = -31
SIGTRAP = -5
SIGTSTP = -20
SIGTTIN = -21
SIGTTOU = -22
SIGURG = -23
SIGUSR1 = -10
SIGUSR2 = -12
SIGVTALRM = -26
SIGWINCH = -28
SIGXCPU = -24
SIGXFSZ = -25
if sys.platform != "linux":
SIGEMT = -7
SIGINFO = -29
if sys.platform != "darwin":
SIGCLD = -17
SIGPOLL = -29
SIGPWR = -30
SIGRTMAX = -64
SIGRTMIN = -34
if sys.version_info >= (3, 11):
SIGSTKFLT = -16

def negsig_to_enum(num: int) -> int: ...
def wait_pid(
pid: int,
timeout: float | None = None,
proc_name: str | None = None,
_waitpid=...,
_timer=...,
_min=...,
_sleep=...,
_pid_exists=...,
): ...
_waitpid: Unused = ...,
_timer: Callable[[], float] = ...,
_min: Callable[..., Incomplete] = ...,
_sleep: Callable[[float], None] = ...,
_pid_exists: Callable[[int], bool] = ...,
) -> int | None: ...

if sys.platform == "darwin":
def disk_usage(path: StrOrBytesPath) -> sdiskusage: ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/psutil/psutil/_pssunos.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darw
def memory_maps(self) -> list[tuple[str, str, str, int, int, int]]: ...
def num_fds(self) -> int: ...
def num_ctx_switches(self) -> _common.pctxsw: ...
def wait(self, timeout: float | None = None): ...
def wait(self, timeout: float | None = None) -> int | None: ...
2 changes: 1 addition & 1 deletion stubs/psutil/psutil/_psutil_aix.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darw
AF_LINK: Final = 18

def getpagesize() -> int: ...
def net_if_addrs(): ...
def net_if_addrs() -> list[tuple[str, int, str, str | None, str | None, str | None]]: ...
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: ...
Expand Down
4 changes: 2 additions & 2 deletions stubs/psutil/psutil/_psutil_bsd.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darw
RLIM_INFINITY: Final[int] # only FreeBSD

def getpagesize() -> int: ...
def net_if_addrs(): ...
def net_if_addrs() -> list[tuple[str, int, str, str | None, str | None, str | None]]: ...
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 net_if_duplex_speed(nic_name: str, /) -> tuple[int, int]: ... # It's actually list of 2 elements
def proc_is_zombie(pid: int, /) -> bool: ...

version: Final[int]
Expand Down
5 changes: 2 additions & 3 deletions stubs/psutil/psutil/_psutil_linux.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import sys

if sys.platform == "linux":
from _typeshed import Incomplete
from collections.abc import Sequence
from typing import Final

Expand All @@ -24,13 +23,13 @@ if sys.platform == "linux":
RLIM_INFINITY: Final[int]

def getpagesize() -> int: ...
def net_if_addrs(): ...
def net_if_addrs() -> list[tuple[str, int, str, str | None, str | None, str | None]]: ...
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, ...]]: ...
def users() -> list[tuple[str, str, str, float, int]]: ...

version: Final[int]
DUPLEX_FULL: Final[int]
Expand Down
8 changes: 4 additions & 4 deletions stubs/psutil/psutil/_psutil_osx.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys

if sys.platform == "darwin":
from _typeshed import Incomplete, StrOrBytesPath
from _typeshed import StrOrBytesPath
from collections.abc import Sequence
from socket import AddressFamily, SocketKind
from typing import Final, TypeVar
Expand All @@ -11,14 +11,14 @@ if sys.platform == "darwin":
AF_LINK: Final = 18

def getpagesize() -> int: ...
def net_if_addrs(): ...
def net_if_addrs() -> list[tuple[str, int, str, str | None, str | None, str | None]]: ...
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 net_if_duplex_speed(nic_name: str, /) -> tuple[int, int]: ... # It's actually list of 2 elements
def users() -> list[tuple[str, str, str, float, int]]: ...
def proc_is_zombie(pid: int, /) -> bool: ...

version: Final[int]
Expand Down
5 changes: 2 additions & 3 deletions stubs/psutil/psutil/_psutil_sunos.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@ import sys

# sys.platform.startswith(("sunos", "solaris")):
if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin":
from _typeshed import Incomplete
from typing import Final

AF_LINK: Final[int]

def getpagesize() -> int: ...
def net_if_addrs(): ...
def net_if_addrs() -> list[tuple[str, int, str, str | None, str | None, str | None]]: ...
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, ...]]: ...
def users() -> list[tuple[str, str, str, float, int]]: ...

version: Final[int]
# They could be different between different versions of SunOS/Solaris:
Expand Down