Skip to content

Commit 74d6ce6

Browse files
committed
Remove unwanted test feature (#23371)
1 parent 463cdbc commit 74d6ce6

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

native_locator/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,5 @@ serde_json = "1.0.93"
1212
serde_repr = "0.1.10"
1313
regex = "1.10.4"
1414

15-
[features]
16-
test = []
17-
1815
[lib]
1916
doctest = false

native_locator/src/utils.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::{
66
process::Command,
77
};
88

9-
fn get_version_impl(path: &str) -> Option<String> {
9+
pub fn get_version(path: &str) -> Option<String> {
1010
let output = Command::new(path)
1111
.arg("-c")
1212
.arg("import sys; print(sys.version)")
@@ -18,24 +18,6 @@ fn get_version_impl(path: &str) -> Option<String> {
1818
Some(output.to_string())
1919
}
2020

21-
#[cfg(not(feature = "test"))]
22-
pub fn get_version(path: &str) -> Option<String> {
23-
get_version_impl(path)
24-
}
25-
26-
// Tests
27-
28-
#[cfg(feature = "test")]
29-
pub fn get_version(path: &str) -> Option<String> {
30-
use std::path::PathBuf;
31-
let version_file = PathBuf::from(path.to_owned() + ".version");
32-
if version_file.exists() {
33-
let version = std::fs::read_to_string(version_file).ok()?;
34-
return Some(version.trim().to_string());
35-
}
36-
get_version_impl(path)
37-
}
38-
3921
pub fn find_python_binary_path(env_path: &Path) -> Option<PathBuf> {
4022
let python_bin_name = if cfg!(windows) {
4123
"python.exe"

0 commit comments

Comments
 (0)