def build(self) -> Path:
        """Call PEP 517 build hook to build the candidate into a wheel"""
        self._obtain(allow_all=False)
        if self._cached:
            return self._cached
        if not self.req.editable:
            cached = self._get_build_cache()
            if cached:
                return cached
        assert self._source_dir, "Source directory isn't ready yet"
        builder_cls = EditableBuilder if self.req.editable else WheelBuilder
        builder = builder_cls(str(self._unpacked_dir), self.environment)
        build_dir = self._get_wheel_dir()
        os.makedirs(build_dir, exist_ok=True)
        termui.logger.info("Running PEP 517 backend to build a wheel for %s", self.link)
        self.reporter.report_build_start(self.link.filename)  # type: ignore[union-attr]
        self._cached = Path(builder.build(build_dir, metadata_directory=self._metadata_dir))
        self.reporter.report_build_end(self.link.filename)  # type: ignore[union-attr]
        return self._cached
Call PEP 517 build hook to build the candidate into a wheel
src/pdm/models/candidates.py