From 4127c69a3ad79f42d1a66a0c029dae2dd7480d4d Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Fri, 4 Oct 2024 02:57:45 +0800 Subject: [PATCH] chore(pre-commit): update pre-commit hooks --- .pre-commit-config.yaml | 2 +- nvitop-exporter/nvitop_exporter/version.py | 2 ++ nvitop/callbacks/keras.py | 1 + nvitop/callbacks/lightning.py | 1 + nvitop/callbacks/pytorch_lightning.py | 1 + nvitop/gui/library/history.py | 2 ++ nvitop/gui/library/messagebox.py | 4 ++-- nvitop/gui/screens/main/__init__.py | 2 +- nvitop/gui/screens/main/process.py | 3 ++- nvitop/gui/ui.py | 1 + nvitop/version.py | 2 ++ 11 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 045beae7..78514e3d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: - id: debug-statements - id: double-quote-string-fixer - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.4 + rev: v0.6.8 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/nvitop-exporter/nvitop_exporter/version.py b/nvitop-exporter/nvitop_exporter/version.py index 2f7eb0a7..554090d1 100644 --- a/nvitop-exporter/nvitop_exporter/version.py +++ b/nvitop-exporter/nvitop_exporter/version.py @@ -16,6 +16,8 @@ # ============================================================================== """Prometheus exporter built on top of ``nvitop``.""" +# pylint: disable=invalid-name + __version__ = '1.3.2' __license__ = 'Apache-2.0' __author__ = __maintainer__ = 'Xuehai Pan' diff --git a/nvitop/callbacks/keras.py b/nvitop/callbacks/keras.py index fd2a101e..5fa108c9 100644 --- a/nvitop/callbacks/keras.py +++ b/nvitop/callbacks/keras.py @@ -94,6 +94,7 @@ class GpuStatsLogger(Callback): # pylint: disable=too-many-instance-attributes def __init__( # pylint: disable=too-many-arguments self, gpus: int | list[int | str] | tuple[int | str, ...], + *, memory_utilization: bool = True, gpu_utilization: bool = True, intra_step_time: bool = False, diff --git a/nvitop/callbacks/lightning.py b/nvitop/callbacks/lightning.py index cbc2da02..4442c075 100644 --- a/nvitop/callbacks/lightning.py +++ b/nvitop/callbacks/lightning.py @@ -89,6 +89,7 @@ class GpuStatsLogger(Callback): # pylint: disable=too-many-instance-attributes def __init__( # pylint: disable=too-many-arguments self, + *, memory_utilization: bool = True, gpu_utilization: bool = True, intra_step_time: bool = False, diff --git a/nvitop/callbacks/pytorch_lightning.py b/nvitop/callbacks/pytorch_lightning.py index dec3f4df..9c4d1118 100644 --- a/nvitop/callbacks/pytorch_lightning.py +++ b/nvitop/callbacks/pytorch_lightning.py @@ -89,6 +89,7 @@ class GpuStatsLogger(Callback): # pylint: disable=too-many-instance-attributes def __init__( # pylint: disable=too-many-arguments self, + *, memory_utilization: bool = True, gpu_utilization: bool = True, intra_step_time: bool = False, diff --git a/nvitop/gui/library/history.py b/nvitop/gui/library/history.py index cf389195..02d4fb28 100644 --- a/nvitop/gui/library/history.py +++ b/nvitop/gui/library/history.py @@ -58,6 +58,7 @@ def __init__( upperbound, width, height, + *, format='{:.1f}'.format, # pylint: disable=redefined-builtin max_format=None, baseline=0.0, @@ -301,6 +302,7 @@ def __init__( upperbound, width, height, + *, format='{:.1f}'.format, # pylint: disable=redefined-builtin max_format=None, baseline=0.0, diff --git a/nvitop/gui/library/messagebox.py b/nvitop/gui/library/messagebox.py index 01e16150..f044a16b 100644 --- a/nvitop/gui/library/messagebox.py +++ b/nvitop/gui/library/messagebox.py @@ -19,7 +19,7 @@ class MessageBox(Displayable): # pylint: disable=too-many-instance-attributes class Option: # pylint: disable=too-few-public-methods # pylint: disable-next=too-many-arguments - def __init__(self, name, key, callback, keys=(), attrs=()): + def __init__(self, name, key, callback, *, keys=(), attrs=()): self.name = WideString(name) self.offset = 0 self.key = normalize_keybinding(key) @@ -31,7 +31,7 @@ def __str__(self): return str(self.name) # pylint: disable-next=too-many-arguments - def __init__(self, message, options, default, yes, no, cancel, win, root): + def __init__(self, message, options, *, default, yes, no, cancel, win, root): super().__init__(win, root) if default is None: diff --git a/nvitop/gui/screens/main/__init__.py b/nvitop/gui/screens/main/__init__.py index 7c3567a0..17d95559 100644 --- a/nvitop/gui/screens/main/__init__.py +++ b/nvitop/gui/screens/main/__init__.py @@ -20,7 +20,7 @@ class MainScreen(DisplayableContainer): # pylint: disable=too-many-instance-att NAME = 'main' # pylint: disable-next=redefined-builtin,too-many-arguments,too-many-locals,too-many-statements - def __init__(self, devices, filters, ascii, mode, win, root): + def __init__(self, devices, filters, *, ascii, mode, win, root): super().__init__(win, root) self.width = root.width diff --git a/nvitop/gui/screens/main/process.py b/nvitop/gui/screens/main/process.py index c27d1bea..294978e8 100644 --- a/nvitop/gui/screens/main/process.py +++ b/nvitop/gui/screens/main/process.py @@ -123,7 +123,8 @@ class ProcessPanel(Displayable): # pylint: disable=too-many-instance-attributes ), } - def __init__(self, devices, compact, filters, win, root): # pylint: disable=too-many-arguments + # pylint: disable-next=too-many-arguments + def __init__(self, devices, compact, filters, *, win, root): super().__init__(win, root) self.devices = devices diff --git a/nvitop/gui/ui.py b/nvitop/gui/ui.py index 0f34a542..03b5e436 100644 --- a/nvitop/gui/ui.py +++ b/nvitop/gui/ui.py @@ -24,6 +24,7 @@ def __init__( self, devices, filters=(), + *, ascii=False, # pylint: disable=redefined-builtin mode='auto', interval=None, diff --git a/nvitop/version.py b/nvitop/version.py index 1cfe0425..a61e96c5 100644 --- a/nvitop/version.py +++ b/nvitop/version.py @@ -16,6 +16,8 @@ # ============================================================================== """An interactive NVIDIA-GPU process viewer and beyond, the one-stop solution for GPU process management.""" +# pylint: disable=invalid-name + __version__ = '1.3.2' __license__ = 'GPL-3.0-only AND Apache-2.0' __author__ = __maintainer__ = 'Xuehai Pan'