mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 05:15:12 +00:00
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
This commit is contained in:
parent
3a5fbd6d74
commit
b540407b74
10 changed files with 151 additions and 7 deletions
|
@ -46,8 +46,15 @@ fn main() -> Result<()> {
|
|||
.map(|tool| ExternalConfig {
|
||||
black: tool.black.as_ref(),
|
||||
isort: tool.isort.as_ref(),
|
||||
..Default::default()
|
||||
})
|
||||
.unwrap_or_default();
|
||||
let external_config = ExternalConfig {
|
||||
project: pyproject
|
||||
.as_ref()
|
||||
.and_then(|pyproject| pyproject.project.as_ref()),
|
||||
..external_config
|
||||
};
|
||||
|
||||
// Create Ruff's pyproject.toml section.
|
||||
let pyproject = flake8_to_ruff::convert(&config, &external_config, args.plugin)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue