Skip to content

Commit 727f267

Browse files
committed
Avoid filtering Python executables names during install tests
1 parent 8074917 commit 727f267

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

crates/uv/tests/it/common/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ impl TestContext {
219219
pub fn with_filtered_python_keys(mut self) -> Self {
220220
// Filter platform keys
221221
self.filters.push((
222-
r"((?:cpython|pypy)-\d+\.\d+(?:\.(?:\[X\]|\d+))?[a-z]?(?:\+[a-z]+)?)-.*".to_string(),
222+
r"((?:cpython|pypy)-\d+\.\d+(?:\.(?:\[X\]|\d+))?[a-z]?(?:\+[a-z]+)?)-[a-z0-9]+-[a-z0-9]+-[a-z]+"
223+
.to_string(),
223224
"$1-[PLATFORM]".to_string(),
224225
));
225226
self

crates/uv/tests/it/python_install.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fn python_install() {
8585
----- stderr -----
8686
Searching for Python versions matching: Python 3.13
8787
Uninstalled Python 3.13.0 in [TIME]
88-
- cpython-3.13.0-[PLATFORM]
88+
- cpython-3.13.0-[PLATFORM] (python3.13)
8989
"###);
9090
}
9191

@@ -103,7 +103,7 @@ fn python_install_preview() {
103103
104104
----- stderr -----
105105
Installed Python 3.13.0 in [TIME]
106-
+ cpython-3.13.0-[PLATFORM]
106+
+ cpython-3.13.0-[PLATFORM] (python3.13)
107107
"###);
108108

109109
let bin_python = context
@@ -147,7 +147,7 @@ fn python_install_preview() {
147147
148148
----- stderr -----
149149
Installed Python 3.13.0 in [TIME]
150-
~ cpython-3.13.0-[PLATFORM]
150+
~ cpython-3.13.0-[PLATFORM] (python3.13)
151151
"###);
152152

153153
// The executable should still be present in the bin directory
@@ -161,7 +161,7 @@ fn python_install_preview() {
161161
162162
----- stderr -----
163163
Installed Python 3.13.0 in [TIME]
164-
+ cpython-3.13.0-[PLATFORM]
164+
+ cpython-3.13.0-[PLATFORM] (python3.13)
165165
"###);
166166

167167
// The executable should still be present in the bin directory
@@ -188,7 +188,7 @@ fn python_install_preview() {
188188
189189
----- stderr -----
190190
Installed Python 3.13.0 in [TIME]
191-
+ cpython-3.13.0-[PLATFORM]
191+
+ cpython-3.13.0-[PLATFORM] (python3.13)
192192
"###);
193193

194194
bin_python.assert(predicate::path::exists());
@@ -220,7 +220,7 @@ fn python_install_preview() {
220220
----- stderr -----
221221
Searching for Python versions matching: Python 3.13
222222
Uninstalled Python 3.13.0 in [TIME]
223-
- cpython-3.13.0-[PLATFORM]
223+
- cpython-3.13.0-[PLATFORM] (python3.13)
224224
"###);
225225

226226
// The executable should be removed
@@ -244,7 +244,7 @@ fn python_install_preview_upgrade() {
244244
245245
----- stderr -----
246246
Installed Python 3.12.5 in [TIME]
247-
+ cpython-3.12.5-[PLATFORM]
247+
+ cpython-3.12.5-[PLATFORM] (python3.12)
248248
"###);
249249

250250
// Installing 3.12.4 should not replace the executable, but also shouldn't fail
@@ -262,7 +262,7 @@ fn python_install_preview_upgrade() {
262262
filters => context.filters(),
263263
}, {
264264
insta::assert_snapshot!(
265-
read_link_path(&bin_python), @"[TEMP_DIR]/managed/cpython-3.12.5-[PLATFORM]"
265+
read_link_path(&bin_python), @"[TEMP_DIR]/managed/cpython-3.12.5-[PLATFORM]/bin/python3.12"
266266
);
267267
});
268268

@@ -281,7 +281,7 @@ fn python_install_preview_upgrade() {
281281
filters => context.filters(),
282282
}, {
283283
insta::assert_snapshot!(
284-
read_link_path(&bin_python), @"[TEMP_DIR]/managed/cpython-3.12.5-[PLATFORM]"
284+
read_link_path(&bin_python), @"[TEMP_DIR]/managed/cpython-3.12.5-[PLATFORM]/bin/python3.12"
285285
);
286286
});
287287

@@ -293,14 +293,14 @@ fn python_install_preview_upgrade() {
293293
294294
----- stderr -----
295295
Installed Python 3.12.4 in [TIME]
296-
+ cpython-3.12.4-[PLATFORM]
296+
+ cpython-3.12.4-[PLATFORM] (python3.12)
297297
"###);
298298

299299
insta::with_settings!({
300300
filters => context.filters(),
301301
}, {
302302
insta::assert_snapshot!(
303-
read_link_path(&bin_python), @"[TEMP_DIR]/managed/cpython-3.12.4-[PLATFORM]"
303+
read_link_path(&bin_python), @"[TEMP_DIR]/managed/cpython-3.12.4-[PLATFORM]/bin/python3.12"
304304
);
305305
});
306306

@@ -312,14 +312,14 @@ fn python_install_preview_upgrade() {
312312
313313
----- stderr -----
314314
Installed Python 3.12.6 in [TIME]
315-
+ cpython-3.12.6-[PLATFORM]
315+
+ cpython-3.12.6-[PLATFORM] (python3.12)
316316
"###);
317317

318318
insta::with_settings!({
319319
filters => context.filters(),
320320
}, {
321321
insta::assert_snapshot!(
322-
read_link_path(&bin_python), @"[TEMP_DIR]/managed/cpython-3.12.6-[PLATFORM]"
322+
read_link_path(&bin_python), @"[TEMP_DIR]/managed/cpython-3.12.6-[PLATFORM]/bin/python3.12"
323323
);
324324
});
325325
}
@@ -336,7 +336,7 @@ fn python_install_freethreaded() {
336336
337337
----- stderr -----
338338
Installed Python 3.13.0 in [TIME]
339-
+ cpython-3.13.0+freethreaded-[PLATFORM]
339+
+ cpython-3.13.0+freethreaded-[PLATFORM] (python3.13t)
340340
"###);
341341

342342
let bin_python = context
@@ -391,8 +391,8 @@ fn python_install_freethreaded() {
391391
----- stderr -----
392392
Searching for Python installations
393393
Uninstalled 2 versions in [TIME]
394-
- cpython-3.13.0-[PLATFORM]
395-
- cpython-3.13.0+freethreaded-[PLATFORM]
394+
- cpython-3.13.0-[PLATFORM] (python3.13)
395+
- cpython-3.13.0+freethreaded-[PLATFORM] (python3.13t)
396396
"###);
397397
}
398398

0 commit comments

Comments
 (0)