def package_dependencies_rules(self, pkg, tests):
    "Translate 'depends_on' directives into ASP logic."
    for (_, conditions) in sorted(pkg.dependencies.items()):
        for (cond, dep) in sorted(conditions.items()):
            deptypes = dep.type.copy()
            if (not tests):
                deptypes.discard('test')
            if ((not isinstance(tests, bool)) and (pkg.name not in tests)):
                deptypes.discard('test')
            if (not deptypes):
                continue
            condition_id = self.condition(cond, dep.spec, pkg.name)
            self.gen.fact(fn.dependency_condition(condition_id, pkg.name, dep.spec.name))
            for t in sorted(deptypes):
                self.gen.fact(fn.dependency_type(condition_id, t))
            self.gen.newline()
Translate 'depends_on' directives into ASP logic.
def package_dependencies_rules(self, pkg, tests):
    
    for (_, conditions) in sorted(pkg.dependencies.items()):
        for (cond, dep) in sorted(conditions.items()):
            deptypes = dep.type.copy()
            if (not tests):
                deptypes.discard('test')
            if ((not isinstance(tests, bool)) and (pkg.name not in tests)):
                deptypes.discard('test')
            if (not deptypes):
                continue
            condition_id = self.condition(cond, dep.spec, pkg.name)
            self.gen.fact(fn.dependency_condition(condition_id, pkg.name, dep.spec.name))
            for t in sorted(deptypes):
                self.gen.fact(fn.dependency_type(condition_id, t))
            self.gen.newline()