8000 Don't check plugin-generated functions by ikonst · Pull Request #16524 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Don't check plugin-generated functions #16524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next 8000 Next commit
treat builtins overrides as typeshed files
  • Loading branch information
ikonst committed Dec 11, 2023
commit 33d06ccdca82263344f33aff6e28977a837ffe75
2 changes: 2 additions & 0 deletions mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,8 @@ def parse_file(
self.errors.ignored_files.add(path)
tree = parse(source, path, id, self.errors, options=options)
tree._fullname = id
if options.use_builtins_fixtures and id in CORE_BUILTIN_MODULES:
tree._is_typeshed_file = True
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not do this if this can silence errors if test fixtures have issues. It would be better to either add a minimal custom fixture that is only used in the relevant test cases or to omit the test cases that need this (I trust that you've tested it already).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_is_typeshed_file does not silence all errors, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The premise of errors in fixtures becoming obscured concerned me too, but having the test environment closer to actual environment seemed more prudent.

If you feel particularly iffy about it, sure, I can add # type:ignore[misc] to a handful of places in the fixtures.

self.add_stats(
files_parsed=1,
modules_parsed=int(not tree.is_stub),
Expand Down
0