Skip to content

Commit

Permalink
Update pyproject-toml to 0.8 (#8351)
Browse files Browse the repository at this point in the history
`build-system` is now also optional upstream.

Closes #8343
  • Loading branch information
konstin authored Oct 30, 2023
1 parent f483ed4 commit cf74deb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/ruff_linter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ path-absolutize = { workspace = true, features = [
] }
pathdiff = { version = "0.2.1" }
pep440_rs = { version = "0.3.12", features = ["serde"] }
pyproject-toml = { version = "0.7.0" }
pyproject-toml = { version = "0.8.0" }
quick-junit = { version = "0.3.2" }
regex = { workspace = true }
result-like = { version = "0.4.6" }
Expand Down
13 changes: 1 addition & 12 deletions crates/ruff_linter/src/pyproject_toml.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use colored::Colorize;
use log::warn;
use pyproject_toml::{BuildSystem, Project};
use pyproject_toml::PyProjectToml;
use ruff_text_size::{TextRange, TextSize};
use serde::{Deserialize, Serialize};

use ruff_diagnostics::Diagnostic;
use ruff_source_file::SourceFile;
Expand All @@ -13,16 +12,6 @@ use crate::rules::ruff::rules::InvalidPyprojectToml;
use crate::settings::LinterSettings;
use crate::IOError;

/// Unlike [`pyproject_toml::PyProjectToml`], in our case `build_system` is also optional
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
struct PyProjectToml {
/// Build-related data
build_system: Option<BuildSystem>,
/// Project metadata
project: Option<Project>,
}

pub fn lint_pyproject_toml(source_file: SourceFile, settings: &LinterSettings) -> Vec<Message> {
let Some(err) = toml::from_str::<PyProjectToml>(source_file.source_text()).err() else {
return Vec::default();
Expand Down

0 comments on commit cf74deb

Please sign in to comment.