mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-04 23:50:57 +00:00
Move red_knot_python_semantic::PythonVersion
to the ruff_python_ast
crate (#16147)
## Summary This PR moves the `PythonVersion` struct from the `red_knot_python_semantic` crate to the `ruff_python_ast` crate so that it can be used more easily in the syntax error detection work. Compared to that [prototype](https://github.com/astral-sh/ruff/pull/16090/) these changes reduce us from 2 `PythonVersion` structs to 1. This does not unify any of the `PythonVersion` *enums*, but I hope to make some progress on that in a follow-up. ## Test Plan Existing tests, this should not change any external behavior. --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
fa28dc5ccf
commit
f58a54f043
27 changed files with 62 additions and 59 deletions
|
@ -6,12 +6,13 @@ use rustc_hash::{FxBuildHasher, FxHashSet};
|
|||
use ruff_db::files::{File, FilePath, FileRootKind};
|
||||
use ruff_db::system::{DirectoryEntry, System, SystemPath, SystemPathBuf};
|
||||
use ruff_db::vendored::{VendoredFileSystem, VendoredPath};
|
||||
use ruff_python_ast::python_version::PythonVersion;
|
||||
|
||||
use crate::db::Db;
|
||||
use crate::module_name::ModuleName;
|
||||
use crate::module_resolver::typeshed::{vendored_typeshed_versions, TypeshedVersions};
|
||||
use crate::site_packages::VirtualEnvironment;
|
||||
use crate::{Program, PythonVersion, SearchPathSettings, SitePackages};
|
||||
use crate::{Program, SearchPathSettings, SitePackages};
|
||||
|
||||
use super::module::{Module, ModuleKind};
|
||||
use super::path::{ModulePath, SearchPath, SearchPathValidationError};
|
||||
|
@ -724,12 +725,12 @@ mod tests {
|
|||
assert_const_function_query_was_not_run, assert_function_query_was_not_run,
|
||||
};
|
||||
use ruff_db::Db;
|
||||
use ruff_python_ast::python_version::PythonVersion;
|
||||
|
||||
use crate::db::tests::TestDb;
|
||||
use crate::module_name::ModuleName;
|
||||
use crate::module_resolver::module::ModuleKind;
|
||||
use crate::module_resolver::testing::{FileSpec, MockedTypeshed, TestCase, TestCaseBuilder};
|
||||
use crate::PythonVersion;
|
||||
use crate::{ProgramSettings, PythonPlatform};
|
||||
|
||||
use super::*;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue