nvitop/pyproject.toml

226 lines
6.3 KiB
TOML

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "nvitop"
description = "An interactive NVIDIA-GPU process viewer and beyond, the one-stop solution for GPU process management."
readme = "README.md"
requires-python = ">= 3.8"
authors = [{ name = "Xuehai Pan", email = "XuehaiPan@pku.edu.cn" }]
license = { text = "Apache-2.0 AND GPL-3.0-only" }
keywords = [
"nvidia",
"nvidia-smi",
"NVIDIA",
"NVML",
"CUDA",
"GPU",
"top",
"monitoring",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Environment :: GPU",
"Environment :: GPU :: NVIDIA CUDA",
"Environment :: Console",
"Environment :: Console :: Curses",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: System Administrators",
"Topic :: System :: Hardware",
"Topic :: System :: Monitoring",
"Topic :: System :: Systems Administration",
"Topic :: Utilities",
]
dependencies = [
# Sync with nvitop/version.py and requirements.txt
"nvidia-ml-py >= 11.450.51, < 13.591.0a0",
"psutil >= 5.6.6",
"colorama >= 0.4.0; platform_system == 'Windows'",
"windows-curses >= 2.2.0; platform_system == 'Windows'",
]
dynamic = ["version", "optional-dependencies"]
[project.scripts]
nvitop = "nvitop.cli:main"
nvisel = "nvitop.select:main"
[project.urls]
Homepage = "https://github.com/XuehaiPan/nvitop"
Repository = "https://github.com/XuehaiPan/nvitop"
Documentation = "https://nvitop.readthedocs.io"
"Bug Report" = "https://github.com/XuehaiPan/nvitop/issues"
[tool.setuptools.packages.find]
include = ["nvitop", "nvitop.*"]
[tool.mypy]
# Sync with requires-python
python_version = "3.8"
mypy_path = [".", "nvitop-exporter"]
exclude = ["nvitop-exporter/setup.py"]
pretty = true
show_column_numbers = true
show_error_codes = true
show_error_context = true
show_traceback = true
allow_redefinition = true
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
ignore_missing_imports = true
no_implicit_optional = true
strict_equality = true
strict_optional = true
warn_no_return = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[tool.pylint]
main.py-version = "3.8"
basic.good-names = ["x", "y", "dx", "dy", "p", "s", "fg", "bg", "n", "ui", "tx", "rx"]
format.max-line-length = 120
messages-control.disable = [
"consider-using-f-string",
"duplicate-code",
"wrong-import-order",
]
spelling.spelling-dict = "en_US"
spelling.spelling-private-dict-file = "docs/source/spelling_wordlist.txt"
[tool.codespell]
ignore-words = "docs/source/spelling_wordlist.txt"
[tool.ruff]
# Sync with requires-python
target-version = "py38"
line-length = 100
output-format = "full"
src = ["nvitop", "nvitop-exporter/nvitop_exporter"]
[tool.ruff.format]
quote-style = "single"
docstring-code-format = false
skip-magic-trailing-comma = false
[tool.ruff.lint]
select = [
"E", "W", # pycodestyle
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"D", # pydocstyle
"ANN", # flake8-annotations
"S", # flake8-bandit
"BLE", # flake8-blind-except
"B", # flake8-bugbear
"COM", # flake8-commas
"C4", # flake8-comprehensions
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"INP", # flake8-no-pep420
"PIE", # flake8-pie
"PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SIM", # flake8-simplify
"SLOT", # flake8-slots
"TID", # flake8-tidy-imports
"TC", # flake8-type-checking
"NPY", # numpy
"PERF", # perflint
"FURB", # refurb
"TRY", # tryceratops
"RUF", # ruff
]
ignore = [
# E501: line too long
# W505: doc line too long
# too long docstring due to long example blocks
"E501",
"W505",
# ANN401: dynamically typed expressions (typing.Any) are disallowed
"ANN401",
# FURB189: use the `UserDict`, `UserList`, and `UserString` instead
# internally subclassing `dict`, `list`, and `str`
"FURB189",
# S101: use of `assert` detected
# internal use and may never raise at runtime
"S101",
# SIM105: use `contextlib.suppress(...)` instead of try-except-pass
# reduce unnecessary function call
"SIM105",
# TRY003: avoid specifying long messages outside the exception class
# long messages are necessary for clarity
"TRY003",
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
"F401", # unused-import
]
"setup.py" = [
"D", # pydocstyle
]
"nvitop/api/lib*.py" = [
"N", # pep8-naming
]
"nvitop/callbacks/*.py" = [
"D", # pydocstyle
"ANN", # flake8-annotations
]
"nvitop/tui/**/*.py" = [
"D", # pydocstyle
]
"!nvitop/tui/**/*.py" = [
"TID251", # banned-api
]
"nvitop/tui/library/*.py" = [
"TID251", # banned-api
]
"docs/source/conf.py" = [
"D", # pydocstyle
"INP001", # flake8-no-pep420
]
[tool.ruff.lint.isort]
known-first-party = ["nvitop", "nvitop_exporter"]
extra-standard-library = ["typing_extensions"]
lines-after-imports = 2
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
multiline-quotes = "double"
inline-quotes = "single"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"nvitop.api".msg = "Use `nvitop.tui.library` instead of `nvitop.api` in `nvitop.tui`."