Skip to content

Commit

Permalink
stop emitting Py_3_6 cfg (PyO3#4583)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt authored Sep 27, 2024
1 parent 1ae08de commit e053dbc
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions pyo3-build-config/src/impl_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,7 @@ impl InterpreterConfig {

let mut out = vec![];

// pyo3-build-config was released when Python 3.6 was supported, so minimum flag to emit is
// Py_3_6 (to avoid silently breaking users who depend on this cfg).
for i in 6..=self.version.minor {
for i in MINIMUM_SUPPORTED_VERSION.minor..=self.version.minor {
out.push(format!("cargo:rustc-cfg=Py_3_{}", i));
}

Expand Down Expand Up @@ -2708,7 +2706,6 @@ mod tests {
assert_eq!(
interpreter_config.build_script_outputs(),
[
"cargo:rustc-cfg=Py_3_6".to_owned(),
"cargo:rustc-cfg=Py_3_7".to_owned(),
"cargo:rustc-cfg=Py_3_8".to_owned(),
]
Expand All @@ -2721,7 +2718,6 @@ mod tests {
assert_eq!(
interpreter_config.build_script_outputs(),
[
"cargo:rustc-cfg=Py_3_6".to_owned(),
"cargo:rustc-cfg=Py_3_7".to_owned(),
"cargo:rustc-cfg=Py_3_8".to_owned(),
"cargo:rustc-cfg=PyPy".to_owned(),
Expand All @@ -2748,7 +2744,6 @@ mod tests {
assert_eq!(
interpreter_config.build_script_outputs(),
[
"cargo:rustc-cfg=Py_3_6".to_owned(),
"cargo:rustc-cfg=Py_3_7".to_owned(),
"cargo:rustc-cfg=Py_LIMITED_API".to_owned(),
]
Expand All @@ -2761,7 +2756,6 @@ mod tests {
assert_eq!(
interpreter_config.build_script_outputs(),
[
"cargo:rustc-cfg=Py_3_6".to_owned(),
"cargo:rustc-cfg=Py_3_7".to_owned(),
"cargo:rustc-cfg=PyPy".to_owned(),
"cargo:rustc-cfg=Py_LIMITED_API".to_owned(),
Expand Down Expand Up @@ -2793,7 +2787,6 @@ mod tests {
assert_eq!(
interpreter_config.build_script_outputs(),
[
"cargo:rustc-cfg=Py_3_6".to_owned(),
"cargo:rustc-cfg=Py_3_7".to_owned(),
"cargo:rustc-cfg=Py_3_8".to_owned(),
"cargo:rustc-cfg=Py_3_9".to_owned(),
Expand Down Expand Up @@ -2827,7 +2820,6 @@ mod tests {
assert_eq!(
interpreter_config.build_script_outputs(),
[
"cargo:rustc-cfg=Py_3_6".to_owned(),
"cargo:rustc-cfg=Py_3_7".to_owned(),
"cargo:rustc-cfg=py_sys_config=\"Py_DEBUG\"".to_owned(),
]
Expand Down

0 comments on commit e053dbc

Please sign in to comment.