Skip to content

Wire pypi-prebuilt source resolver into bootstrapper pre-built detection #1208

Description

@smoparth

Context

The pypi-prebuilt resolver correctly creates a PyPIProvider(include_sdists=False, include_wheels=True), but the bootstrapper doesn't yet recognize this as a pre-built wheel scenario.

Parent epic: #936
Parent issue: #1048

Problem

The bootstrapper checks pbi.pre_built in multiple places to decide whether to skip building and just download a pre-built wheel. When a package/variant uses source.provider: pypi-prebuilt instead of the legacy pre_built: true + wheel_server_url, pbi.pre_built returns False and pbi.wheel_server_url returns None. The bootstrapper will not recognize this as a pre-built scenario and will attempt to build from source.

Fix

Update PackageBuildInfo.pre_built and PackageBuildInfo.wheel_server_url to also check source_resolver:

@property
def pre_built(self) -> bool:
    source = self.source_resolver
    if source is not None and source.provider == "pypi-prebuilt":
        return True
    vi = self._ps.variants.get(self.variant)
    if vi is not None:
        return vi.pre_built
    return False
@property
def wheel_server_url(self) -> str | None:
    source = self.source_resolver
    if source is not None and source.provider == "pypi-prebuilt":
        return str(source.index_url)
    vi = self._ps.variants.get(self.variant)
    if vi is not None and vi.wheel_server_url is not None:
        return str(vi.wheel_server_url)
    return None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions