Example #1
0
    def test_simple(self):
        r_package_string = "numpy-1.3.0"
        r_package = PackageInfo(name="numpy", version=V("1.3.0"))

        package = PackageInfo.from_string(r_package_string)

        self.assertEqual(package, r_package)
        self.assertEqual(package.package_string, r_package_string)
        self.assertRaises(DepSolverError, lambda: PackageInfo.from_string("numpy 1.3.0"))
Example #2
0
    def test_simple(self):
        r_package_string = "numpy-1.3.0"
        r_package = PackageInfo(name="numpy", version=V("1.3.0"))

        package = PackageInfo.from_string(r_package_string)

        self.assertEqual(package, r_package)
        self.assertEqual(package.package_string, r_package_string)
        self.assertRaises(DepSolverError,
                          lambda: PackageInfo.from_string("numpy 1.3.0"))
Example #3
0
    def test_dependencies(self):
        r_package_string = "numpy-1.6.0; depends (mkl >= 10.3.0)"
        r_package = PackageInfo(name="numpy", version=V("1.6.0"), dependencies=[R("mkl >= 10.3.0")])
        package = PackageInfo.from_string(r_package_string)

        self.assertEqual(package, r_package)
        self.assertEqual(package.package_string, r_package_string)
Example #4
0
    def test_replaces(self):
        r_package_string = "mkl_numpy-1.6.0; replaces (numpy == 1.6.0)"
        r_package = PackageInfo(name="mkl_numpy", version=V("1.6.0"), replaces=[R("numpy == 1.6.0")])
        package = PackageInfo.from_string(r_package_string)

        self.assertEqual(package, r_package)
        self.assertEqual(package.package_string, r_package_string)
Example #5
0
    def test_suggests(self):
        r_package_string = "numpy-1.6.0; suggests (scipy == 1.6.0)"
        r_package = PackageInfo(name="numpy", version=V("1.6.0"), suggests=[R("scipy")])

        package = PackageInfo.from_string(r_package_string)

        self.assertEqual(package, r_package)
        self.assertEqual(package.package_string, r_package_string)
Example #6
0
    def test_replaces(self):
        r_package_string = "mkl_numpy-1.6.0; replaces (numpy == 1.6.0)"
        r_package = PackageInfo(name="mkl_numpy",
                                version=V("1.6.0"),
                                replaces=[R("numpy == 1.6.0")])
        package = PackageInfo.from_string(r_package_string)

        self.assertEqual(package, r_package)
        self.assertEqual(package.package_string, r_package_string)
Example #7
0
    def test_dependencies(self):
        r_package_string = "numpy-1.6.0; depends (mkl >= 10.3.0)"
        r_package = PackageInfo(name="numpy",
                                version=V("1.6.0"),
                                dependencies=[R("mkl >= 10.3.0")])
        package = PackageInfo.from_string(r_package_string)

        self.assertEqual(package, r_package)
        self.assertEqual(package.package_string, r_package_string)
Example #8
0
    def test_conflicts(self):
        r_package_string = "nomkl_numpy-1.6.0; conflicts (numpy == 1.6.0)"
        r_package = PackageInfo(name="nomkl_numpy", version=V("1.6.0"),
                                conflicts=[R("numpy == 1.6.0")])

        package = PackageInfo.from_string(r_package_string)

        self.assertEqual(package, r_package)
        self.assertEqual(package.package_string, r_package_string)
Example #9
0
    def test_suggests(self):
        r_package_string = "numpy-1.6.0; suggests (scipy == 1.6.0)"
        r_package = PackageInfo(name="numpy",
                                version=V("1.6.0"),
                                suggests=[R("scipy")])

        package = PackageInfo.from_string(r_package_string)

        self.assertEqual(package, r_package)
        self.assertEqual(package.package_string, r_package_string)
Example #10
0
    def test_conflicts(self):
        r_package_string = "nomkl_numpy-1.6.0; conflicts (numpy == 1.6.0)"
        r_package = PackageInfo(name="nomkl_numpy",
                                version=V("1.6.0"),
                                conflicts=[R("numpy == 1.6.0")])

        package = PackageInfo.from_string(r_package_string)

        self.assertEqual(package, r_package)
        self.assertEqual(package.package_string, r_package_string)
Example #11
0
    def test_multiple_dependencies(self):
        r_package_string = "scipy-0.12.0; depends (numpy >= 1.6.0, " \
                           "numpy < 1.7.0, MKL >= 10.3.0, MKL < 10.4.0)"
        r_package = PackageInfo(name="scipy", version=V("0.12.0"),
                                dependencies=[R("numpy >= 1.6.0, numpy < 1.7.0"),
                                              R("MKL >= 10.3.0, MKL < 10.4.0")])

        package = PackageInfo.from_string(r_package_string)

        self.assertEqual(package, r_package)
        self.assertEqual(package.package_string, r_package_string)
Example #12
0
    def test_multiple_dependencies(self):
        r_package_string = "scipy-0.12.0; depends (numpy >= 1.6.0, " \
                           "numpy < 1.7.0, MKL >= 10.3.0, MKL < 10.4.0)"
        r_package = PackageInfo(name="scipy",
                                version=V("0.12.0"),
                                dependencies=[
                                    R("numpy >= 1.6.0, numpy < 1.7.0"),
                                    R("MKL >= 10.3.0, MKL < 10.4.0")
                                ])

        package = PackageInfo.from_string(r_package_string)

        self.assertEqual(package, r_package)
        self.assertEqual(package.package_string, r_package_string)
Example #13
0
    import \
        Repository
from depsolver.requirement \
    import \
        Requirement

from depsolver.solver.core \
    import \
        Install, Solver, Update
from depsolver.solver.policy \
    import \
        DefaultPolicy

R = Requirement.from_string

mkl_10_1_0 = PackageInfo.from_string("mkl-10.1.0")
mkl_10_2_0 = PackageInfo.from_string("mkl-10.2.0")
mkl_10_3_0 = PackageInfo.from_string("mkl-10.3.0")
mkl_11_0_0 = PackageInfo.from_string("mkl-11.0.0")

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

nomkl_numpy_1_7_0 = PackageInfo.from_string("nomkl_numpy-1.7.0; depends (numpy == 1.7.0)")

scipy_0_10_1 = PackageInfo.from_string("scipy-0.10.1; depends (numpy >= 1.6.0)")
scipy_0_11_0 = PackageInfo.from_string("scipy-0.11.0; depends (numpy >= 1.6.0)")
scipy_0_12_0 = PackageInfo.from_string("scipy-0.12.0; depends (numpy >= 1.7.0)")

policy = DefaultPolicy()
Example #14
0
    import \
        Repository
from depsolver.requirement \
    import \
        Requirement

from depsolver.solver.core \
    import \
        Install, Solver, Update
from depsolver.solver.policy \
    import \
        DefaultPolicy

R = Requirement.from_string

mkl_10_1_0 = PackageInfo.from_string("mkl-10.1.0")
mkl_10_2_0 = PackageInfo.from_string("mkl-10.2.0")
mkl_10_3_0 = PackageInfo.from_string("mkl-10.3.0")
mkl_11_0_0 = PackageInfo.from_string("mkl-11.0.0")

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

nomkl_numpy_1_7_0 = PackageInfo.from_string(
    "nomkl_numpy-1.7.0; depends (numpy == 1.7.0)")

scipy_0_10_1 = PackageInfo.from_string(
    "scipy-0.10.1; depends (numpy >= 1.6.0)")
scipy_0_11_0 = PackageInfo.from_string(
    "scipy-0.11.0; depends (numpy >= 1.6.0)")