当前位置: 首页>>代码示例>>Python>>正文


Python Pool.what_provides方法代码示例

本文整理汇总了Python中depsolver.pool.Pool.what_provides方法的典型用法代码示例。如果您正苦于以下问题:Python Pool.what_provides方法的具体用法?Python Pool.what_provides怎么用?Python Pool.what_provides使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在depsolver.pool.Pool的用法示例。


在下文中一共展示了Pool.what_provides方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_what_provides_replaces

# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import what_provides [as 别名]
    def test_what_provides_replaces(self):
        scikit_learn = P("scikit_learn-0.12.0")
        sklearn = P("sklearn-0.13.0; replaces (scikit_learn==0.12.0)")
        pool = Pool([Repository([scikit_learn, sklearn])])

        self.assertEqual(set(pool.what_provides(R("sklearn"))), set([sklearn]))
        self.assertEqual(set(pool.what_provides(R("scikit_learn"))), set([sklearn, scikit_learn]))
开发者ID:awwad,项目名称:depsolver,代码行数:9,代码来源:test_pool.py

示例2: test_what_provides_include_indirect

# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import what_provides [as 别名]
    def test_what_provides_include_indirect(self):
        repo1 = Repository([self.numpy_1_6_0, self.numpy_1_7_0, self.nomkl_numpy_1_7_0])
        pool = Pool()
        pool.add_repository(repo1)

        self.assertEqual(pool.what_provides(R("numpy >= 1.6.1")), [self.numpy_1_7_0])
        self.assertEqual(set(pool.what_provides(R("numpy"), 'include_indirect')),
                         set([self.numpy_1_6_0, self.numpy_1_7_0, self.nomkl_numpy_1_7_0]))
        self.assertEqual(set(pool.what_provides(R("numpy >= 1.6.1"), 'include_indirect')),
                         set([self.numpy_1_7_0, self.nomkl_numpy_1_7_0]))
        self.assertEqual(set(pool.what_provides(R("numpy >= 1.6.1"), 'direct_only')),
                         set([self.numpy_1_7_0]))
开发者ID:awwad,项目名称:depsolver,代码行数:14,代码来源:test_pool.py

示例3: test_what_provides_simple

# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import what_provides [as 别名]
    def test_what_provides_simple(self):
        repo1 = Repository([self.numpy_1_6_0, self.numpy_1_7_0])
        pool = Pool()
        pool.add_repository(repo1)

        self.assertEqual(set(pool.what_provides(R("numpy"))), set([self.numpy_1_6_0, self.numpy_1_7_0]))
        self.assertEqual(pool.what_provides(R("numpy >= 1.6.1")), [self.numpy_1_7_0])

        repo1 = Repository([self.nomkl_numpy_1_7_0])
        pool = Pool()
        pool.add_repository(repo1)

        self.assertEqual(pool.what_provides(R("numpy")), [self.nomkl_numpy_1_7_0])
开发者ID:awwad,项目名称:depsolver,代码行数:15,代码来源:test_pool.py

示例4: test_add_repository

# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import what_provides [as 别名]
    def test_add_repository(self):
        """Ensures we do not add the same package twice."""
        repo1 = Repository([self.mkl_10_1_0, self.mkl_10_2_0])
        pool = Pool()
        pool.add_repository(repo1)

        repo2 = Repository([P(str(self.mkl_10_1_0))])
        pool.add_repository(repo2)

        self.assertEqual(len(pool.what_provides(R("mkl"))), 3)
开发者ID:awwad,项目名称:depsolver,代码行数:12,代码来源:test_pool.py

示例5: test_what_provides_direct_only

# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import what_provides [as 别名]
    def test_what_provides_direct_only(self):
        repo1 = Repository([self.nomkl_numpy_1_7_0])
        pool = Pool()
        pool.add_repository(repo1)

        self.assertEqual(set(pool.what_provides(R("numpy"))), set([self.nomkl_numpy_1_7_0]))
开发者ID:awwad,项目名称:depsolver,代码行数:8,代码来源:test_pool.py


注:本文中的depsolver.pool.Pool.what_provides方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。