<#690 Code bundling using posix-style paths> Pull ...
# flyte-github
a
#690 Code bundling using posix-style paths Pull request opened by cosmicBboy This pull request improves cross-platform compatibility in the Flyte code bundle packaging and hashing logic, with a focus on ensuring consistent behavior between Windows and Unix systems. The main changes guarantee that all file paths used in hashing and tarball creation are normalized to POSIX-style (forward slash) paths, preventing subtle bugs and inconsistencies. Comprehensive tests have also been added to verify these behaviors. Cross-platform path normalization: • Updated
ls_files
and
ls_relative_files
in
src/flyte/_code_bundle/_utils.py
to use POSIX-style paths for hashing, ensuring that file digests are consistent across platforms. [1] [2] • Modified
create_bundle
in
src/flyte/_code_bundle/_packaging.py
to ensure tarball entries always use forward slashes, regardless of the platform or input path style. Testing for cross-platform consistency: • Added extensive tests in
tests/flyte/code_bundle/test_code_bundle.py
to verify: • Hashes generated by
ls_files
and
ls_relative_files
are consistent and use POSIX paths. • Tarball entries created by
create_bundle
always use forward slashes, even when input paths are Windows-style. • Included necessary imports for tarfile and os in the test file. • Updated test imports to directly test the affected functions. flyteorg/flyte-sdk