chore(ci): fix the strict type-check workflow + clear unittest deprecation warnings#42
Merged
Merged
Conversation
…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>
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.
Type check — was red
The
type check(pyright strict) workflow has been failing — onmaintoo — since the "Defer item dependency updates" change. Two causes:rule_builder/rules.py:298-300— 3 errors:deferred_updateswas "partially unknown" (annotation + walrus over a dynamicCollectionStateattr), and a baseWorldwas passed where the method wantsTWorld. Fixed withcast(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 concreteTWorldat runtime).pyright-config.json— a dangling../BizHawkClient.pyinclude; 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.json→ 0 errors, exit 0.Deprecation warnings — green jobs were noisy
Cleared the actionable ones (the scan found these across the unit + hosting jobs):
re.split(..., 1)positionalmaxsplit(×54 in hosting)maxsplit=1writer_name=(×20)writer='html'asyncio.get_event_loop()"no current loop" (×4)new_event_loop()+set_event_loop()PytestCollectionWarning: cannot collect 'TestWorld'(×2)__test__ = Falseon the fixture Worldget_all_statedeprecateduse_cachearg (~40)WorldTestBaseframework)Left the benign ones alone (
host.yamlUserWarning, aResourceWarning, 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.🤖 Generated with Claude Code