File tree 1 file changed +27
-5
lines changed
crates/uv/tests/it/common
1 file changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -277,11 +277,33 @@ impl TestContext {
277
277
/// Adds a filter that ignores platform information in a Python installation key.
278
278
pub fn with_filtered_python_keys ( mut self ) -> Self {
279
279
// Filter platform keys
280
- self . filters . push ( (
281
- r"((?:cpython|pypy)-\d+\.\d+(?:\.(?:\[X\]|\d+))?[a-z]?(?:\+[a-z]+)?)-[a-z0-9]+-[a-z0-9_]+-[a-z]+"
282
- . to_string ( ) ,
283
- "$1-[PLATFORM]" . to_string ( ) ,
284
- ) ) ;
280
+ let platform_re = r"(?x)
281
+ ( # We capture the group before the platform
282
+ (?:cpython|pypy) # Python implementation
283
+ -
284
+ \d+\.\d+ # Major and minor version
285
+ (?: # The patch version is handled separately
286
+ \.
287
+ (?:
288
+ \[X\] # A previously filtered patch version [X]
289
+ | # OR
290
+ \d+ # An actual patch version
291
+ )
292
+ )? # (we allow the patch version to be missing entirely, e.g., in a request)
293
+ [a-z]? # Pre-release letter
294
+ (?:
295
+ \+[a-z]+ # An optional variant variant, such as `+free-threaded
296
+ )?
297
+ )
298
+ -
299
+ [a-z0-9]+ # Operating system (e.g., 'macos')
300
+ -
301
+ [a-z0-9_]+ # Architecture (e.g., 'aarch64')
302
+ -
303
+ [a-z]+ # Libc (e.g., 'none')
304
+ " ;
305
+ self . filters
306
+ . push ( ( platform_re. to_string ( ) , "$1-[PLATFORM]" . to_string ( ) ) ) ;
285
307
self
286
308
}
287
309
You can’t perform that action at this time.
0 commit comments