chore(pre-commit): update pre-commit hooks

This commit is contained in:
Xuehai Pan 2024-10-04 02:57:45 +08:00
parent 5522c9baf6
commit 4127c69a3a
11 changed files with 16 additions and 5 deletions

View file

@ -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]

View file

@ -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'

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -58,6 +58,7 @@ class HistoryGraph: # pylint: disable=too-many-instance-attributes
upperbound,
width,
height,
*,
format='{:.1f}'.format, # pylint: disable=redefined-builtin
max_format=None,
baseline=0.0,
@ -301,6 +302,7 @@ class BufferedHistoryGraph(HistoryGraph):
upperbound,
width,
height,
*,
format='{:.1f}'.format, # pylint: disable=redefined-builtin
max_format=None,
baseline=0.0,

View file

@ -19,7 +19,7 @@ from nvitop.gui.library.widestring import WideString
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 @@ class MessageBox(Displayable): # pylint: disable=too-many-instance-attributes
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:

View file

@ -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

View file

@ -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

View file

@ -24,6 +24,7 @@ class UI(DisplayableContainer): # pylint: disable=too-many-instance-attributes
self,
devices,
filters=(),
*,
ascii=False, # pylint: disable=redefined-builtin
mode='auto',
interval=None,

View file

@ -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'