[ty] Remove vestigial pyvenv.cfg creation in mdtest (#18006)
Some checks are pending
CI / cargo clippy (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / Fuzz for new ty panics (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / check playground (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
[ty Playground] Release / publish (push) Waiting to run

Following #17991, removes some of
https://github.com/astral-sh/ruff/pull/17222 which is no longer strictly
necessary. I don't actually think it's that ugly to have around? no
strong feelings on retaining it or not.
This commit is contained in:
Zanie Blue 2025-05-10 15:52:49 -05:00 committed by GitHub
parent 0bb8cbdf07
commit 7e8ba2b68e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 26 deletions

View file

@ -170,7 +170,6 @@ fn run_test(
let mut typeshed_files = vec![];
let mut has_custom_versions_file = false;
let mut has_custom_pyvenv_cfg_file = false;
let test_files: Vec<_> = test
.files()
@ -196,9 +195,8 @@ fn run_test(
}
} else if let Some(python_path) = python_path {
if let Ok(relative_path) = full_path.strip_prefix(python_path) {
if relative_path.as_str() == "pyvenv.cfg" {
has_custom_pyvenv_cfg_file = true;
} else {
// Construct the path to the site-packages directory
if relative_path.as_str() != "pyvenv.cfg" {
let mut new_path = SystemPathBuf::new();
for component in full_path.components() {
let component = component.as_str();
@ -256,16 +254,6 @@ fn run_test(
}
}
if let Some(python_path) = python_path {
if !has_custom_pyvenv_cfg_file {
let pyvenv_cfg_file = python_path.join("pyvenv.cfg");
let home_directory = SystemPathBuf::from(format!("/Python{python_version}"));
db.create_directory_all(&home_directory).unwrap();
db.write_file(&pyvenv_cfg_file, format!("home = {home_directory}"))
.unwrap();
}
}
let configuration = test.configuration();
let settings = ProgramSettings {