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

Fix docstring regarding shard size #321

Merged
merged 1 commit into from
Nov 18, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/model_signing/hashing/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@

# Polyfill for Python 3.10
# https://github.com/python/cpython/blob/4deb32a992/Lib/hashlib.py#L195
hasher = hashlib.new(self._algorithm)
buffer = bytearray(2**18)
view = memoryview(buffer)
while True:
size = self._fd.readinto(buffer)
if size == 0:
break
hasher.update(view[:size])
return hashing.Digest(self.digest_name, hasher.digest())

Check warning on line 213 in src/model_signing/hashing/file.py

View workflow job for this annotation

GitHub Actions / Signing with Python 3.11 on Linux

The following lines were not covered in your tests: 205 to 213

@property
@override
Expand Down Expand Up @@ -253,7 +253,7 @@
chunk_size: The amount of file to read at once. Default is 8KB. A
special value of 0 signals to attempt to read everything in a
single call.
shard_size: The amount of file to read at once. Default is 8KB.
shard_size: The size of a file shard. Default is 1,000,000 bytes.
digest_name_override: Optional string to allow overriding the
`digest_name` property to support shorter, standardized names.
"""
Expand Down
Loading