Skip to content

Commit

Permalink
fix: regression on file hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
Josverl committed Jan 18, 2023
1 parent 33a5e82 commit 0a5511c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repo-path = "./repos"

[tool.poetry]
name = "micropython-stubber"
version = "1.11.5"
version = "1.11.6"
description = "Tooling to create and maintain stubs for MicroPython"
authors = ["Jos Verlinde <jos_verlinde@hotmail.com>"]
license = "MIT"
Expand Down
9 changes: 4 additions & 5 deletions src/stubber/publish/stubpacker.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def create_hash(self, include_md:bool=True) -> str:
# BUF_SIZE is totally arbitrary,
BUF_SIZE = 65536 * 16 # lets read stuff in 16 x 64kb chunks!

pkg_hash = hashlib.sha1()
file_hash = hashlib.sha1()
files = list((self.package_path).rglob("**/*.py")) + list((self.package_path).rglob("**/*.pyi"))
if include_md:
files += (
Expand All @@ -446,10 +446,9 @@ def create_hash(self, include_md:bool=True) -> str:
data = f.read(BUF_SIZE)
if not data:
break
pkg_hash.update(data)

return pkg_hash.hexdigest()

file_hash.update(data)
return file_hash.hexdigest()

def update_hashes(self) -> None:
"""Update the pachage hashes"""
self.hash = self.create_hash()
Expand Down

0 comments on commit 0a5511c

Please sign in to comment.