Tighten pyright and pytest warning config deferred from copier template adoption
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Start with [tool.pyright] in pyproject.toml, the existing tests/test_records.py and tests/test_autosave.py, and the type-checking tox environment. Run tox -e type-checking to see the pyright errors, then run the test suite with warnings treated as errors. Done means the chosen rules and standard mode are configured, warnings are resolved, and the suite passes on all CI platforms.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Adopting python-copier-template (PR to follow) adds pyright and the template's pytest config, but to keep that PR free of code changes both are configured leniently. This issue tracks tightening them. The ruff equivalent is #214.
Pyright
The adoption PR runs pyright in basic mode (the template uses standard) with these rules turned off in [tool.pyright] in pyproject.toml:
reportArgumentTypereportAssignmentTypereportAttributeAccessIssuereportOperatorIssuereportOptionalCallreportOptionalMemberAccessreportOptionalSubscriptreportUndefinedVariable(names fromfrom x import *; may need to stay off, or be fixed with explicit__all__/imports)reportUnusedExpressionreportWildcardImportFromLibrary
With those rules on, the current code gives about 155 errors in basic mode and 178 in standard mode. softioc/iocStats (third-party submodule) stays excluded.
pytest warnings
The template sets filterwarnings = "error"; the adoption PR leaves it out because some tests raise warnings, e.g. files left open (ResourceWarning) in tests/test_records.py and tests/test_autosave.py.
Done when
- The disabled pyright rules are re-enabled (or kept off with a stated reason, e.g. star imports) and
tox -e type-checkingpasses. -
typeCheckingModeisstandard, matching the template. - The tests close their files,
filterwarnings = "error"is set, and the suite passes on all CI platforms.
- Lingua principale
- Python
- Stelle
- 47
- Fork
- 15
- Merge medio
- 1g 23h
- PR unite (30g)
- 3
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DiamondLightSource/pythonSoftIOC
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 32/100
-
Intermittently failing testApertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
Add CI support and wheels for aarch64?Forse di nuovo libera @AlexanderWells-diamond l’ha presa 1363 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement
DiamondLightSource/pythonSoftIOC#121 · 2 commenti · 1 assegnatario ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Tutte le issue di DiamondLightSource/pythonSoftIOC
Issue simili
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
MakazhanAlpamys/Soup#3589 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
ClickHouse/clickhouse-connect#1266 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
biosustain/growthcurves_app#89 ·
I maintainer di solito rispondono entro 1 giorno
-
`LogProxyConsumer._on_relation_departed` raises `APIError` when the promtail service does not existAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
canonical/loki-k8s-operator#695 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno