def test_backend(tmpdir, data): """Check we can call a requirement's backend successfully""" project_dir = make_project(tmpdir, backend="dummy_backend") req = InstallRequirement(None, None, source_dir=project_dir) req.load_pyproject_toml() env = BuildEnvironment() finder = make_test_finder(find_links=[data.backends]) env.install_requirements(finder, ["dummy_backend"], 'normal', "Installing") conflicting, missing = env.check_requirements(["dummy_backend"]) assert not conflicting and not missing assert hasattr(req.pep517_backend, 'build_wheel') with env: assert req.pep517_backend.build_wheel("dir") == "Backend called"
def test_backend(tmpdir: Path, data: TestData) -> None: """Check we can call a requirement's backend successfully""" project_dir = make_project(tmpdir, backend="dummy_backend") req = InstallRequirement(None, None) req.source_dir = project_dir # make req believe it has been unpacked req.load_pyproject_toml() env = BuildEnvironment() finder = make_test_finder(find_links=[data.backends]) env.install_requirements(finder, ["dummy_backend"], "normal", "Installing") conflicting, missing = env.check_requirements(["dummy_backend"]) assert not conflicting and not missing assert hasattr(req.pep517_backend, "build_wheel") with env: assert req.pep517_backend is not None assert req.pep517_backend.build_wheel("dir") == "Backend called"
def test_backend(tmpdir, data): """Check we can call a requirement's backend successfully""" project_dir = make_project(tmpdir, backend="dummy_backend") req = InstallRequirement(None, None, source_dir=project_dir) req.load_pyproject_toml() env = BuildEnvironment() finder = PackageFinder([data.backends], [], session=PipSession()) env.install_requirements(finder, ["dummy_backend"], 'normal', "Installing") conflicting, missing = env.check_requirements(["dummy_backend"]) assert not conflicting and not missing assert hasattr(req.pep517_backend, 'build_wheel') with env: assert req.pep517_backend.build_wheel("dir") == "Backend called"