Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: npy version issue #1126

Merged
merged 1 commit into from
Oct 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/env_vars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ pub fn python_vars(output: &Output) -> HashMap<String, Option<String>> {
}

if let Some(py_ver) = python_version {
let py_ver = py_ver.split('.').collect::<Vec<_>>();
let py_ver_str = format!("{}.{}", py_ver[0], py_ver[1]);
let py_ver: Vec<_> = py_ver.split('.').take(2).collect();
let py_ver_str = py_ver.join(".");
let stdlib_dir = get_stdlib_dir(
output.prefix(),
output.host_platform().platform,
Expand All @@ -80,9 +80,9 @@ pub fn python_vars(output: &Output) -> HashMap<String, Option<String>> {
}

if let Some(npy_version) = output.variant().get("numpy") {
let np_ver = npy_version.split('.').collect::<Vec<_>>();
let np_ver = format!("{}.{}", np_ver[0], np_ver[1]);
insert!(result, "NPY_VER", np_ver);
let npy_ver: Vec<_> = npy_version.split('.').take(2).collect();
let npy_ver = npy_ver.join(".");
insert!(result, "NPY_VER", npy_ver);
insert!(result, "NPY_DISTUTILS_APPEND_FLAGS", "1");
}

Expand Down
Loading