From ab9a6bcf84f34ba70a3284220764d7e719db189a Mon Sep 17 00:00:00 2001 From: Lee Braiden Date: Tue, 10 Feb 2026 19:09:24 +0000 Subject: [PATCH 1/2] Modern uv-based packaging --- .gitignore | 2 ++ README.md | 13 ++++++--- pyproject.toml | 36 ++++++++++++++++++++++++ requirements.txt | 3 -- ktop.py => src/ktop/__init__.py | 4 +-- screenshot.png => static/screenshot.png | Bin 6 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt rename ktop.py => src/ktop/__init__.py (99%) rename screenshot.png => static/screenshot.png (100%) diff --git a/.gitignore b/.gitignore index a18610e..11fabd6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ __pycache__/ *.egg-info/ dist/ build/ +dist/ +CLAUDE.md diff --git a/README.md b/README.md index 180fb3a..59a80cb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ktop -![ktop screenshot](screenshot.png?v=2) +![ktop screenshot](static/screenshot.png?v=2) A terminal-based system resource monitor built for tracking resource usage when running hybrid LLM workloads. @@ -20,12 +20,17 @@ A terminal-based system resource monitor built for tracking resource usage when ## Install ```bash -git clone https://github.com/brontoguana/ktop.git && cd ktop && ./setup.sh +# Install with uv (recommended) +uv tool install --from=https://github.com/brontoguana/ktop ``` -That's it — clones the repo, installs dependencies into a venv, adds `ktop` to `~/.local/bin`, and launches it. +Or run directly without installing: -For a system-wide install: `sudo ./setup.sh --system` +```bash +uvx git+https://github.com/brontoguana/ktop +``` + +**Note:** `uvx` is included with [`uv`](https://astral.sh/uv). See the uv documentation for installation instructions. ## Usage diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..6018c96 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,36 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "ktop" +version = "0.1.0" +description = "Terminal system resource monitor for hybrid LLM workloads" +authors = [{name = "brontoguana", email = "brontoguana@users.noreply.github.com"}] +readme = "README.md" +requires-python = ">=3.8" +license = {text = "MIT"} +keywords = ["monitor", "system", "gpu", "cpu", "memory", "terminal"] +classifiers = [ + "Environment :: Console", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "License :: OSI Approved :: MIT License", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3", + "Topic :: System :: Monitoring", + "Topic :: Utilities", +] +dependencies = [ + "psutil>=5.9", + "rich>=13.0", + "pynvml>=11.5", +] + +packages = [ + { from="src", name="ktop" }, +] + +[project.scripts] +ktop = "ktop:main" + diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index b762b57..0000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -psutil>=5.9 -rich>=13.0 -pynvml>=11.5 # or nvidia-ml-py>=12.0 diff --git a/ktop.py b/src/ktop/__init__.py similarity index 99% rename from ktop.py rename to src/ktop/__init__.py index 5e0805a..ba99b30 100755 --- a/ktop.py +++ b/src/ktop/__init__.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3 -"""ktop - Terminal system resource monitor for hybrid LLM workloads.""" from __future__ import annotations import argparse @@ -771,4 +769,4 @@ def main(): if __name__ == "__main__": - main() + sys.exit(main()) diff --git a/screenshot.png b/static/screenshot.png similarity index 100% rename from screenshot.png rename to static/screenshot.png From b83f162120e5ea5456cf6acb205e62bed19029a6 Mon Sep 17 00:00:00 2001 From: Lee Braiden Date: Tue, 10 Feb 2026 19:33:25 +0000 Subject: [PATCH 2/2] Update uv/uvx docs --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 59a80cb..1a7b044 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,13 @@ A terminal-based system resource monitor built for tracking resource usage when ```bash # Install with uv (recommended) -uv tool install --from=https://github.com/brontoguana/ktop +uv tool install --from=git+https://github.com/brontoguana/ktop ktop ``` -Or run directly without installing: +Or run directly without (separately) installing: ```bash -uvx git+https://github.com/brontoguana/ktop +uvx --from=git+https://github.com/brontoguana/ktop ktop ``` **Note:** `uvx` is included with [`uv`](https://astral.sh/uv). See the uv documentation for installation instructions.