本文整理汇总了Python中depsolver.pool.Pool.add_repository方法的典型用法代码示例。如果您正苦于以下问题:Python Pool.add_repository方法的具体用法?Python Pool.add_repository怎么用?Python Pool.add_repository使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类depsolver.pool.Pool
的用法示例。
在下文中一共展示了Pool.add_repository方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_package_by_id_simple
# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import add_repository [as 别名]
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))
示例2: setUp
# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import add_repository [as 别名]
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
示例3: test_complex_scenario_1
# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import add_repository [as 别名]
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"))))
示例4: setUp
# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import add_repository [as 别名]
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
示例5: test_simple
# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import add_repository [as 别名]
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))
示例6: test_add_repository
# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import add_repository [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)
示例7: test_simple
# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import add_repository [as 别名]
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))
示例8: test_simple
# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import add_repository [as 别名]
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)])
示例9: test_simple_provided
# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import add_repository [as 别名]
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)
示例10: test_no_install
# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import add_repository [as 别名]
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)])
示例11: test_dependency_already_provided_but_older
# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import add_repository [as 别名]
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)])
示例12: test_simple2
# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import add_repository [as 别名]
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)])
示例13: test_what_provides_include_indirect
# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import add_repository [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]))
示例14: test_already_installed_but_not_satisfied
# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import add_repository [as 别名]
def test_already_installed_but_not_satisfied(self):
"""Ensure we update to the most recent version when the requirement
is not already satisfied."""
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()
installed_repo.add_package(mkl_10_2_0)
operations = solve(pool, R("mkl >= 10.3.0"), installed_repo, policy)
self.assertEqual(operations, [Update(mkl_10_2_0, mkl_11_0_0)])
示例15: test_already_satisfied
# 需要导入模块: from depsolver.pool import Pool [as 别名]
# 或者: from depsolver.pool.Pool import add_repository [as 别名]
def test_already_satisfied(self):
"""Ensure we don't install a more recent version when the requirement
is already satisfied."""
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()
installed_repo.add_package(mkl_10_2_0)
operations = solve(pool, R("mkl"), installed_repo, policy)
self.assertEqual(operations, [])