def test_compare_versions(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        if not sys.platform.startswith("win"):
            # useful only on Windows
            return

        if sys.version_info[0] == 2:
            # not maintaining for Python 2.7
            return

        mods = [mod for mod in all_set() if mod.kind in ("wheel",)]
        fLOG(len(mods))
        assert len(mods) > 0
        clog = CustomLog(os.path.dirname(__file__),
                         "windows_modules_versions.txt")

        diff = []
        for i, mod in enumerate(mods[0:]):
            if mod.name in ["PySide", "cgal_bindings", "ad3"]:
                # skipping modules not available
                continue

            if i % 10 == 0:
                fLOG(i, mod)
            try:
                url1 = mod.get_exewheel_url_link(wheel=True)
            except MissingWheelException:
                url1 = None
            try:
                url2 = mod.get_exewheel_url_link2(wheel=True, source="2")
            except MissingWheelException:
                url2 = None
            if url1 is None and url2 is None:
                fLOG("missing package on both sides", mod)
                clog("missing package on both sides", mod)
                continue
            # fLOG(i, url1, url2)
            n1 = url1[-1] if url1 is not None else None
            n2 = url2[-1] if url2 is not None else None
            v1 = get_wheel_version(n1) if n1 is not None else None
            v2 = get_wheel_version(n2) if n2 is not None else None
            cmp = compare_version(
                v1, v2) if v1 is not None and v2 is not None else -2
            if cmp != 0:
                fLOG("---", i, v1, v2, mod.name)
                clog("---", i, v1, v2, mod.name)
                if v1 is not None and v2 is not None and not ("rc1" in v1 or "rc1" in v2):
                    diff.append(mod)

        assert len(diff) <= 10
    def test_compare_versions(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        if not sys.platform.startswith("win"):
            # useful only on Windows
            return

        if sys.version_info[0] == 2:
            # not maintaining for Python 2.7
            return

        mods = [mod for mod in all_set() if mod.kind in ("wheel",)]
        fLOG(len(mods))
        assert len(mods) > 0

        diff = []
        for i, mod in enumerate(mods[0:]):
            if mod.name in ["PySide", "cgal_bindings", "ad3"]:
                # skipping modules not available
                continue

            if i % 10 == 0:
                fLOG(i, mod)
            try:
                url1 = mod.get_exewheel_url_link(wheel=True)
            except MissingWheelException:
                url1 = None
            try:
                url2 = mod.get_exewheel_url_link2(wheel=True, source="2")
            except MissingWheelException:
                url2 = None
            if url1 is None and url2 is None:
                fLOG("missing package on both sides", mod)
                continue
            # fLOG(i, url1, url2)
            n1 = url1[-1] if url1 is not None else None
            n2 = url2[-1] if url2 is not None else None
            v1 = get_wheel_version(n1) if n1 is not None else None
            v2 = get_wheel_version(n2) if n2 is not None else None
            cmp = compare_version(
                v1, v2) if v1 is not None and v2 is not None else -2
            if cmp != 0:
                fLOG("---", i, v1, v2, mod.name)
                if v1 is not None and v2 is not None and not ("rc1" in v1 or "rc1" in v2):
                    diff.append(mod)

        assert len(diff) <= 10
    def test_install_azure(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_azure")
        if not os.path.exists(temp):
            os.mkdir(temp)
        for _ in os.listdir(temp):
            if os.path.isfile(os.path.join(temp, _)):
                os.remove(os.path.join(temp, _))

        r1 = compare_version("2.0.0rc5", "1.0.3")
        r2 = compare_version("1.0.3", "2.0.0rc5")
        assert r1 * r2 < 0
        assert r1 > 0
        if sys.platform.startswith("win") and sys.version_info[0] >= 3:
            m = find_module_install("azure")
            if m.pip_options is None:
                raise Exception("no pip_options, issue '{0}'".format(m))
            m.fLOG = fLOG
            name = m.download(temp_folder=temp)
            v = get_wheel_version(name)
            r = compare_version(v, "1.9.9")
            if r <= 0:
                raise Exception(
                    "unexception version for '{0}',\nshould be >= 1.9.9 not '{1}'".format(name, v))
            fLOG(m.version, v, name)
            assert os.path.exists(name)
            assert "azure" in name
Example #4
0
    def test_install_azure(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_azure")
        if not os.path.exists(temp):
            os.mkdir(temp)
        for _ in os.listdir(temp):
            if os.path.isfile(os.path.join(temp, _)):
                os.remove(os.path.join(temp, _))

        r1 = compare_version("2.0.0rc5", "1.0.3")
        r2 = compare_version("1.0.3", "2.0.0rc5")
        assert r1 * r2 < 0
        assert r1 > 0
        if sys.platform.startswith("win") and sys.version_info[0] >= 3:
            m = find_module_install("azure")
            if m.pip_options is None:
                raise Exception("no pip_options, issue '{0}'".format(m))
            m.fLOG = fLOG
            name = m.download(temp_folder=temp)
            v = get_wheel_version(name)
            r = compare_version(v, "1.9.9")
            if r <= 0:
                raise Exception(
                    "unexception version for '{0}',\nshould be >= 1.9.9 not '{1}'"
                    .format(name, v))
            fLOG(m.version, v, name)
            assert os.path.exists(name)
            assert "azure" in name