Skip to content

fix(loader,facades): resolve basedpyright errors batch 3 - #227

Merged
tmgbedu merged 1 commit into
mainfrom
task/basedpyright-batch-3
Sep 22, 2026
Merged

tmgbedu merged 1 commit into
mainfrom
task/basedpyright-batch-3

Conversation

@tmgbedu

@tmgbedu tmgbedu commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Batch 3 of the basedpyright cleanup (task #1820): the facade stubs Loader, RateLimiter and Url, plus the related loader/Loader.py module.

  • Facade stubs: methods declared @staticmethod (the same pattern as Config.pyi and fix(logging): resolve basedpyright errors in log channels #225/fix(facades): resolve basedpyright errors in facade stubs #226). Also removed stray self params, typed callableCallable[..., bool] | None, and changed the mutable {} default to None. The import of the nonexistent ..rates.limiters module is replaced with a Limiter = Any alias.
  • Loader.get_modules(): skips modules found by non-filesystem finders (e.g. zipimporter), because load() imports by file path.
  • Loader.get_parameters(): returns {} when the module can't be loaded (get_objects returns None).

Behaviour changes

  • get_modules() on a zip archive path used to raise AttributeError (zipimporter has no .path). It now returns {}.
  • get_parameters() on an unloadable path used to raise AttributeError on None.items(). It now returns {}.

Regression tests are added for both.

Verification

  • basedpyright: 475 → 465 errors (11 → 1 warnings), and diffing the error lists shows no new errors
  • uv run pytest --ignore=tests/masoniteorm/postgres: 2361 passed. loader/Loader.py coverage is 100%
  • ruff check and format are clean
  • 5 files changed, with no blanket ignore comments

🤖 Generated with Claude Code

… 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

codecov Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tmgbedu
tmgbedu merged commit 66e0202 into main Sep 22, 2026
4 of 6 checks passed
@tmgbedu
tmgbedu deleted the task/basedpyright-batch-3 branch September 22, 2026 22:09
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