-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Infer target-version from project metadata (#3470)
* Infer target-version from project metadata * Fix requires-python with ">=3.8.16" * Load requires-python at runtime * Use upstream VersionSpecifiers * Add debug information when parsing ruff.toml * Display debug only if target_version is not set * Bump pep440-rs to add impl Error for Pep440Error
- Loading branch information
1 parent
3a5fbd6
commit b540407
Showing
10 changed files
with
150 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
use super::black::Black; | ||
use super::isort::Isort; | ||
use super::pep621::Project; | ||
|
||
#[derive(Default)] | ||
pub struct ExternalConfig<'a> { | ||
pub black: Option<&'a Black>, | ||
pub isort: Option<&'a Isort>, | ||
pub project: Option<&'a Project>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ mod converter; | |
mod external_config; | ||
mod isort; | ||
mod parser; | ||
pub mod pep621; | ||
mod plugin; | ||
mod pyproject; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//! Extract PEP 621 configuration settings from a pyproject.toml. | ||
use pep440_rs::VersionSpecifiers; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Default)] | ||
pub struct Project { | ||
#[serde(alias = "requires-python", alias = "requires_python")] | ||
pub requires_python: Option<VersionSpecifiers>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters