Skip to content

chore(pyproject): correct the metadata and lint config to what is measured - #43

Merged
0xra0 merged 1 commit into
mainfrom
pyproject-measured-facts
Aug 1, 2026
Merged

0xra0 merged 1 commit into
mainfrom
pyproject-measured-facts

Conversation

@0xra0

@0xra0 0xra0 commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Every assertion in pyproject.toml checked against the repo, CI and the ruff version CI actually runs.

Wrong or misleading

Was Now Evidence
dependencies = ["PySide6>=6.6", "requests>=2.31"] the four core deps at requirements.txt's floors Two stale floors, two missing entries. cryptography and anthropic are imported lazily inside the functions that use them, so a missing one surfaces at feature-use, not startup — now stated.
exclude = [...] extend-exclude = ["build", "data"] exclude replaces ruff's defaults. Probe tree with one unused import per directory: old list linted 4 files (.mypy_cache, .ruff_cache, node_modules, plus the real one), new one lints 1. Everything the old list named except build/data was already a default — dist is, build isn't (only _build), and PyInstaller writes both.
"scripts/*" = ["E402", "F841"], "benchmarks/*" = ["F841"] deleted 0 hits each on ruff 0.13.1 and 0.16.1 (the version CI last installed). Ruff exempts sys.path mutation from E402 by itself — exactly the case the comment described — so the ignore could only hide a real one. A note keeps them from coming back.
E501 ignored "because QSS and file-filter strings can't be wrapped" those two, plus the rest of the set 321 hits, 312 in gui/; also self.tr() UI text, the prompt/dial tables in ollama_worker.py, regexes with trailing comments. E741 → 7, E731 → 2, now recorded.
[tool.mypy] reading as project policy comment: no workflow runs mypy Pyright is the checker (pyrightconfig.json). Section kept — CONTRIBUTING.md:73 says it is deliberately there for local use.

Added — accurate, previously absent

description, readme, license (matches LICENSE), authors (from the copyright line), [project.urls], and a header noting there is no [build-system], so nothing here is pip-installed and requirements.txt is authoritative.

Marked as intent rather than effect

line-length = 110 constrains nothing today (E501 ignored, W505 unselected, no formatter runs). testpaths/python_files are no-ops — collection yields the same 1,007 tests either way, and no test_*.py lives outside tests/.

Validation

  • ruff check clean on 0.16.1 (CI's version, installed into a throwaway venv) and on 0.13.1 local
  • TOML parses; every key resolves as intended
  • pytest tests/ — 1,007 passed

Noted, not changed (outside this file)

  • CI's ruff version floats. The lint run logs "Could not parse version from pyproject.toml. Using latest version." and installed 0.16.1 — results can shift with no commit. required-version would pin it, but at >=0.15 it would also block older local ruffs, so that's a call for a maintainer.
  • requirements.txt calls all four core deps "the application will not start without these." Not true for cryptography/anthropic — imported inside functions with no try/except, so the app starts and fails only at first use.

🤖 Generated with Claude Code

…sured

The [project] dependency table had drifted to "PySide6>=6.6, requests>=2.31":
two stale floors and two missing entries. It now mirrors the core block of
requirements.txt, which is the list CI and the release build actually install.
cryptography and anthropic are imported lazily, inside the functions that need
them, so a missing one surfaces when the AES secret store or the Claude backend
is first used rather than at startup — noted rather than left to infer.

exclude replaces ruff's default list instead of adding to it, so the explicit
list here quietly gave up .mypy_cache, .ruff_cache, .pytest_cache, .tox,
node_modules and the rest. Measured on a probe tree with one unused import per
directory: the old list linted 4 files, extend-exclude lints 1. Everything it
named other than build and data was already a default — dist is one, build is
not (only _build), and PyInstaller writes both.

scripts/* ignored E402 and F841 and benchmarks/* ignored F841; none of the
three fired on any file, on either ruff 0.13.1 or the 0.16.1 CI last installed.
Ruff exempts sys.path mutation from E402 by itself, which is exactly what the
scripts entry existed for, so it could only have hidden a real one. tests/*
F841 stays and now says what it covers: six hits in test_diff_viewer.py, five
of them the QApplication a test must hold in a local.

The remaining ignores now carry what they suppress (E741 7, E731 2, E501 321 of
which 312 in gui/) and E501's stated reason is widened to match: the QSS and
file-filter strings it named are real but are not the whole set, which also
includes translatable tr() text, the prompt and dial tables in ollama_worker,
and regexes with a trailing comment.

[tool.mypy] read as project policy; no workflow runs mypy and pyright's config
is pyrightconfig.json. The section is kept — CONTRIBUTING.md says it is there
for anyone who prefers mypy locally — and now says so itself. line-length and
both pytest keys are marked as recording intent: with E501 ignored and no
formatter the width constrains nothing, and collection yields the same 1,007
tests with or without testpaths.

Added the metadata that was simply absent and is checkable against the repo:
description, readme, license, authors, project.urls, and a header noting there
is no [build-system], so nothing here is pip-installed.

ruff check clean on 0.16.1 and 0.13.1; the TOML parses with every key resolving
as intended; pytest tests/ 1,007 passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@0xra0
0xra0 merged commit a1321db into main Aug 1, 2026
4 of 5 checks passed
@0xra0
0xra0 deleted the pyproject-measured-facts branch August 1, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant