Skip to content

Commit

Permalink
Fix the PYAPP_DISTRIBUTION_PATH_PREFIX option
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek committed May 15, 2024
1 parent d2799ae commit 383ce8c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
28 changes: 26 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,19 @@ fn set_python_path(distribution_source: &str) {

let path_prefix = env::var("PYAPP_DISTRIBUTION_PATH_PREFIX").unwrap_or_default();
if !path_prefix.is_empty() {
relative_path = normalize_relative_path(&path_prefix);
if on_windows {
relative_path = format!(
r"{}\{}",
normalize_relative_path(&path_prefix),
relative_path
);
} else {
relative_path = format!(
"{}/{}",
normalize_relative_path(&path_prefix),
relative_path
);
}
}
set_runtime_variable(distribution_variable, &relative_path);

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

let path_prefix = env::var("PYAPP_DISTRIBUTION_PATH_PREFIX").unwrap_or_default();
if !path_prefix.is_empty() {
relative_path = normalize_relative_path(&path_prefix);
if on_windows {
relative_path = format!(
r"{}\{}",
normalize_relative_path(&path_prefix),
relative_path
);
} else {
relative_path = format!(
"{}/{}",
normalize_relative_path(&path_prefix),
relative_path
);
}
}
set_runtime_variable(distribution_variable, &relative_path);

Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## Unreleased

***Fixed:***

- Fix the `PYAPP_DISTRIBUTION_PATH_PREFIX` option

## 0.21.0 - 2024-05-15

***Added:***
Expand Down

0 comments on commit 383ce8c

Please sign in to comment.