From 994341815342426bbbc5095e54f28194548ef5ef Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 7 Oct 2026 16:46:30 +0100 Subject: [PATCH] [ty] Set a fixed release cutoff for uv integration tests (#29188) ty's uv integration tests clear the inherited environment before passing a small set of variables to uv subprocesses. Set `UV_EXCLUDE_NEWER` to `2026-09-22T00:00:00Z` for these tests, limiting package and build-dependency resolution to distribution artifacts uploaded before that time. This keeps newly uploaded artifacts from changing which packages the tests can resolve. --- crates/ty_project/src/uv.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/ty_project/src/uv.rs b/crates/ty_project/src/uv.rs index 82adb0895f..12a7c71837 100644 --- a/crates/ty_project/src/uv.rs +++ b/crates/ty_project/src/uv.rs @@ -70,10 +70,12 @@ impl Combine for UseUv { } } -/// Host variables needed by uv integration tests to find executables, Python installations, and caches. +/// Environment variables for uv integration tests. /// /// Tests use this allowlist after clearing the inherited environment so host settings such as -/// `UV_LOCKED` and `PYTHONPATH` cannot affect subprocesses. +/// `UV_LOCKED` and `PYTHONPATH` cannot affect subprocesses, while retaining executable, Python, +/// and cache discovery. A fixed resolution cutoff prevents tests from executing newly published +/// packages, including build dependencies. #[allow( clippy::disallowed_methods, reason = "Test only code, intentionally inherit variables from the host's environment." @@ -94,6 +96,7 @@ pub fn uv_test_env_vars() -> impl Iterator { ] .into_iter() .filter_map(|name| std::env::var(name).ok().map(|value| (name, value))) + .chain([("UV_EXCLUDE_NEWER", "2026-09-22T00:00:00Z".to_owned())]) } #[cfg(test)]