Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ END_UNRELEASED_TEMPLATE
### Fixed
* (gazelle) Fixed handling of auto-included `__init__.py` files when generating `py_binary`
targets ([#3729](https://github.com/bazel-contrib/rules_python/issues/3729)).
* (entry_point) From now on `mypy` type checking will be skipped on the generated
files ([#3126](https://github.com/bazel-contrib/rules_python/issues/3126)).
Comment on lines +68 to +69
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.

medium

This entry states that type checking will be skipped on the "generated files", implying the entire file. However, the current implementation in py_console_script_gen.py only targets a single line in the entry point script. If the goal is to ignore the whole file, the implementation should be updated to use a file-level ignore at the top of the generated script. If only the sys.exit line is intended to be ignored, this description should be clarified.


{#v0-0-0-added}
### Added
Expand Down
2 changes: 1 addition & 1 deletion python/private/py_console_script_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
raise

if __name__ == "__main__":
sys.exit({entry_point}())
sys.exit({entry_point}()) # type: ignore
"""


Expand Down
2 changes: 1 addition & 1 deletion tests/entry_points/py_console_script_gen_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def test_a_single_entry_point(self):
raise

if __name__ == "__main__":
sys.exit(baz())
sys.exit(baz()) # type: ignore
"""
)
self.assertEqual(want, got)
Expand Down