<#903 fix bug in Image.with_source_file not bumpin...
# flyte-github
a
#903 fix bug in Image.with_source_file not bumping image hash Pull request opened by cosmicBboy This pull request improves file hashing logic and type safety in the project. The main focus is on ensuring that both files and directories are correctly incorporated into hash computations, and on improving development experience with better type checking. File hashing and digest computation improvements: • Updated the
update_hasher_for_source
function docstring to clarify that it now handles both single files and directory trees, ensuring content and relative paths are incorporated into the hash. • Fixed the logic in
compute_digest_for_dir
to properly handle the case when the input is a single file, ensuring that file contents are hashed even when not inside a directory. • Added a test in
test_with_source
to verify that hashing a single file reflects changes in its content, ensuring correctness for image layer hashing. Development environment/type checking: • Added
types-PyYAML
and
types-aiofiles
to the
dev
dependencies in
pyproject.toml
to improve static type checking and developer experience. flyteorg/flyte-sdk