當前位置: 首頁>>代碼示例>>Python>>正文


Python pool.Pool類代碼示例

本文整理匯總了Python中depsolver.pool.Pool的典型用法代碼示例。如果您正苦於以下問題:Python Pool類的具體用法?Python Pool怎麽用?Python Pool使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Pool類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_package_by_id_simple

    def test_package_by_id_simple(self):
        repo = Repository([self.mkl_10_1_0, self.mkl_10_2_0])
        pool = Pool()
        pool.add_repository(repo)

        self.assertEqual(self.mkl_10_1_0, pool.package_by_id(self.mkl_10_1_0.id))
        self.assertEqual(self.mkl_10_2_0, pool.package_by_id(self.mkl_10_2_0.id))
開發者ID:awwad,項目名稱:depsolver,代碼行數:7,代碼來源:test_pool.py

示例2: setUp

    def setUp(self):
        self.mkl_10_1_0 = P("mkl-10.1.0")
        self.mkl_10_2_0 = P("mkl-10.2.0")
        self.mkl_10_3_0 = P("mkl-10.3.0")
        self.mkl_11_0_0 = P("mkl-11.0.0")

        self.numpy_1_6_0 = P("numpy-1.6.0; depends (mkl)")
        self.numpy_1_6_1 = P("numpy-1.6.1; depends (mkl)")
        self.numpy_1_7_0 = P("numpy-1.7.0; depends (mkl)")

        self.nomkl_numpy_1_6_0 = P("nomkl_numpy-1.6.0; provides(numpy == 1.6.0)")
        self.nomkl_numpy_1_6_1 = P("nomkl_numpy-1.6.1; provides(numpy == 1.6.1)")
        self.nomkl_numpy_1_7_0 = P("nomkl_numpy-1.7.0; provides(numpy == 1.7.0)")

        self.mkl_numpy_1_6_1 = P("mkl_numpy-1.6.1; provides(numpy == 1.6.1); depends (mkl)")
        self.mkl_numpy_1_7_0 = P("mkl_numpy-1.7.0; provides(numpy == 1.7.0); depends (mkl)")

        self.scipy_0_11_0 = P("scipy-0.11.0; depends (numpy >= 1.4.0)")
        self.scipy_0_12_0 = P("scipy-0.12.0; depends (numpy >= 1.4.0)")

        self.matplotlib_1_2_0 = P("matplotlib-1.2.0; depends (numpy >= 1.6.0)")

        repo = Repository([self.mkl_10_1_0, self.mkl_10_2_0, self.mkl_10_3_0,
                           self.mkl_11_0_0, self.numpy_1_6_0])
        pool = Pool()
        pool.add_repository(repo)

        self.pool = pool
開發者ID:awwad,項目名稱:depsolver,代碼行數:28,代碼來源:test_rules_generator.py

示例3: test_complex_scenario_1

    def test_complex_scenario_1(self):
        repo = Repository([mkl_10_1_0, mkl_10_2_0, mkl_10_3_0, mkl_11_0_0,
            numpy_1_6_0, numpy_1_6_1, numpy_1_7_0, scipy_0_11_0, scipy_0_12_0])
        pool = Pool()
        pool.add_repository(repo)

        r_rules = set()
        r_rules.add(PackageRule.from_string("scipy-0.11.0 | scipy-0.12.0", pool))
        r_rules.add(PackageRule.from_string("-scipy-0.11.0 | -scipy-0.12.0", pool))
        r_rules.add(PackageRule.from_string(
                    "-scipy-0.11.0 | numpy-1.6.0 | numpy-1.6.1 | numpy-1.7.0",
                    pool))
        r_rules.add(PackageRule.from_string(
                    "-scipy-0.12.0 | numpy-1.6.0 | numpy-1.6.1 | numpy-1.7.0",
                    pool))
        r_rules.add(PackageRule.from_string("-numpy-1.7.0 | -numpy-1.6.1", pool))
        r_rules.add(PackageRule.from_string("-numpy-1.7.0 | -numpy-1.6.0", pool))
        r_rules.add(PackageRule.from_string("-numpy-1.6.0 | -numpy-1.6.1", pool))
        r_rules.add(PackageRule.from_string(
            "-numpy-1.7.0 | mkl-10.1.0 | mkl-10.2.0 | mkl-10.3.0 | mkl-11.0.0", pool))
        r_rules.add(PackageRule.from_string(
            "-numpy-1.6.1 | mkl-10.1.0 | mkl-10.2.0 | mkl-10.3.0 | mkl-11.0.0", pool))
        r_rules.add(PackageRule.from_string(
            "-numpy-1.6.0 | mkl-10.1.0 | mkl-10.2.0 | mkl-10.3.0 | mkl-11.0.0", pool))
        r_rules.add(PackageRule.from_string("-mkl-10.1.0 | -mkl-10.2.0", pool))
        r_rules.add(PackageRule.from_string("-mkl-10.1.0 | -mkl-10.3.0", pool))
        r_rules.add(PackageRule.from_string("-mkl-10.1.0 | -mkl-11.0.0", pool))
        r_rules.add(PackageRule.from_string("-mkl-10.2.0 | -mkl-10.3.0", pool))
        r_rules.add(PackageRule.from_string("-mkl-10.2.0 | -mkl-11.0.0", pool))
        r_rules.add(PackageRule.from_string("-mkl-10.3.0 | -mkl-11.0.0", pool))

        self.assertEqual(r_rules,
                set(create_install_rules(pool, R("scipy"))))
開發者ID:FreakTheMighty,項目名稱:depsolver,代碼行數:33,代碼來源:test_create_clauses.py

示例4: test_matches

    def test_matches(self):
        pool = Pool()

        self.assertEqual(pool.matches(self.mkl_10_1_0, R("mkl")), MATCH)
        self.assertEqual(pool.matches(self.mkl_10_1_0, R("mkl >= 10.2.0")), MATCH_NAME)
        self.assertEqual(pool.matches(self.mkl_10_1_0, R("numpy")), False)
        self.assertEqual(pool.matches(self.nomkl_numpy_1_7_0, R("numpy")), MATCH_PROVIDE)
開發者ID:awwad,項目名稱:depsolver,代碼行數:7,代碼來源:test_pool.py

示例5: test_simple2

    def test_simple2(self):
        repo = Repository([self.mkl_10_1_0, self.mkl_10_2_0])
        pool = Pool([repo])

        self.assertEqual(self.mkl_10_1_0, pool.package_by_id(self.mkl_10_1_0.id))
        self.assertEqual(self.mkl_10_2_0, pool.package_by_id(self.mkl_10_2_0.id))
        self.assertRaises(MissingPackageInfoInPool, lambda: pool.package_by_id(self.mkl_10_3_0.id))
開發者ID:awwad,項目名稱:depsolver,代碼行數:7,代碼來源:test_pool.py

示例6: test_literal_to_string

    def test_literal_to_string(self):
        pool = Pool([Repository([self.mkl_10_1_0, self.mkl_10_2_0])])

        self.assertEqual(pool.id_to_string(self.mkl_10_2_0.id),
                         "+mkl-10.2.0")
        self.assertEqual(pool.id_to_string(-self.mkl_10_1_0.id),
                         "-mkl-10.1.0")
開發者ID:awwad,項目名稱:depsolver,代碼行數:7,代碼來源:test_pool.py

示例7: test_what_provides_replaces

    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,代碼行數:7,代碼來源:test_pool.py

示例8: setUp

    def setUp(self):
        repo = Repository([mkl_10_1_0, mkl_10_2_0, mkl_10_3_0, mkl_11_0_0, numpy_1_6_0,
            numpy_1_6_0, numpy_1_6_1, numpy_1_7_0])
        pool = Pool()
        pool.add_repository(repo)

        self.pool = pool
開發者ID:FreakTheMighty,項目名稱:depsolver,代碼行數:7,代碼來源:test_create_clauses.py

示例9: test_simple

    def test_simple(self):
        repo1 = Repository([mkl_10_1_0, mkl_10_2_0])
        pool = Pool()
        pool.add_repository(repo1)

        self.assertEqual(mkl_10_1_0, pool.package_by_id(mkl_10_1_0.id))
        self.assertEqual(mkl_10_2_0, pool.package_by_id(mkl_10_2_0.id))
        self.assertRaises(MissingPackageInPool, lambda: pool.package_by_id(mkl_10_3_0.id))
開發者ID:FreakTheMighty,項目名稱:depsolver,代碼行數:8,代碼來源:test_pool.py

示例10: test_simple

    def test_simple(self):
        """Numpy depends on MKL, one version of NumPy only."""
        repo = Repository([mkl_10_2_0, mkl_10_3_0, mkl_11_0_0, numpy_1_6_0])

        pool = Pool()
        pool.add_repository(repo)

        installed_repo = Repository()

        operations = solve(pool, R("numpy"), installed_repo, policy)
        self.assertEqual(operations, [Install(mkl_11_0_0), Install(numpy_1_6_0)])
開發者ID:awwad,項目名稱:depsolver,代碼行數:11,代碼來源:test_scenario.py

示例11: test_simple2

    def test_simple2(self):
        """Numpy depends on MKL, ensure we install the most up-to-date version."""
        repo = Repository([mkl_10_2_0, mkl_10_3_0, mkl_11_0_0, numpy_1_6_0, numpy_1_7_0])

        pool = Pool()
        pool.add_repository(repo)

        installed_repo = Repository()

        operations = solve(pool, R("numpy"), installed_repo, policy)
        self.assertEqual(operations, [Install(mkl_11_0_0), Install(numpy_1_7_0)])
開發者ID:awwad,項目名稱:depsolver,代碼行數:11,代碼來源:test_scenario.py

示例12: test_dependency_already_provided_but_older

    def test_dependency_already_provided_but_older(self):
        """Numpy depends on MKL, older MKL already installed."""
        repo = Repository([mkl_10_2_0, mkl_10_3_0, mkl_11_0_0, numpy_1_6_0, numpy_1_7_0])

        pool = Pool()
        pool.add_repository(repo)

        installed_repo = Repository([mkl_10_3_0])

        operations = solve(pool, R("numpy"), installed_repo, policy)
        self.assertEqual(operations, [Install(numpy_1_7_0)])
開發者ID:awwad,項目名稱:depsolver,代碼行數:11,代碼來源:test_scenario.py

示例13: test_simple_provided

    def test_simple_provided(self):
        r_operations = [Install(nomkl_numpy_1_7_0), Install(scipy_0_11_0)]
        repo = Repository([mkl_11_0_0, scipy_0_11_0, nomkl_numpy_1_7_0])

        pool = Pool()
        pool.add_repository(repo)

        installed_repo = Repository()

        operations = solve(pool, R("scipy"), installed_repo, policy)
        self.assertEqual(operations, r_operations)
開發者ID:awwad,項目名稱:depsolver,代碼行數:11,代碼來源:test_scenario.py

示例14: test_simple

    def test_simple(self):
        r_id = [1, 2]

        repo1 = Repository(packages=[self.mkl_10_1_0, self.mkl_10_2_0])
        pool = Pool()
        pool.add_repository(repo1)

        self.assertEqual(self.mkl_10_1_0.id, r_id[0])
        self.assertEqual(self.mkl_10_2_0.id, r_id[1])

        self.assertRaises(MissingPackageInfoInPool, lambda: pool.package_by_id(self.mkl_10_3_0.id))
開發者ID:awwad,項目名稱:depsolver,代碼行數:11,代碼來源:test_pool.py

示例15: test_no_install

    def test_no_install(self):
        """Ensure the most up-to-date version is installed when directly installed."""
        repo = Repository([mkl_10_1_0, mkl_10_2_0, mkl_10_3_0, mkl_11_0_0])

        pool = Pool()
        pool.add_repository(repo)

        installed_repo = Repository()

        operations = solve(pool, R("mkl"), installed_repo, policy)
        self.assertEqual(operations, [Install(mkl_11_0_0)])
開發者ID:awwad,項目名稱:depsolver,代碼行數:11,代碼來源:test_scenario.py


注:本文中的depsolver.pool.Pool類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。