Skip to content

Commit 345eed0

Browse files
committed
chore: updates
1 parent e6d2628 commit 345eed0

File tree

6 files changed

+33
-7
lines changed

6 files changed

+33
-7
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main, master ]
5+
branches: [ "main" ]
66
pull_request:
7-
branches: [ main, master ]
7+
branches: [ "main" ]
88

99
jobs:
1010
test:
@@ -18,7 +18,7 @@ jobs:
1818
with:
1919
python-version: "3.12"
2020

21-
- name: Install dependencies
21+
- name: Install project and dev deps
2222
run: |
2323
python -m pip install --upgrade pip
2424
pip install -e ".[dev]"

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.6.9
4+
hooks:
5+
- id: ruff
6+
args: [--fix]
7+
- id: ruff-format # lightweight formatter from ruff
8+
- repo: https://github.com/psf/black
9+
rev: 24.8.0
10+
hooks:
11+
- id: black
12+
- repo: local
13+
hooks:
14+
- id: pytest
15+
name: pytest
16+
entry: pytest -q
17+
language: system
18+
pass_filenames: false
19+

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
description = "CLI que exibe CPU, RAM, disco, rede e uptime; suporta --json."
55
readme = "README.md"
66
requires-python = ">=3.10"
7-
dependencies = []
7+
dependencies = ["psutil"]
88

99
[project.scripts]
1010
sysinfo-cli = "sysinfo.cli:main"

src/sysinfo/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from importlib.metadata import version, PackageNotFoundError
2+
3+
try:
4+
__version__ = version("sysinfo-cli")
5+
except PackageNotFoundError:
6+
__version__ = "0.0.0"

src/sysinfo/cli.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ def get_sysinfo() -> dict[str, Any]:
9191
def main():
9292
p = argparse.ArgumentParser(
9393
prog="sysinfo-cli",
94-
description="Show CPU, RAM, disk, network, and uptime. Use --json for JSON output.",
94+
description=(
95+
"Show CPU, RAM, disk, network, and uptime." "Use --json for JSON output.",
96+
),
9597
)
96-
98+
9799
p.add_argument("--version", action="version", version="sysinfo-cli 0.1.0")
98100

99101
p.add_argument("--json", action="store_true", help="JSON output")

tests/test_text_mode.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ def test_text_mode_runs():
1010
assert "disk:" in s
1111
assert "net:" in s
1212
assert "uptime:" in s
13-

0 commit comments

Comments
 (0)