Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions poetry/core/packages/file_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def full_path(self):
def is_file(self):
return True

def hash(self):
h = hashlib.sha256()
def hash(self, name="sha256"):
h = hashlib.new(name)
Comment on lines -66 to +67
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All the docs say the named constructors are faster and should be preferred, and this doesn't do anything to address the issue. It can be safely dropped from the PR.

with self._full_path.open("rb") as fp:
for content in iter(lambda: fp.read(io.DEFAULT_BUFFER_SIZE), b""):
h.update(content)
Expand Down
1 change: 1 addition & 0 deletions poetry/core/packages/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ def clone(self): # type: () -> "Package"
clone.extras = self.extras
clone.root_dir = self.root_dir
clone.develop = self.develop
clone.files = self.files
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This appears to be the "secret sauce" to get signature verification working.


for dep in self.requires:
clone.requires.append(dep)
Expand Down