chore(bigquery): add dynamic logging banner to nox mypy session#17492
Draft
chalmerlowe wants to merge 2 commits into
Draft
chore(bigquery): add dynamic logging banner to nox mypy session#17492chalmerlowe wants to merge 2 commits into
chalmerlowe wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a log_package_context context manager in noxfile.py to log a package context banner upon Nox session completion, applying it to the mypy session. The feedback suggests replacing os.getcwd() with pathlib.Path(file).parent.name to ensure the package name is correctly resolved even when Nox is executed from outside the package directory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a dynamic logging banner
Finished session for <package>to nox
mypysessions inbigqueryto simplify troubleshooting.Currently when a nox session runs, there may be many lines of text between a reference to which package is being tested and the result summary line. This can make it more difficult to determine which package is affected without a lot of manual scrolling (every time you need to trouble shoot an issue). This is especially true if you use
Ctrl+Fto zoom over to summaries with words likefailed.The PR adds a banner line right before the nox result summary:
Note: There is no convenient way to inject a log line into the nox session and have it print exactly where you want to AND ideally, this feature would be included in all nox sessions, so I included a contextmanager to ensure the correct placement of the new logging banner.