fix(loader,facades): resolve basedpyright errors batch 3 - #227
Merged
Merged
Conversation
… stubs Loader/RateLimiter/Url facade stubs now declare methods as @staticmethod (facade methods are accessed on the class via the Facade metaclass) and replace the import of the nonexistent rates.limiters module with an Any alias. Loader.get_modules() only loads modules yielded by filesystem finders, since load() imports by file path; Loader.get_parameters() returns {} when the module cannot be loaded instead of raising AttributeError. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Batch 3 of the basedpyright cleanup (task #1820): the facade stubs
Loader,RateLimiterandUrl, plus the relatedloader/Loader.pymodule.@staticmethod(the same pattern asConfig.pyiand fix(logging): resolve basedpyright errors in log channels #225/fix(facades): resolve basedpyright errors in facade stubs #226). Also removed strayselfparams, typedcallable→Callable[..., bool] | None, and changed the mutable{}default toNone. The import of the nonexistent..rates.limitersmodule is replaced with aLimiter = Anyalias.Loader.get_modules(): skips modules found by non-filesystem finders (e.g.zipimporter), becauseload()imports by file path.Loader.get_parameters(): returns{}when the module can't be loaded (get_objectsreturnsNone).Behaviour changes
get_modules()on a zip archive path used to raiseAttributeError(zipimporterhas no.path). It now returns{}.get_parameters()on an unloadable path used to raiseAttributeErroronNone.items(). It now returns{}.Regression tests are added for both.
Verification
uv run pytest --ignore=tests/masoniteorm/postgres: 2361 passed.loader/Loader.pycoverage is 100%🤖 Generated with Claude Code