Skip to content
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

Bring back the fix of #3147 #3213

Merged
merged 1 commit into from
Nov 13, 2018
Merged

Bring back the fix of #3147 #3213

merged 1 commit into from
Nov 13, 2018

Conversation

frostming
Copy link
Contributor

@frostming frostming commented Nov 13, 2018

Signed-off-by: frostming mianghong@gmail.com

The issue

The fix of #3147 is reverted in later commits(#3158).

The fix

Make sure the hash of artifacts are included in lockfile
Fixes #3212

The checklist

  • Associated issue
  • A news fragment in the news/ directory to describe this fix with the extension .bugfix, .feature, .behavior, .doc. .vendor. or .trivial (this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.

Signed-off-by: frostming <mianghong@gmail.com>
Copy link
Member

@techalchemy techalchemy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this seems like a fine reimplementation, like I mentioned in the comments I was debating whether to merge in the hashes in case there were other hashes we picked up on PyPI which we would wind up overwriting... no idea if that's a good idea or not though so we should just move forward

if self.results is not None:
resolved_hashes = self.resolver.resolve_hashes(self.results)
for ireq, ireq_hashes in resolved_hashes.items():
if ireq not in self.hashes:
self.hashes[ireq] = ireq_hashes
if _should_include_hash(ireq):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that's right, this works too as an approach, but I actually meant to come back to this because I have some dictionary merging code I implemented in requirementslib which I have plans to use to merge the development lockfile section with the default one:

https://github.com/sarugaku/requirementslib/blob/master/src/requirementslib/models/lockfile.py#L112-L119

https://github.com/sarugaku/requirementslib/blob/master/src/requirementslib/utils.py#L552-L590

I was planning to use the same approach to merge in the hashes from here, but I think we can hold off on that for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, thanks.

@frostming frostming merged commit e20f0fe into master Nov 13, 2018
@frostming frostming deleted the bugfix/3212 branch November 13, 2018 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows SHA Hash Mismatch
2 participants