Skip to content

Added type hinting for psutil virtual memory stubs #8501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 7, 2022
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
9 changes: 5 additions & 4 deletions stubs/psutil/psutil/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,15 @@ if sys.platform == "win32":
)

if sys.platform == "linux":
from ._pslinux import pfullmem, pmem
from ._pslinux import pfullmem, pmem, svmem
elif sys.platform == "darwin":
from ._psosx import pfullmem, pmem
from ._psosx import pfullmem, pmem, svmem
elif sys.platform == "win32":
from ._pswindows import pfullmem, pmem
from ._pswindows import pfullmem, pmem, svmem
else:
class pmem(Any): ...
class pfullmem(Any): ...
class svmem(Any): ...

if sys.platform == "linux":
PROCFS_PATH: str
Expand Down Expand Up @@ -220,7 +221,7 @@ def cpu_times_percent(interval: float | None = ..., percpu: bool = ...): ...
def cpu_stats() -> scpustats: ...
def cpu_freq(percpu: bool = ...) -> scpufreq: ...
def getloadavg() -> tuple[float, float, float]: ...
def virtual_memory(): ...
def virtual_memory() -> svmem: ...
def swap_memory() -> sswap: ...
def disk_usage(path: str) -> sdiskusage: ...
def disk_partitions(all: bool = ...) -> list[sdiskpart]: ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/psutil/psutil/_psbsd.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class sdiskio(NamedTuple):
write_time: Any
busy_time: Any

def virtual_memory(): ...
def virtual_memory() -> svmem: ...
def swap_memory(): ...
def cpu_times(): ...
def per_cpu_times(): ...
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 @@ -121,7 +121,7 @@ scputimes: Any
prlimit: Any

def calculate_avail_vmem(mems): ...
def virtual_memory(): ...
def virtual_memory() -> svmem: ...
def swap_memory(): ...
def cpu_times(): ...
def per_cpu_times(): ...
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 @@ -43,7 +43,7 @@ class pmem(NamedTuple):

pfullmem: Any

def virtual_memory(): ...
def virtual_memory() -> svmem: ...
def swap_memory(): ...
def cpu_times(): ...
def per_cpu_times(): ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/psutil/psutil/_pswindows.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class pio(NamedTuple):
def convert_dos_path(s): ...
def py2_strencode(s): ...
def getpagesize(): ...
def virtual_memory(): ...
def virtual_memory() -> svmem: ...
def swap_memory(): ...

disk_io_counters: Any
Expand Down