[red-knot] Add --python-platform CLI option (#17284)

## Summary

Add a new `--python-platform` command-line option, in analogy to
`--python-version`.

## Test Plan

Added new integration test.
This commit is contained in:
David Peter 2025-04-07 21:04:44 +02:00 committed by GitHub
parent 4a4a376f02
commit 3657f798c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 87 additions and 7 deletions

View file

@ -21,6 +21,15 @@ pub enum PythonPlatform {
Identifier(String),
}
impl From<String> for PythonPlatform {
fn from(platform: String) -> Self {
match platform.as_str() {
"all" => PythonPlatform::All,
_ => PythonPlatform::Identifier(platform.to_string()),
}
}
}
impl Display for PythonPlatform {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {