-
-
Notifications
You must be signed in to change notification settings - Fork 615
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
Remove unwanted annotations from primary packages #542
Remove unwanted annotations from primary packages #542
Conversation
84a87ba
to
3e2b62a
Compare
I forgot to tell in the PR how this problem can be reproduced. Setup:
After the setup:
Version info:
As we can see from the output, the With this information I feel this PR is ready to be reviewed. |
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.
Nice, thank you.
I requested a small change, other than that, LGTM
piptools/writer.py
Outdated
@@ -137,7 +137,7 @@ def _format_requirement(self, ireq, reverse_dependencies, primary_packages, mark | |||
for hash_ in sorted(ireq_hashes): | |||
line += " \\\n --hash={}".format(hash_) | |||
|
|||
if not self.annotate or ireq.name in primary_packages: | |||
if not self.annotate or ireq.name.lower() in primary_packages: |
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.
Good catch
While at it, as primary_packages
was generated using key_from_req
, we should use that here too for consistency.
key_from_req(ireq.req) in primary_packages
3e2b62a
to
38f8d61
Compare
38f8d61
to
1e7076c
Compare
@vphilippon: I've made the change you requested. |
Thanks for the contribution! |
primary_packages
contains lower case package names where asireq.name
may contain upper case letters. This causes the primary packages to have the unwanted# via XXX
annotations. In my case this issue was seen with packagesSQLAlchemy
andFlask
.Contributor checklist