def add_package(self, name, package_name, package_version="r1",
                    build_depends=None, run_depends=None, test_depends=None,
                    host_depends=None):
        toolchain = qitoolchain.get_toolchain(name)
        package_path = self.tmp.mkdir(package_name)
        package = qitoolchain.qipackage.QiPackage(package_name, package_version)
        package.path = package_path.strpath

        # Make sure self.*_depends are sets
        for dep_type in ["build", "run", "test", "host"]:
            attr_name = "%s_depends" % dep_type
            value = locals()[attr_name]
            if value:
                setattr(package, attr_name, set(value))
            else:
                setattr(package, attr_name, set())

        package.write_package_xml()
        toolchain.add_package(package)
        return package
dataset/ETHPy150Open aldebaran/qibuild/python/qitoolchain/test/conftest.py/Toolchains.add_package/original