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
Context
The
pypi-prebuiltresolver correctly creates aPyPIProvider(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_builtin multiple places to decide whether to skip building and just download a pre-built wheel. When a package/variant usessource.provider: pypi-prebuiltinstead of the legacypre_built: true+wheel_server_url,pbi.pre_builtreturnsFalseandpbi.wheel_server_urlreturnsNone. The bootstrapper will not recognize this as a pre-built scenario and will attempt to build from source.Fix
Update
PackageBuildInfo.pre_builtandPackageBuildInfo.wheel_server_urlto also checksource_resolver: