Skip to content
Merged
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
33 changes: 22 additions & 11 deletions scripts/ci/artifactory_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import os
import sys
from collections import defaultdict
from pathlib import Path
from urllib.parse import quote

Expand Down Expand Up @@ -45,24 +46,34 @@ def perform_release(published_wheels: list[tuple[Path, str]]) -> None:
response.raise_for_status()
projects = response.json()

if len(projects) < len(published_wheels):
project_ids = {project["name"]: project["id"] for project in projects}

# Group published wheels by package name
packages = defaultdict(list)
for (wheel_file, wheel_url) in published_wheels:
package_name = pkginfo.Wheel(str(wheel_file)).name
packages[package_name].append(wheel_url)

if len(projects) < len(packages):
print(
f"Warning: KitMaker returned {len(projects)} projects for {len(published_wheels)} published wheels.",
f"Warning: KitMaker returned {len(projects)} projects for {len(packages)} packages.",
flush=True,
)

project_ids = {project["name"]: project["id"] for project in projects}
for wheel_file, wheel_url in published_wheels:
package_name = pkginfo.Wheel(str(wheel_file)).name

for package_name, wheel_urls in packages.items():
package_id = project_ids[package_name]
Comment thread
coderabbitai[bot] marked this conversation as resolved.
wheels_payload = [{
"pic": kitmaker_owner,
"job_type": "wheel-release-job",
"url": wheel_url,
"upload": True,
}
for wheel_url in wheel_urls]

payload = {
"project_name": package_name,
"payload": [{
"pic": kitmaker_owner,
"job_type": "wheel-release-job",
"url": wheel_url,
"upload": True,
}],
"payload": wheels_payload,
}

response = requests.post(
Expand Down
Loading