mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-21 19:04:33 +00:00
Make lib iteration platform-specific (#5406)
This commit is contained in:
parent
6587fb844a
commit
979049b2a6
3 changed files with 21 additions and 8 deletions
|
@ -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"],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue