Skip to content

Treat merged stub symbols as untyped in pyrefly coverage#3780

Closed
jorenham wants to merge 1 commit into
facebook:mainfrom
jorenham:gh-3778
Closed

Treat merged stub symbols as untyped in pyrefly coverage#3780
jorenham wants to merge 1 commit into
facebook:mainfrom
jorenham:gh-3778

Conversation

@jorenham

@jorenham jorenham commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

From the typing spec (src):

Type checkers should merge the stub package and runtime package directories. This can be thought of as the functional equivalent of copying the stub package into the same directory as the corresponding runtime package and type checking the combined directory structure. Thus type checkers MUST maintain the normal resolution order of checking *.pyi before *.py files.

So this ensures that annotated symbols in a .py are treated as untyped if those symbols are not annotated in the .pyi by pyrefly coverage {check, report}.

Fixes #3778

Test Plan

There are tests :)

@github-actions

Copy link
Copy Markdown

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@meta-codesync

meta-codesync Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

@samwgoldman has imported this pull request. If you are a Meta employee, you can view this in D108648927.

@yangdanny97 yangdanny97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync Bot closed this in 33a79bd Jun 15, 2026
@meta-codesync meta-codesync Bot added the Merged label Jun 15, 2026
@meta-codesync

meta-codesync Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

@samwgoldman merged this pull request in 33a79bd.

@jorenham jorenham deleted the gh-3778 branch June 15, 2026 20:24
@jorenham

Copy link
Copy Markdown
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyrefly coverage should ignore .py annotations if a .pyi exists

3 participants