Exemplo n.º 1
0
    def build_dependencies(self) -> "Dependencies":
        """
        Return `Dependencies` instance containing the build dependencies available on this Package.
        The ``Package`` class should provide access to the full dependency tree.

        .. code:: python

           >>> owned_package.build_dependencies['zeppelin']
           <ZeppelinPackage>
        """
        validate_build_dependencies_are_present(self.manifest)

        dependencies = self.manifest["build_dependencies"]
        dependency_packages = {}
        for name, uri in dependencies.items():
            try:
                validate_build_dependency(name, uri)
                dependency_package = Package.from_uri(uri, self.w3)
            except PyEthPMError as e:
                raise FailureToFetchIPFSAssetsError(
                    f"Failed to retrieve build dependency: {name} from URI: {uri}.\n"
                    f"Got error: {e}.")
            else:
                dependency_packages[name] = dependency_package

        return Dependencies(dependency_packages)
Exemplo n.º 2
0
def test_get_build_dependencies_invalidates(name, uri):
    with pytest.raises(EthPMValidationError):
        validate_build_dependency(name, uri)
Exemplo n.º 3
0
def test_validate_build_dependencies(dummy_ipfs_backend):
    result = validate_build_dependency(
        "standard-token",
        "ipfs://QmVu9zuza5mkJwwcFdh2SXBugm1oSgZVuEKkph9XLsbUwg")
    assert result is None