From 393ebd3d8547fdb1f76cab364e3b850a748ada6f Mon Sep 17 00:00:00 2001 From: Julien Stephan Date: Wed, 19 Aug 2026 15:57:50 +0200 Subject: [PATCH] docs: fix patch links We can specify the patched key in yaml to automatically populate the link to the patches applied to a given version. Currently this handl only packages built and deployed from gitlab pipelines, with link to the old GitLab instance. Add logic to also handle packages built and deploy from GitHub, and generate correct link pointing to the new GitHub instance. To be found, patches must be under patches// with package_name and package_version matching values from the .whl Rename patches/torch/2.13.0 to patches/torch/2.13.0+cpu This will fixes missing patch links for the following packages: matplotlib pillow torch zstandard Fixes: #209 Signed-off-by: Julien Stephan --- .github/workflows/build-torch.yml | 6 +++--- docs/packages/generate_packages_doc.py | 15 +++++++++++++++ ...-CI-Add-manywheel-Dockerfile-for-riscv64.patch | 0 ...cpu-riscv64-support-to-manywheel-scripts.patch | 0 ...Add-native-build-image-for-linux-riscv64.patch | 0 5 files changed, 18 insertions(+), 3 deletions(-) rename patches/torch/{2.13.0 => 2.13.0+cpu}/0001-CI-Add-manywheel-Dockerfile-for-riscv64.patch (100%) rename patches/torch/{2.13.0 => 2.13.0+cpu}/0002-CI-Add-cpu-riscv64-support-to-manywheel-scripts.patch (100%) rename patches/torch/{2.13.0 => 2.13.0+cpu}/0003-CI-Add-native-build-image-for-linux-riscv64.patch (100%) diff --git a/.github/workflows/build-torch.yml b/.github/workflows/build-torch.yml index f18ded9e..eec411b3 100644 --- a/.github/workflows/build-torch.yml +++ b/.github/workflows/build-torch.yml @@ -63,9 +63,9 @@ jobs: - name: Patch pytorch source working-directory: pytorch run: | - git apply ../python-wheels/patches/torch/${{ env.TORCH_VERSION }}/0001-CI-Add-manywheel-Dockerfile-for-riscv64.patch - git apply ../python-wheels/patches/torch/${{ env.TORCH_VERSION }}/0002-CI-Add-cpu-riscv64-support-to-manywheel-scripts.patch - git apply ../python-wheels/patches/torch/${{ env.TORCH_VERSION }}/0003-CI-Add-native-build-image-for-linux-riscv64.patch + git apply ../python-wheels/patches/torch/${{ env.TORCH_VERSION }}+cpu/0001-CI-Add-manywheel-Dockerfile-for-riscv64.patch + git apply ../python-wheels/patches/torch/${{ env.TORCH_VERSION }}+cpu/0002-CI-Add-cpu-riscv64-support-to-manywheel-scripts.patch + git apply ../python-wheels/patches/torch/${{ env.TORCH_VERSION }}+cpu/0003-CI-Add-native-build-image-for-linux-riscv64.patch - name: Login to GitHub Container Registry uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 diff --git a/docs/packages/generate_packages_doc.py b/docs/packages/generate_packages_doc.py index 754b4083..838d1218 100644 --- a/docs/packages/generate_packages_doc.py +++ b/docs/packages/generate_packages_doc.py @@ -17,6 +17,9 @@ GITLAB_WHEEL_BUILDER_URL = ( "https://gitlab.com/riseproject/python/wheel_builder/-/tree/main" ) +GITHUB_PYTHON_WHEELS_URL = ( + "https://github.com/riseproject-dev/python-wheels/tree/main" +) PYPI_INDEX_URL = "https://pypi.riseproject.dev/simple/" # Match RST inline external refs: `Label `_ or `Label `__ @@ -219,6 +222,18 @@ def generate_md_page(yaml_file, output_md, package_list): f"[{patch_link}]({patch_link})" ) lines.append("") + else: + # if upstream tag is not present, it means the package was uploaded from github action + # on github we changed the way we store patches: we use package_name and version + # instead of project_name and tag + patch_link = ( + f"{GITHUB_PYTHON_WHEELS_URL}/" + f"patches/{package_name}/{version_number}" + ) + lines.append( + f"**Patch applied for this version:** " + f"[{patch_link}]({patch_link})" + ) if version.get("comment"): _callout(lines, "note", version["comment"]) diff --git a/patches/torch/2.13.0/0001-CI-Add-manywheel-Dockerfile-for-riscv64.patch b/patches/torch/2.13.0+cpu/0001-CI-Add-manywheel-Dockerfile-for-riscv64.patch similarity index 100% rename from patches/torch/2.13.0/0001-CI-Add-manywheel-Dockerfile-for-riscv64.patch rename to patches/torch/2.13.0+cpu/0001-CI-Add-manywheel-Dockerfile-for-riscv64.patch diff --git a/patches/torch/2.13.0/0002-CI-Add-cpu-riscv64-support-to-manywheel-scripts.patch b/patches/torch/2.13.0+cpu/0002-CI-Add-cpu-riscv64-support-to-manywheel-scripts.patch similarity index 100% rename from patches/torch/2.13.0/0002-CI-Add-cpu-riscv64-support-to-manywheel-scripts.patch rename to patches/torch/2.13.0+cpu/0002-CI-Add-cpu-riscv64-support-to-manywheel-scripts.patch diff --git a/patches/torch/2.13.0/0003-CI-Add-native-build-image-for-linux-riscv64.patch b/patches/torch/2.13.0+cpu/0003-CI-Add-native-build-image-for-linux-riscv64.patch similarity index 100% rename from patches/torch/2.13.0/0003-CI-Add-native-build-image-for-linux-riscv64.patch rename to patches/torch/2.13.0+cpu/0003-CI-Add-native-build-image-for-linux-riscv64.patch