當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。