Skip to content

Commit c08caa8

Browse files
committed
Posix path in builder
1 parent 5fb66c3 commit c08caa8

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

dlt/_workspace/deployment/package_builder.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,16 @@ def write_package_to_stream(
3838
with tarfile.open(fileobj=output_stream, mode="w|gz") as tar:
3939
for file_path in file_selector:
4040
full_path = self.run_context.run_dir / file_path
41+
# Use POSIX paths for tar archives (cross-platform compatibility)
42+
posix_path = file_path.as_posix()
4143
tar.add(
4244
full_path,
43-
arcname=f"{DEFAULT_DEPLOYMENT_FILES_FOLDER}/{file_path}",
45+
arcname=f"{DEFAULT_DEPLOYMENT_FILES_FOLDER}/{posix_path}",
4446
recursive=False,
4547
)
4648
manifest_files.append(
4749
{
48-
"relative_path": str(file_path),
50+
"relative_path": posix_path,
4951
"size_in_bytes": full_path.stat().st_size,
5052
}
5153
)

tests/workspace/deployment/test_file_selector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ def test_file_selector_respects_gitignore(with_additional_exclude: bool) -> None
2828
selector = WorkspaceFileSelector(
2929
ctx, additional_excludes=additional_excludes, ignore_file=".ignorefile"
3030
)
31-
files = set([str(f) for f in selector])
31+
files = set([f.as_posix() for f in selector])
3232
assert files == expected_files

tests/workspace/deployment/test_package_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_build_package() -> None:
7171
selector = WorkspaceFileSelector(ctx)
7272

7373
package_path, content_hash = builder.build_package(selector)
74-
assert str(package_path).startswith(f"{ctx.data_dir}/deployment-")
74+
assert package_path.as_posix().startswith(f"{ctx.data_dir}/deployment-")
7575
assert len(content_hash) == 44 # sha3_256 base64 string
7676

7777
time.sleep(0.2)

0 commit comments

Comments
 (0)