diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a61c1fa0..8a40fb18 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.0.278 + rev: v0.0.280 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/nvitop/api/libnvml.py b/nvitop/api/libnvml.py index 01990632..a7eff4df 100644 --- a/nvitop/api/libnvml.py +++ b/nvitop/api/libnvml.py @@ -120,11 +120,11 @@ _sphinx_doc = None for _name in _const_names: _attr = _vars_pynvml[_name] - _sphinx_doc = """ -.. data:: {} - :type: {} - :value: {!r} -""".format(_name, _attr.__class__.__name__, _attr) # fmt: skip + _sphinx_doc = f""" +.. data:: {_name} + :type: {_attr.__class__.__name__} + :value: {_attr!r} +""" if _name.startswith('NVML_ERROR_') and _attr in _errcode_to_string: _reason = _errcode_to_string[_attr] _sphinx_doc += """