def _local(cls, root='.'): from pep517 import build, meta system = build.compat_system(root) builder = functools.partial( meta.build, source_dir=root, system=system, ) return PathDistribution(zipp.Path(meta.build_as_zip(builder)))
def main(path: str) -> None: system = compat_system(path) hooks = Pep517HookCaller(path, system["build-backend"], system.get("backend-path")) # compat_system sets this to setuptools, wheel, even if the backend isn't # setuptools tho requires = system["requires"] d = {} with BuildEnvironment() as env: env.pip_install(requires) d[ "get_requires_for_build_sdist" ] = requires + hooks.get_requires_for_build_sdist(None) d[ "get_requires_for_build_wheel" ] = requires + hooks.get_requires_for_build_wheel(None) print(json.dumps(d))