From 7f9c7eaa5fc99ad2d202c0af135d882a7c80a696 Mon Sep 17 00:00:00 2001 From: agessaman Date: Fri, 7 Aug 2026 13:45:38 -0700 Subject: [PATCH] build: widen ruff scope, raise coverage floor, pin meshcore-cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ruff now checks the whole tree in CI and in `make lint` instead of only modules/ and tests/. scripts/ and the root-level scripts ship to users too and were going unlinted; the wider scope flags nothing today, which makes now the cheap time to widen it. Coverage floor raised 35 to 50 against an actual 53.21%. meshcore-cli was the only dependency with no version floor. It is still required — meshcore_cli.next_cmd backs contact and channel operations with no equivalent in the meshcore library — so it is pinned rather than dropped, and the reason is recorded next to it. Removes the dead [tool.pytest.ini_options] block: pytest.ini takes precedence, so those settings were never in effect and could only drift from the ones that are. --- .github/workflows/test.yml | 5 ++++- Makefile | 4 ++-- pyproject.toml | 15 +++++++-------- requirements.txt | 5 ++++- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 15eb89d..a170910 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,7 +70,10 @@ jobs: run: pip install "ruff==0.15.15" - name: ruff check — fail on any lint error - run: ruff check modules/ tests/ + # Whole tree, not just modules/ and tests/: scripts/ and the root-level + # scripts (meshcore_bot.py, validate_config.py, generate_website.py, …) + # ship to users too. Excludes come from pyproject's [tool.ruff]. + run: ruff check . - name: Log injection check — fail on new unsanitized logger calls run: python scripts/check_log_injection.py diff --git a/Makefile b/Makefile index 8036d1b..b8362e2 100644 --- a/Makefile +++ b/Makefile @@ -51,11 +51,11 @@ test-no-cov: $(VENV)/bin/python # --------------------------------------------------------------------------- lint: $(VENV)/bin/python - $(RUFF) check modules/ tests/ + $(RUFF) check . $(MYPY) modules/ fix: $(VENV)/bin/python - $(RUFF) check --fix modules/ tests/ + $(RUFF) check --fix . # --------------------------------------------------------------------------- # Packaging diff --git a/pyproject.toml b/pyproject.toml index a2b102d..ecb5609 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,9 @@ dependencies = [ "flask>=2.3.0", "flask-socketio>=5.3.0", "flask-compress>=1.14", - "meshcore-cli", + # Still required: `next_cmd` backs contact and channel operations that have no + # equivalent in the meshcore library yet (see requirements.txt). + "meshcore-cli>=1.4.0", "feedparser>=6.0.10", "paho-mqtt>=1.6.0", "cryptography>=41.0.0", @@ -196,17 +198,14 @@ module = [ ] ignore_errors = true -[tool.pytest.ini_options] -# Hard limit every test to 30 s; prevents hangs from blocking I/O or infinite loops. -# Individual tests that legitimately need longer can use @pytest.mark.timeout(N). -timeout = 30 -timeout_method = "thread" -asyncio_mode = "auto" +# Pytest is configured in pytest.ini, not here. pytest.ini takes precedence over +# pyproject.toml, so a [tool.pytest.ini_options] block in this file would be dead +# config that silently drifts from the settings actually in effect. [tool.coverage.run] source = ["modules"] omit = ["tests/*", ".venv/*"] [tool.coverage.report] -fail_under = 35 +fail_under = 50 show_missing = true diff --git a/requirements.txt b/requirements.txt index 9978f18..ac35df8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,7 +22,10 @@ retry-requests>=1.0.0 flask>=2.3.0 flask-socketio>=5.3.0 flask-compress>=1.14 -meshcore-cli +# Still required alongside the meshcore library: `meshcore_cli.next_cmd` backs the +# contact and channel operations (add/remove contact, discover_companion_contacts, +# set_manual_add_contacts, get_channel) that meshcore.commands does not expose. +meshcore-cli>=1.4.0 feedparser>=6.0.10 paho-mqtt>=1.6.0 cryptography>=41.0.0