mirror of
https://github.com/astral-sh/ruff.git
synced 2026-10-28 10:45:37 +08:00
[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.
This commit is contained in:
1 parent
ad08d94e05
commit
9943418153
1 file changed
+5
-2
@@ -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<Item = (&'static str, String)> {
|
||||
]
|
||||
.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)]
|
||||
|
||||
Reference in new issue
Block a user