Skip to content

Commit 89125b3

Browse files
Fixes pyproject.toml/uv.lock not including quotes (#10780)
* Fixes pyproject.toml/uv.lock not including quotes * Update .changeset/some-singers-sit.md --------- Co-authored-by: Pete Bacon Darwin <[email protected]>
1 parent 6244a9e commit 89125b3

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.changeset/some-singers-sit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-cloudflare": patch
3+
---
4+
5+
Python templates now create valid pyproject.toml/uv.lock files

packages/create-cloudflare/src/templates.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,10 +833,16 @@ function updatePythonPackageName(path: string, projectName: string) {
833833
const s = spinner();
834834
s.start("Updating name in `pyproject.toml`");
835835
let pyprojectTomlContents = readFile(pyprojectTomlPath);
836-
pyprojectTomlContents = pyprojectTomlContents.replace('"TBD"', projectName);
836+
pyprojectTomlContents = pyprojectTomlContents.replace(
837+
'"TBD"',
838+
`"${projectName}"`,
839+
);
837840
writeFile(pyprojectTomlPath, pyprojectTomlContents);
838841
let uvLockContents = readFile(uvLockPath);
839-
uvLockContents = uvLockContents.replace('"tbd"', projectName.toLowerCase());
842+
uvLockContents = uvLockContents.replace(
843+
'"tbd"',
844+
`${"projectName.toLowerCase()"}`,
845+
);
840846
writeFile(uvLockPath, uvLockContents);
841847
s.stop(`${brandColor("updated")} ${dim("`pyproject.toml`")}`);
842848
}

0 commit comments

Comments
 (0)