[master] change regex for pkg name match #66880
Closed
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.
What does this PR do?
Change the regex to accept underscore as an acceptable symbol in package name.
What issues does this PR fix or reference?
According to python normalization rules the underscore (
_
) is allowed symbol in package name. Note the examples there allow for underscore.Previous Behavior
When trying to install package with underscore in the name
with pip.installed
, although the installation is successful, there's a problem with confirming if the package is installed (and always will trigger changes). It doesn't matter if you refer inpip.installed
to the package with original name (with underscore) or with "normalized" name (with dash), always you have one of the following:Comment: There was no error installing package 'requests_ntlm' although it does not show when calling 'pip.freeze'.
Comment: There was no error installing package 'requests-ntlm' although it does not show when calling 'pip.freeze'.
Note, the JSON output is with original name:
{"name": "requests_ntlm", "version": "1.3.0"}