Skip to content

Commit 5b7dc26

Browse files
committed
Download Python packages from r2
1 parent 4a7a063 commit 5b7dc26

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

src/pyodide/internal/loadPackage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function getPackageMetadata(requirement: string): PackageDeclaration {
3939

4040
function loadBundleFromArtifactBundler(requirement: string): Reader {
4141
const filename = getPackageMetadata(requirement).file_name;
42-
const fullPath = `python-package-bucket/${PACKAGES_VERSION}/${filename}`;
42+
const fullPath = `${PACKAGES_VERSION}/${filename}`;
4343
const reader = ArtifactBundler.getPackage(fullPath);
4444
if (!reader) {
4545
throw new PythonWorkersInternalError(

src/workerd/api/pyodide/pyodide.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ WD_STRONG_BOOL(IsValidating);
3030
WD_STRONG_BOOL(IsWorkerd);
3131
WD_STRONG_BOOL(SnapshotToDisk);
3232

33-
const auto PYTHON_PACKAGES_URL =
34-
"https://storage.googleapis.com/cloudflare-edgeworker-python-packages/";
33+
const auto PYTHON_PACKAGES_URL = "https://python-packages.edgeworker.net/";
3534
class PyodideBundleManager {
3635
public:
3736
void setPyodideBundleData(kj::String version, kj::Array<unsigned char> data) const;

src/workerd/api/tests/worker-loader-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ export let pythonBasics = {
109109
async test(ctrl, env, ctx) {
110110
let worker = env.loader.get('pythonBasics', () => {
111111
return {
112-
compatibilityDate: '2025-01-01',
112+
compatibilityDate: '2025-12-01',
113113
mainModule: 'foo.py',
114-
compatibilityFlags: ['python_workers', 'python_no_global_handlers'],
114+
compatibilityFlags: ['python_workers'],
115115
modules: {
116116
'foo.py': `
117117
from workers import WorkerEntrypoint

src/workerd/server/pyodide.c++

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ kj::Promise<void> loadPyodidePackage(const api::pyodide::PythonConfig& pyConfig,
144144
kj::Network& network,
145145
kj::Timer& timer) {
146146

147-
auto path = kj::str("python-package-bucket/", packagesVersion, "/", filename);
147+
auto path = kj::str(packagesVersion, "/", filename);
148148
// First check if we already have this package in memory
149149
if (pyodidePackageManager.getPyodidePackage(path) != kj::none) {
150150
co_return;

0 commit comments

Comments
 (0)