Skip to content

Commit 76d7540

Browse files
committed
changes
1 parent 87c1249 commit 76d7540

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

packages/publish-pypi/index.ts

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -356,31 +356,32 @@ async function publish_package_oidc(dir: string, repositoryUrl: string) {
356356
setFailed("Failed to generate attestations.");
357357
return false;
358358
}
359-
359+
360360
await verifyAttestations(distDir);
361361

362-
const twineArgs = [
363-
"upload",
364-
"--non-interactive",
365-
"--verbose",
366-
];
367-
362+
const twineArgs = ["upload", "--non-interactive", "--verbose"];
363+
368364
// Add attestations flag for twine 6.1+
369-
const attestationFiles = await glob(join(distDir, "*.publish.attestation"), {
370-
absolute: true
371-
});
372-
365+
const attestationFiles = await glob(
366+
join(distDir, "*.publish.attestation"),
367+
{
368+
absolute: true,
369+
}
370+
);
371+
373372
if (attestationFiles.length > 0) {
374373
twineArgs.push("--attestations");
375-
attestationFiles.forEach(file => {
374+
attestationFiles.forEach((file) => {
376375
twineArgs.push(file);
377376
});
378377
}
379-
378+
380379
// Add the distribution files to upload
381380
const distFiles = await glob(join(distDir, "*.whl"), { absolute: true });
382-
const tarFiles = await glob(join(distDir, "*.tar.gz"), { absolute: true });
383-
[...distFiles, ...tarFiles].forEach(file => {
381+
const tarFiles = await glob(join(distDir, "*.tar.gz"), {
382+
absolute: true,
383+
});
384+
[...distFiles, ...tarFiles].forEach((file) => {
384385
twineArgs.push(file);
385386
});
386387

@@ -447,6 +448,11 @@ const RE_PKG_NAME = /^[\w-]+\b/;
447448

448449
async function get_package_dependencies(pkg: PythonPackage): Promise<string[]> {
449450
const requirements = join(pkg.dir, "..", "requirements.txt");
451+
try {
452+
await fs.access(requirements);
453+
} catch {
454+
return [];
455+
}
450456
return (await fs.readFile(requirements, "utf-8"))
451457
.split("\n")
452458
.map((line) => {

0 commit comments

Comments
 (0)