Skip to content

Commit 0a5511c

Browse files
committed
fix: regression on file hashing
1 parent 33a5e82 commit 0a5511c

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repo-path = "./repos"
88

99
[tool.poetry]
1010
name = "micropython-stubber"
11-
version = "1.11.5"
11+
version = "1.11.6"
1212
description = "Tooling to create and maintain stubs for MicroPython"
1313
authors = ["Jos Verlinde <jos_verlinde@hotmail.com>"]
1414
license = "MIT"

src/stubber/publish/stubpacker.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ def create_hash(self, include_md:bool=True) -> str:
431431
# BUF_SIZE is totally arbitrary,
432432
BUF_SIZE = 65536 * 16 # lets read stuff in 16 x 64kb chunks!
433433

434-
pkg_hash = hashlib.sha1()
434+
file_hash = hashlib.sha1()
435435
files = list((self.package_path).rglob("**/*.py")) + list((self.package_path).rglob("**/*.pyi"))
436436
if include_md:
437437
files += (
@@ -446,10 +446,9 @@ def create_hash(self, include_md:bool=True) -> str:
446446
data = f.read(BUF_SIZE)
447447
if not data:
448448
break
449-
pkg_hash.update(data)
450-
451-
return pkg_hash.hexdigest()
452-
449+
file_hash.update(data)
450+
return file_hash.hexdigest()
451+
453452
def update_hashes(self) -> None:
454453
"""Update the pachage hashes"""
455454
self.hash = self.create_hash()

0 commit comments

Comments
 (0)