Skip to content

Commit 383ce8c

Browse files
committed
Fix the PYAPP_DISTRIBUTION_PATH_PREFIX option
1 parent d2799ae commit 383ce8c

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

build.rs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,19 @@ fn set_python_path(distribution_source: &str) {
628628

629629
let path_prefix = env::var("PYAPP_DISTRIBUTION_PATH_PREFIX").unwrap_or_default();
630630
if !path_prefix.is_empty() {
631-
relative_path = normalize_relative_path(&path_prefix);
631+
if on_windows {
632+
relative_path = format!(
633+
r"{}\{}",
634+
normalize_relative_path(&path_prefix),
635+
relative_path
636+
);
637+
} else {
638+
relative_path = format!(
639+
"{}/{}",
640+
normalize_relative_path(&path_prefix),
641+
relative_path
642+
);
643+
}
632644
}
633645
set_runtime_variable(distribution_variable, &relative_path);
634646

@@ -687,7 +699,19 @@ fn set_site_packages_path(distribution_source: &str) {
687699

688700
let path_prefix = env::var("PYAPP_DISTRIBUTION_PATH_PREFIX").unwrap_or_default();
689701
if !path_prefix.is_empty() {
690-
relative_path = normalize_relative_path(&path_prefix);
702+
if on_windows {
703+
relative_path = format!(
704+
r"{}\{}",
705+
normalize_relative_path(&path_prefix),
706+
relative_path
707+
);
708+
} else {
709+
relative_path = format!(
710+
"{}/{}",
711+
normalize_relative_path(&path_prefix),
712+
relative_path
713+
);
714+
}
691715
}
692716
set_runtime_variable(distribution_variable, &relative_path);
693717

docs/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88

99
## Unreleased
1010

11+
***Fixed:***
12+
13+
- Fix the `PYAPP_DISTRIBUTION_PATH_PREFIX` option
14+
1115
## 0.21.0 - 2024-05-15
1216

1317
***Added:***

0 commit comments

Comments
 (0)