Repository navigation
chore(pyproject): correct the metadata and lint config to what is measured - #43
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every assertion in
pyproject.tomlchecked against the repo, CI and the ruff version CI actually runs.Wrong or misleading
dependencies = ["PySide6>=6.6", "requests>=2.31"]cryptographyandanthropicare 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"]excludereplaces 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 exceptbuild/datawas already a default —distis,buildisn't (only_build), and PyInstaller writes both."scripts/*" = ["E402", "F841"],"benchmarks/*" = ["F841"]sys.pathmutation 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.gui/; alsoself.tr()UI text, the prompt/dial tables inollama_worker.py, regexes with trailing comments. E741 → 7, E731 → 2, now recorded.[tool.mypy]reading as project policypyrightconfig.json). Section kept — CONTRIBUTING.md:73 says it is deliberately there for local use.Added — accurate, previously absent
description,readme,license(matchesLICENSE),authors(from the copyright line),[project.urls], and a header noting there is no[build-system], so nothing here is pip-installed andrequirements.txtis authoritative.Marked as intent rather than effect
line-length = 110constrains nothing today (E501 ignored, W505 unselected, no formatter runs).testpaths/python_filesare no-ops — collection yields the same 1,007 tests either way, and notest_*.pylives outsidetests/.Validation
ruff checkclean on 0.16.1 (CI's version, installed into a throwaway venv) and on 0.13.1 localpytest tests/— 1,007 passedNoted, not changed (outside this file)
required-versionwould pin it, but at>=0.15it would also block older local ruffs, so that's a call for a maintainer.cryptography/anthropic— imported inside functions with no try/except, so the app starts and fails only at first use.🤖 Generated with Claude Code