Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/release-python-runtime.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Build Python Runtime

on: workflow_dispatch
on:
workflow_dispatch:
inputs:
update-released:
description: 'Update already released versions?'
required: false
default: false
type: boolean

jobs:
build:
Expand Down Expand Up @@ -32,7 +39,7 @@ jobs:
# boto3 v1.36.0 fails with:
# NotImplemented error occurred in CreateMultipartUpload operation: Header 'x-amz-checksum-algorithm' with value 'CRC32' not implemented
pip install 'boto3<1.36.0' requests
python3 src/pyodide/upload_bundles.py
python3 src/pyodide/upload_bundles.py ${{ inputs.update-released == true && '--update-released' || '' }}

- name: Check for open PR and commit changes
env:
Expand Down
1 change: 1 addition & 0 deletions build/python_metadata.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def _make_bundle_version_info(versions):
BUNDLE_VERSION_INFO = _make_bundle_version_info([
{
"name": "0.26.0a2",
"released": True,
"pyodide_version": "0.26.0a2",
"pyodide_date": "2024-03-01",
"packages": PACKAGES_20240829_4,
Expand Down
18 changes: 15 additions & 3 deletions src/pyodide/upload_bundles.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import argparse
import json
import re
import subprocess
Expand Down Expand Up @@ -56,7 +57,7 @@ def bundle_url(**kwds):
def get_backport(ver):
info = bundle_version_info()[ver]
backport = int(info["backport"])
for b in range(backport + 1, backport + 10):
for b in range(backport + 1, backport + 20):
info["backport"] = b
url = bundle_url(**info)
res = requests.head(url)
Expand Down Expand Up @@ -116,11 +117,13 @@ def print_info(info: BundleInfo) -> None:
print()


def make_bundles() -> list[BundleInfo]:
def make_bundles(update_released: bool) -> list[BundleInfo]:
result = []
for ver, info in bundle_version_info().items():
if ver.startswith("dev"):
continue
if not update_released and info.get("released", False):
continue
path = Path(get_pyodide_bin_path(ver)).resolve()
b = get_backport(ver)
info["backport"] = b
Expand Down Expand Up @@ -151,7 +154,16 @@ def upload_bundles(bundles: list[BundleInfo]):


def main():
bundles = make_bundles()
parser = argparse.ArgumentParser(
description="Upload Pyodide bundles and update metadata"
)
parser.add_argument(
"--update-released",
action="store_true",
help="Update already released versions?",
)
args = parser.parse_args()
bundles = make_bundles(args.update_released)
for bundle in bundles:
print_info(bundle)
update_python_metadata_bzl(bundles)
Expand Down
Loading