From 44833eafe7fc9ee3e413cc107621fa7f6dd7522f Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Wed, 9 Oct 2024 16:23:37 -0700 Subject: [PATCH] Parse wheel metadata Change-Id: I3e76c3f0a38cd50498e0ddc431f18b60ba134f35 --- tools/playbooks/build-wheel/post.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/playbooks/build-wheel/post.yaml b/tools/playbooks/build-wheel/post.yaml index 8113eca..cc1b765 100644 --- a/tools/playbooks/build-wheel/post.yaml +++ b/tools/playbooks/build-wheel/post.yaml @@ -24,4 +24,10 @@ url: 'artifacts/{{ item.path | basename }}' metadata: type: python_wheel - # TODO: parse further metadata from basename (python tag, ABI tag) + package: '{{ (item.path | basename | split("-") ).0 }}' + version: '{{ (item.path | basename | split("-") ).1 }}' + # according to https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/ + # there may or may not be a "build tag" next, whatever that is + python-tag: '{{ (item.path | basename | split("-") )[-3] }}' + abi-tag: '{{ (item.path | basename | split("-") )[-2] }}' + platform-tag: '{{ (item.path[:-4] | basename | split("-") )[-1].split(".") }}'