feat: expose 'pip_utils.normalize_name' function#1542
Merged
rickeylev merged 7 commits intobazel-contrib:mainfrom Nov 9, 2023
Merged
feat: expose 'pip_utils.normalize_name' function#1542rickeylev merged 7 commits intobazel-contrib:mainfrom
rickeylev merged 7 commits intobazel-contrib:mainfrom
Conversation
80fc54d to
cdeb5d8
Compare
rickeylev
approved these changes
Nov 7, 2023
Collaborator
rickeylev
left a comment
There was a problem hiding this comment.
Can you also:
- Add a comment on the
all_whl_requirements_by_packageline thatpip_utils.normalize_name()should be used to construct the correct key
aignas
commented
Nov 8, 2023
alexeagle
reviewed
Nov 8, 2023
| ]), | ||
| "%%ALL_WHL_REQUIREMENTS_BY_PACKAGE%%": _format_dict(_repr_dict({ | ||
| name: macro_tmpl.format(p, "whl") | ||
| normalize_name(name): macro_tmpl.format(p, "whl") |
Contributor
There was a problem hiding this comment.
Note: as an alternative, you could revert this change that I made:
78fc4de#diff-bced444149cf9f25b36837efb2792070f362650b01f553d9d01bef080ebfefabL279-R279
which was only to preserve the original user-provided name.
If you revert that, then bzl_packages becomes just a list of normalized names again, and you wouldn't need to normalize it here.
This may be better just to simplify the code, now that we have no need for bzl_packages to be a map.
alexeagle
approved these changes
Nov 9, 2023
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.
With this change users can use a previously private function to normalize a
PyPI package name into something that bazel can use.