Tighten pyright and pytest warning config deferred from copier template adoption
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 47
- Forks
- 15
- Ø Merge
- 1 T. 23 Std.
- Gemergte PRs (30 T.)
- 3
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus DiamondLightSource/pythonSoftIOC
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
-
bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 32/100
-
bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
-
Add CI support and wheels for aarch64?Evtl. wieder frei @AlexanderWells-diamond hat das vor 1363 Tagen übernommen, und es ist kein Pull Request offen. Offenenhancement
DiamondLightSource/pythonSoftIOC#121 · 2 Kommentare · 1 zugewiesene Person ·
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
Alle Issues in DiamondLightSource/pythonSoftIOC
Ähnliche Issues
-
needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
MakazhanAlpamys/Soup#3589 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
ClickHouse/clickhouse-connect#1266 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
biosustain/growthcurves_app#89 ·
Maintainer antworten meist innerhalb von 1 Tag
-
`LogProxyConsumer._on_relation_departed` raises `APIError` when the promtail service does not existOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
canonical/loki-k8s-operator#695 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag