Benchmark: fallback korvaa Poetry-pyproject.toml PEP 621 -versiolla
Kaikki testatut mallit generoivat [tool.poetry] -muodon vaikka kultainen esimerkki näyttää [project]-muodon. uv sync ei ymmärrä Poetrya → pytest ei asennu → kaatuu. Fallback korvaa rikkinäisen pyproject.toml kultaisella versiolla.
This commit is contained in:
@@ -338,6 +338,16 @@ async function runPipeline(model, scenario) {
|
||||
result.validationIssues = issues.length;
|
||||
result.fixRounds = fixRound;
|
||||
|
||||
// Korjaa pyproject.toml jos malli generoi Poetry-muodon
|
||||
if (files['pyproject.toml'] && !files['pyproject.toml'].includes('[project]')) {
|
||||
const goldenPyproject = join(GOLDEN_DIR, 'pyproject.toml');
|
||||
if (existsSync(goldenPyproject)) {
|
||||
const nameMatch = files['pyproject.toml'].match(/name\s*=\s*"([^"]+)"/);
|
||||
const name = nameMatch ? nameMatch[1] : 'generated-app';
|
||||
files['pyproject.toml'] = readFileSync(goldenPyproject, 'utf-8').replace(/name = "[^"]+"/, `name = "${name}"`);
|
||||
}
|
||||
}
|
||||
|
||||
// Kirjoita tiedostot levylle
|
||||
for (const [fn, content] of Object.entries(files)) writeFileSync(`${dir}/${fn}`, content);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user