@@ -403,24 +403,19 @@ export async function discoverPypiHubs(
403403 : `static parse (${ parsed . length } )` ,
404404 )
405405 }
406- // Seed with the default hub name first (so it appears first in output if
407- // validated). Parsed candidates overwrite the seed when they share the same
408- // hub name so metadata (requirements_lock, python_version) is preserved.
409- const seen = new Set < string > ( )
410- const candidates : PypiHubCandidate [ ] = [ ]
411- for ( const c of parsed ) {
412- if ( ! seen . has ( c . hubName ) ) {
413- seen . add ( c . hubName )
414- candidates . push ( c )
415- }
416- }
417- if ( ! seen . has ( DEFAULT_PYPI_HUB_SEED ) ) {
418- candidates . unshift ( {
419- hubName : DEFAULT_PYPI_HUB_SEED ,
420- source : 'default-seed' ,
421- workspaceMode : 'unknown' ,
422- } )
423- }
406+ // Prepend the default hub seed unless parsed metadata already covers it.
407+ const candidates : PypiHubCandidate [ ] = parsed . some (
408+ c => c . hubName === DEFAULT_PYPI_HUB_SEED ,
409+ )
410+ ? parsed
411+ : [
412+ {
413+ hubName : DEFAULT_PYPI_HUB_SEED ,
414+ source : 'default-seed' ,
415+ workspaceMode : 'unknown' ,
416+ } ,
417+ ...parsed ,
418+ ]
424419 if ( verbose ) {
425420 logger . log (
426421 '[VERBOSE] discovery: candidate set to probe (seed-first, deduped):' ,
0 commit comments