Ejemplo 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)
Ejemplo n.º 2
0
    def build_dependencies(self) -> "Dependencies":
        """
        Return `Dependencies` instance containing the build dependencies available on this Package.
        Cached property (self.build_dependencies) busted everytime self.set_default_w3() is called.
        """
        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)
Ejemplo n.º 3
0
def dependencies(dummy_ipfs_backend, piper_coin_manifest, w3):
    deps = piper_coin_manifest["build_dependencies"]
    dep_pkgs = {dep: Package.from_uri(uri, w3) for dep, uri in deps.items()}
    return Dependencies(dep_pkgs)