mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-20 10:30:56 +00:00
20 lines
674 B
Rust
20 lines
674 B
Rust
/// Enum to represent a Python platform.
|
|
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
|
pub(crate) enum PythonPlatform {
|
|
Darwin,
|
|
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"],
|
|
}
|
|
}
|
|
}
|