Repository navigation
build: type-check the package with pyright - #46
Merged
Merged
Conversation
Values that can be missing are now checked where they are read, so a missing one fails with an error that names it: - unity: `referent()` reads a required reference and raises a KeyError naming the owner when it is null; `deref()` keeps returning None for an optional one. PlayerData resolves required references through its default resources the same way. - source: `Session.required_path()` returns the path of a required setting (a ConfigError naming the setting when it is unset). - pipeline: `Store.committed()` returns the result of a task that has one (a FileNotFoundError naming the task otherwise); a Digest refuses new samples once it is settled. - cli: usage errors go through `common.usage()`, which never returns. - musicdata and site: release packages, read-set servers and model keys check their inputs where they are read; jackets are written when both a jacket source and a jackets directory are given. Annotations now describe mixed dictionaries, tuple defaults and lazy settings, so pyright's basic mode reports no errors over src. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pyproject.toml configures pyright (basic mode over src, Python 3.11, Linux) and the test extra installs it. CI runs it in a `types` job, and CONTRIBUTING lists it with the other checks. Co-Authored-By: Claude Opus 5.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.
Summary
src(configured inpyproject.toml, installed by thetestextra) and CI checks it in a newtypesjob.unity.reader.referent()reads a required reference (a KeyError naming the owner when it is null).Session.required_path()returns the path of a required setting.Store.committed()returns the result of a task that has one.cli.common.usage(), which never returns.Checks
ruff check .,ruff format --check .,lint-importspyright: 0 errorspytest: all passmkdocs build --strict