Skip to content

chore(ci): fix the strict type-check workflow + clear unittest deprecation warnings#42

Merged
lallaria merged 2 commits into
mainfrom
chore/ci-warnings-and-typecheck
Jun 5, 2026
Merged

chore(ci): fix the strict type-check workflow + clear unittest deprecation warnings#42
lallaria merged 2 commits into
mainfrom
chore/ci-warnings-and-typecheck

Conversation

@lallaria

@lallaria lallaria commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Type check — was red

The type check (pyright strict) workflow has been failing — on main too — since the "Defer item dependency updates" change. Two causes:

  1. rule_builder/rules.py:298-300 — 3 errors: deferred_updates was "partially unknown" (annotation + walrus over a dynamic CollectionState attr), and a base World was passed where the method wants TWorld. Fixed with cast(set[str], …) (mirroring the file's existing line-289 pattern) and a targeted # pyright: ignore[reportArgumentType] on the call (the per-player world is the concrete TWorld at runtime).
  2. pyright-config.json — a dangling ../BizHawkClient.py include; that file was removed in the no-worlds restructure, so pyright errored on the missing path (confirmed it reports the same on CI). Removed the stale entry.

✅ Verified locally: pyright -p .github/pyright-config.json0 errors, exit 0.

Deprecation warnings — green jobs were noisy

Cleared the actionable ones (the scan found these across the unit + hosting jobs):

Warning Fix
re.split(..., 1) positional maxsplit (×54 in hosting) maxsplit=1
docutils writer_name= (×20) writer='html'
asyncio.get_event_loop() "no current loop" (×4) spawned room process now does new_event_loop() + set_event_loop()
PytestCollectionWarning: cannot collect 'TestWorld' (×2) __test__ = False on the fixture World
get_all_state deprecated use_cache arg (~40) dropped the arg in the 5 test callers (incl. the WorldTestBase framework)

Left the benign ones alone (host.yaml UserWarning, a ResourceWarning, the Cython -Wsign-compare).

No behavior change — these are pure CI hygiene. Full test/ suite green (644 passed), and the target warnings no longer appear.

Note: this fixes the type-check for everyone — once merged, the other open PRs (#40, #41) pick it up on rebase.

🤖 Generated with Claude Code

lallaria and others added 2 commits June 4, 2026 20:14
…ecation warnings

Type check (red since the "Defer item dependency updates" change):
- rule_builder/rules.py: cast the dynamic rule_builder_deferred_item_dependency_updates
  attr to set[str] (was "partially unknown"); the per-player world is the concrete
  TWorld at runtime, so suppress the base-World-vs-TWorld argument mismatch.
- pyright-config.json: drop the dangling ../BizHawkClient.py include (the file was
  removed in the no-worlds restructure; pyright errored on the missing path -- on CI too).
Verified: pyright -p .github/pyright-config.json -> 0 errors, exit 0.

Deprecation warnings (green jobs were noisy):
- ModuleUpdate.py: re.split(..., 1) -> maxsplit=1 (Python 3.13).
- WebHostLib/options.py: docutils publish_parts writer_name= -> writer=.
- WebHostLib/customserver.py: the spawned room process installs its own event loop
  (asyncio.new_event_loop + set_event_loop) instead of deprecated get_event_loop().
- test/general TestWorld: __test__ = False (a fixture World, not a pytest class).
- drop the removed use_cache arg from get_all_state(...) callers in test/bases.py,
  test/benchmark/locations.py, test/general/{test_implemented,test_reachability,test_state}.py.

No behavior change. Full test/ suite green (644 passed); the target warnings are gone.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lallaria lallaria merged commit d6a4436 into main Jun 5, 2026
19 checks passed
@lallaria lallaria deleted the chore/ci-warnings-and-typecheck branch June 5, 2026 00:23
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