Skip to content

Commit

Permalink
Update parse_sysconfigdata test to best-guess values for linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashley Anderson committed Nov 16, 2021
1 parent 7ab810a commit c8f0785
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions pyo3-build-config/src/impl_.rs
Expand Up @@ -1671,13 +1671,29 @@ mod tests {
};
let parsed_config = super::parse_sysconfigdata(sysconfigdata_path).unwrap();

// this is generally the format of the abi_flags, abi_tag, and ext_suffix on linux so this
// should work for CI
let expected_abi_flags = if PythonVersion::PY37 >= interpreter_config.version {
"m".to_string()
} else {
"".to_string()
};
let expected_abi_tag = format!(
"{}{}{}",
interpreter_config.version.major,
interpreter_config.version.minor,
expected_abi_flags.clone(),
);
let expected_ext_suffix =
format!(".cpython-{}-x86_64-linux-gnu.so", expected_abi_tag.clone());

assert_eq!(
parsed_config,
InterpreterConfig {
abi3: false,
abi_flags: Some("m".to_string()),
abi_tag: Some("37m".to_string()),
ext_suffix: Some(".cpython-37m-x86_64-linux-gnu.so".to_string()),
abi_flags: Some(expected_abi_flags),
abi_tag: Some(expected_abi_tag),
ext_suffix: Some(expected_ext_suffix),
build_flags: BuildFlags(interpreter_config.build_flags.0.clone()),
pointer_width: Some(64),
executable: None,
Expand Down

0 comments on commit c8f0785

Please sign in to comment.