Skip to content

Commit

Permalink
python: show regular cpython versions last (#1162)
Browse files Browse the repository at this point in the history
Fits convention in other plugins and makes it so they are what you see and not hard to find towards the start
  • Loading branch information
jdx authored Dec 13, 2023
1 parent cb874c6 commit 09dfd03
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/plugins/core/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::collections::HashMap;
use std::path::{Path, PathBuf};

use color_eyre::eyre::{eyre, Result};
use itertools::Itertools;

use crate::cmd::CmdLineRunner;
use crate::config::{Config, Settings};
Expand Down Expand Up @@ -72,7 +73,12 @@ impl PythonPlugin {
let python_build_bin = self.python_build_bin();
CorePlugin::run_fetch_task_with_timeout(move || {
let output = cmd!(python_build_bin, "--definitions").read()?;
Ok(output.split('\n').map(|s| s.to_string()).collect())
let versions = output
.split('\n')
.map(|s| s.to_string())
.sorted_by_cached_key(|v| regex!(r"^\d+").is_match(v))
.collect();
Ok(versions)
})
}

Expand Down

0 comments on commit 09dfd03

Please sign in to comment.