-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter out pip freeze output starting w/ "[notice]" #508
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good. We should also pass the --disable-pip-version-check
version to pip whenever we run it non-interactively.
I wondered about that earlier when I was formulating my strategy. I'll go ahead and add it. |
--disable-pip-version-check version
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
I have since got a new computer and can no longer reproduce the original issue even with the same version of Python and Pip. Instead I tried to excerise pip in every way I could think of with an older version of pip (22.1.2) and the current version of pip (23.3). Tested with various content types.
|
Intent
The std output executed from the command of
pip freeze
is used to generate a project'srequirements.txt
file. As part ofpip
's standard functionality, checks for new version availability are executed "intermittently". When new versions are detected, the std output line starts with[notice]
. For example:Since every line from the std output that does not contain
reconnect
is written into requirements.txt, the scenario where an upgrade is detected will cause the generatedrequirements.txt
file to be invalid.Resolves #270
Type of Change
Approach
Added filter to suppress the std output lines, which start with the text
[notice]
.Refactored filtering to allow testability.
Added test for filtering std output which contains and doesn't contain a line starting with `[notice]'
Automated Tests
The new unit tests should cover validation.
Directions for Reviewers
It is challenging to force the pip upgrade notices to occur. The best approach for validation is probably continuous no-harm validation.
Checklist