Skip to content

build: type-check the package with pyright - #46

Merged
nichinichisou0609 merged 2 commits into
mainfrom
build/pyright
Oct 14, 2026
Merged

nichinichisou0609 merged 2 commits into
mainfrom
build/pyright

Conversation

@nichinichisou0609

Copy link
Copy Markdown
Collaborator

Summary

  • pyright runs in basic mode over src (configured in pyproject.toml, installed by the test extra) and CI checks it in a new types job.
  • Values that can be missing are checked where they are read, so a missing one fails with an error that names it:
    • 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.
    • Usage errors go through cli.common.usage(), which never returns.
  • Annotations describe mixed dictionaries, tuple defaults and lazy settings.

Checks

  • ruff check ., ruff format --check ., lint-imports
  • pyright: 0 errors
  • pytest: all pass
  • mkdocs build --strict

nichinichisou0609 and others added 2 commits October 14, 2026 15:37
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>
@nichinichisou0609
nichinichisou0609 merged commit e0ef1e1 into main Oct 14, 2026
8 checks passed
@nichinichisou0609
nichinichisou0609 deleted the build/pyright branch October 14, 2026 07:41
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