{"record":{"id":"cc1e8463d6141bcf","repo":"vllm-project/vllm","slug":"invalid-wheel-filename-format-wheel-name","errorCode":null,"errorMessage":"Invalid wheel filename format: {wheel_name}","messagePattern":"Invalid wheel filename format: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/vllm-rocm/pin_rocm_dependencies.py","lineNumber":33,"sourceCode":"from pathlib import Path\n\nimport regex as re\n\n\ndef extract_version_from_wheel(wheel_name: str) -> str:\n    \"\"\"\n    Extract version from wheel filename.\n\n    Example:\n        torch-2.9.0a0+git1c57644-cp312-cp312-linux_x86_64.whl -> 2.9.0a0+git1c57644\n        triton-3.4.0-cp312-cp312-linux_x86_64.whl -> 3.4.0\n    \"\"\"\n    # Wheel format:\n    #    {distribution}-{version}(-{build tag})?-{python}-{abi}-{platform}.whl\n    parts = wheel_name.replace(\".whl\", \"\").split(\"-\")\n\n    if len(parts) < 5:\n        raise ValueError(f\"Invalid wheel filename format: {wheel_name}\")\n\n    # Version is the second part\n    version = parts[1]\n    return version\n\n\ndef get_custom_wheel_versions(install_dir: str) -> dict[str, str]:\n    \"\"\"\n    Read /install directory and extract versions of custom wheels.\n\n    Returns:\n        Dict mapping package names to exact versions\n    \"\"\"\n    install_path = Path(install_dir)\n    if not install_path.exists():\n        print(f\"ERROR: Install directory not found: {install_dir}\", file=sys.stderr)\n        sys.exit(1)\n","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/tools/vllm-rocm/pin_rocm_dependencies.py#L15-L51","documentation":"get_wheel_version() in tools/vllm-rocm/pin_rocm_dependencies.py parses PEP 427 wheel filenames: {distribution}-{version}(-{build tag})?-{python}-{abi}-{platform}.whl, i.e. at least 5 dash-separated parts after stripping '.whl'. Fewer than 5 parts means the name is not a valid wheel filename (or not a wheel at all), so version extraction at parts[1] would be meaningless and it raises ValueError.","triggerScenarios":"The /install directory scanned for custom ROCm wheels contains a malformed filename — e.g. 'torch.whl' (distribution only), 'torch-2.9.0.whl' (no tag parts), a renamed wheel like 'torch-custom.whl', or a non-wheel file that happens to end in .whl. Also triggered if '.whl' was double-stripped or the name uses underscores where dashes are required.","commonSituations":"Manually renaming downloaded wheels for caching (losing tag segments); a build script copying artifacts with truncated names; pointing the install dir at a folder with placeholder/symlink files; sdists (.tar.gz) renamed to .whl.","solutions":["List the install directory and find the file whose name has fewer than 5 dash-separated parts (excluding .whl)","Restore the canonical wheel filename with full tags, e.g. triton-3.4.0-cp312-cp312-linux_x86_64.whl — re-download or re-copy it without renaming","Remove non-wheel or placeholder files ending in .whl from the directory","If you control artifact naming in CI, stop truncating wheel filenames when publishing/copying"],"exampleFix":"# before (renamed wheel, only 2 parts)\n/install/torch-rocm-2.9.0.whl\n# after (full PEP 427 name)\n/install/torch-2.9.0a0+git1c57644-cp312-cp312-linux_x86_64.whl","handlingStrategy":"validation","validationCode":"import re\nWHEEL_RE = re.compile(r\"^[^-]+-[^-]+(-[^-]+)?-[^-]+-[^-]+-[^-]+\\.whl$\")\nfor name in os.listdir(install_dir):\n    if name.endswith(\".whl\") and not WHEEL_RE.match(name):\n        raise SystemExit(f\"malformed wheel filename: {name}\")","typeGuard":"def is_valid_wheel_name(name: str) -> bool:\n    return name.endswith(\".whl\") and len(name[:-4].split(\"-\")) >= 5","tryCatchPattern":"try:\n    version = get_custom_wheel_versions(install_dir)\nexcept ValueError as e:\n    print(f\"skipping malformed wheel: {e}\")\n    return {}","preventionTips":["Never rename wheel artifacts — tags are load-bearing for version parsing and pip","Validate artifact filenames in the CI step that publishes/copies wheels","Keep sdists (.tar.gz) out of directories the pinner scans for wheels"],"tags":["rocm","packaging","wheel","pep427"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}