mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 21:40:51 -05:00
Make lib iteration platform-specific (#5406)
This commit is contained in:
@@ -5,3 +5,16 @@ pub(crate) enum PythonPlatform {
|
||||
Linux,
|
||||
Windows,
|
||||
}
|
||||
|
||||
impl PythonPlatform {
|
||||
/// Returns the platform-specific library names. These are the candidate names for the top-level
|
||||
/// subdirectory within a virtual environment that contains the `site-packages` directory
|
||||
/// (with a `pythonX.Y` directory in-between).
|
||||
pub(crate) fn lib_names(&self) -> &[&'static str] {
|
||||
match self {
|
||||
PythonPlatform::Darwin => &["lib"],
|
||||
PythonPlatform::Linux => &["lib", "lib64"],
|
||||
PythonPlatform::Windows => &["Lib"],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user