Skip to content

Exclude exports from if __name__ == "__main__"#3625

Open
jorenham wants to merge 1 commit into
facebook:mainfrom
jorenham:gh-3624
Open

Exclude exports from if __name__ == "__main__"#3625
jorenham wants to merge 1 commit into
facebook:mainfrom
jorenham:gh-3624

Conversation

@jorenham
Copy link
Copy Markdown
Contributor

@jorenham jorenham commented Jun 1, 2026

Summary

The problem turned out to lie a bit deeper than just pyrefly coverage report, because it was the export collection itself that was incorrectly including definitions from if __name__ == "__main__" guards. But those aren't importable at runtime, so they shouldn't be considered as import-able.

Fixes #3624 (and then some).

Test Plan

Tests added

@meta-cla meta-cla Bot added the cla signed label Jun 1, 2026
@github-actions github-actions Bot added the size/m label Jun 1, 2026
@jorenham
Copy link
Copy Markdown
Contributor Author

jorenham commented Jun 2, 2026

primer could use a rerun

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 report includes if __name__ == "__main__" declarations

1 participant