Skip to content

Commit 5d9cf0d

Browse files
authored
Remove uv.lock files from Python Worker C3 templates (#11043)
1 parent ca6c010 commit 5d9cf0d

File tree

11 files changed

+15
-1115
lines changed

11 files changed

+15
-1115
lines changed

.changeset/silly-terms-hunt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-cloudflare": minor
3+
---
4+
5+
Remove lockfiles from Python C3 templates

packages/create-cloudflare/src/templates.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,6 @@ export const downloadRemoteTemplate = async (
827827

828828
function updatePythonPackageName(path: string, projectName: string) {
829829
const pyprojectTomlPath = resolve(path, "pyproject.toml");
830-
const uvLockPath = resolve(path, "uv.lock");
831830
if (!existsSync(pyprojectTomlPath)) {
832831
// Not a python template
833832
return;
@@ -840,12 +839,6 @@ function updatePythonPackageName(path: string, projectName: string) {
840839
`"${projectName}"`,
841840
);
842841
writeFile(pyprojectTomlPath, pyprojectTomlContents);
843-
let uvLockContents = readFile(uvLockPath);
844-
uvLockContents = uvLockContents.replace(
845-
'"tbd"',
846-
`"${projectName.toLowerCase()}"`,
847-
);
848-
writeFile(uvLockPath, uvLockContents);
849842
s.stop(`${brandColor("updated")} ${dim("`pyproject.toml`")}`);
850843
}
851844

packages/create-cloudflare/templates/hello-world-durable-object-with-assets/py/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Worker without having to restart `wrangler`.
66

77
### Types and autocomplete
88

9-
This project also includes a pyproject.toml and uv.lock file with some requirements which
9+
This project also includes a pyproject.toml file with some requirements which
1010
set up autocomplete and type hints for this Python Workers project.
1111

1212
To get these installed you'll need `uv`, which you can install by following

packages/create-cloudflare/templates/hello-world-durable-object-with-assets/py/uv.lock

Lines changed: 0 additions & 274 deletions
This file was deleted.

packages/create-cloudflare/templates/hello-world-durable-object/py/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Worker without having to restart `wrangler`.
66

77
### Types and autocomplete
88

9-
This project also includes a pyproject.toml and uv.lock file with some requirements which
9+
This project also includes a pyproject.toml file with some requirements which
1010
set up autocomplete and type hints for this Python Workers project.
1111

1212
To get these installed you'll need `uv`, which you can install by following

packages/create-cloudflare/templates/hello-world-durable-object/py/uv.lock

Lines changed: 0 additions & 274 deletions
This file was deleted.

packages/create-cloudflare/templates/hello-world-with-assets/py/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Worker without having to restart `wrangler`.
66

77
### Types and autocomplete
88

9-
This project also includes a pyproject.toml and uv.lock file with some requirements which
9+
This project also includes a pyproject.toml file with some requirements which
1010
set up autocomplete and type hints for this Python Workers project.
1111

1212
To get these installed you'll need `uv`, which you can install by following

packages/create-cloudflare/templates/hello-world-with-assets/py/uv.lock

Lines changed: 0 additions & 274 deletions
This file was deleted.

packages/create-cloudflare/templates/hello-world/c3.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ export default {
1111
platform: "workers",
1212
async configure(ctx) {
1313
if (ctx.args.lang === "python") {
14-
for (const file of ["pyproject.toml", "uv.lock"]) {
15-
const contents = await readFile(
16-
resolve(ctx.project.path, file),
17-
"utf8",
18-
);
19-
const updated = contents.replaceAll(/<TBD>/g, ctx.project.name);
20-
await writeFile(resolve(ctx.project.path, file), updated);
21-
}
14+
const contents = await readFile(
15+
resolve(ctx.project.path, "pyproject.toml"),
16+
"utf8",
17+
);
18+
const updated = contents.replaceAll(/<TBD>/g, ctx.project.name);
19+
await writeFile(resolve(ctx.project.path, "pyproject.toml"), updated);
2220
}
2321
},
2422
copyFiles: {

packages/create-cloudflare/templates/hello-world/py/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Worker without having to restart `wrangler`.
66

77
### Types and autocomplete
88

9-
This project also includes a pyproject.toml and uv.lock file with some requirements which
9+
This project also includes a pyproject.toml with some requirements which
1010
set up autocomplete and type hints for this Python Workers project.
1111

1212
To get these installed you'll need `uv`, which you can install by following

0 commit comments

Comments
 (0)