Skip to content

[mypyc] Emit messages regardless if there's no errors#10940

Closed
ichard26 wants to merge 2 commits intopython:masterfrom
ichard26:fix-messages
Closed

[mypyc] Emit messages regardless if there's no errors#10940
ichard26 wants to merge 2 commits intopython:masterfrom
ichard26:fix-messages

Conversation

@ichard26
Copy link
Copy Markdown
Collaborator

@ichard26 ichard26 commented Aug 6, 2021

Description

Related: mypyc/mypyc#873 (comment)

For example the warning for "treating generator comprehension as list"
doesn't get printed unless there were errors too. This was due to
the fact mypyc/build.py was only checking errors.num_errors totally
ignoring the possitibilties of warnings or notes happening alone.

Test Plan

  • Added another commandline run test (and made sure it failed without the patch)

@JelleZijlstra
Copy link
Copy Markdown
Member

Looks like this is breaking mypy's build of itself, could you take a look?

@ichard26
Copy link
Copy Markdown
Collaborator Author

ichard26 commented Aug 7, 2021

So me having zero foreshadowing abilities forgot that warnings would also cause the build to exit with a non-zero return code 🙃. Mypyc now exits with 1 if errors occurred. Fixed one of the more concerning warnings from mypyc too.

@ichard26
Copy link
Copy Markdown
Collaborator Author

ichard26 commented Aug 7, 2021

Gosh, the test infra doesn't include the messages output unless the returncode was non-zero (or the test case was suffixed with ErrorOutput), working around that unfortunately the "running build_ext" is now getting into the "actual" output breaking the test in another way. Looks like I need go back to the drawing board.

@ichard26 ichard26 marked this pull request as draft August 7, 2021 18:10
@ichard26 ichard26 marked this pull request as ready for review August 10, 2021 17:19
ichard26 added 2 commits July 2, 2022 12:21
While warnings aren't great, given that mypyc is in alpha and has a
limited support surface currently exiting on warnings is a bit much.

Also fixed this warning:
  mypy/semanal.py:228: warning: Unsupported default attribute value
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 2, 2022

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@ichard26
Copy link
Copy Markdown
Collaborator Author

ichard26 commented Jan 15, 2023

Superseded by #14451.

@ichard26 ichard26 closed this Jan 15, 2023
@ichard26 ichard26 deleted the fix-messages branch January 15, 2023 03:10
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.

2 participants